text
stringlengths
4
1.02M
meta
dict
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('organizers', '0001_initial'), ('applications', '0020_new_applications_20200402_1036'), ] operations = [ mig...
{ "content_hash": "09f9406c5cf863e18ecd35c436c843f4", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 118, "avg_line_length": 31.08, "alnum_prop": 0.6435006435006435, "repo_name": "hackupc/backend", "id": "be08bd3ba11e94dded5f5fdd662948966cdeede0", "size": "851", "binary"...
from __future__ import division import glob import json import os from collections import Counter from copy import deepcopy from fractions import Fraction from send_email import send_email try: import abcparse except ImportError: import gamc.abcparse as abcparse if not os.path.exists("ABCs"): os.makedir...
{ "content_hash": "d73257f479e0b4869df6db4e92ef0888", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 79, "avg_line_length": 27.611764705882354, "alnum_prop": 0.548146570089476, "repo_name": "Engine-Treasure/Graduation-Project", "id": "c882ed1385a684e485111e5f16fbbe096c8d0a6...
from __future__ import division from metrix_db.initialiser import processing_statistic_name_mapping # Name of columns for statistics stat_name_list = ['Overall_Stats', 'High_Res_Stats', 'Low_Res_Stats'] class XIA2Parser(object): ''' A class to represent the xia2 parser ''' def __init__(self, handle): ...
{ "content_hash": "02aaea4d28b66789223802ac7d1aca7f", "timestamp": "", "source": "github", "line_count": 379, "max_line_length": 97, "avg_line_length": 29.99208443271768, "alnum_prop": 0.623207530570951, "repo_name": "jmp1985/metrix-database", "id": "236483903fb714d188d3932e663cfe17c7e564ed", "size"...
from random import choice, shuffle names_fd = open('names.txt', 'ro') names = map(lambda name: name.strip(), names_fd.readlines()) names_fd.close() events = [] for i in xrange(3): events.append("friends") events.append("hates") entries = set() while len(entries) < 8000: event = choice(events) pers...
{ "content_hash": "6d57bd95cff1e97b09bd03505362e36e", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 60, "avg_line_length": 15.625, "alnum_prop": 0.608, "repo_name": "MAPSuio/spring-challenge16", "id": "22e0b4ff9919a93b2eae00eb638817ac9a034791", "size": "625", "binary": ...
import re from django.utils.text import compress_string from django.utils.cache import patch_vary_headers from django import http try: import settings XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS XS_SHARING_ALLOWED_METHODS = settings.XS_SHARING_ALLOWED_METHODS XS_SHARING_ALLOW...
{ "content_hash": "2ebd680aede9102acb1e3cabcb0a5292", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 94, "avg_line_length": 36.958333333333336, "alnum_prop": 0.6623449830890643, "repo_name": "chrispbailey/duat", "id": "4405644e915737b745281b87b40a953c53514b55", "size": "17...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.6.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class V1Resourc...
{ "content_hash": "a2b6b17c8196f1da792ece8a7b09ec20", "timestamp": "", "source": "github", "line_count": 268, "max_line_length": 360, "avg_line_length": 30.511194029850746, "alnum_prop": 0.5750275162039868, "repo_name": "skuda/client-python", "id": "716746018a732a5954da03aa9870e421d3532a33", "size":...
''' This module handles rendering the gradebook and its associated functions such as download and handling rendering rows of the table ''' #Import the app from app import app #Import needed flask functions from flask import g, render_template, redirect, url_for, flash, jsonify, abort from flask import request, after_...
{ "content_hash": "0d3985cddf00eb2800f0baac8c77594d", "timestamp": "", "source": "github", "line_count": 425, "max_line_length": 117, "avg_line_length": 30.569411764705883, "alnum_prop": 0.6428571428571429, "repo_name": "noellekimiko/HMC-Grader", "id": "52136a338e0e94fd32832fe3441c4056e052a654", "si...
''' Petitboot Internationalization (i8n) ------------------------------------ Test that Petitboot can correctly display languages other than English. ''' import time import pexpect import unittest import OpTestConfiguration from common.OpTestSystem import OpSystemState import common.OpTestMambo as OpTestMambo import...
{ "content_hash": "6509a51c32fa0a7e82afce449a731a88", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 78, "avg_line_length": 38.44776119402985, "alnum_prop": 0.6319875776397516, "repo_name": "open-power/op-test-framework", "id": "6453c906aeddb39d7e428ad0f8b0879380feafcf", "...
"""Binary for evaluating Tensorflow models on the YouTube-8M dataset.""" import time import numpy import eval_util import losses import ensemble_level_models import readers import tensorflow as tf from tensorflow import app from tensorflow import flags from tensorflow import gfile from tensorflow import logging impor...
{ "content_hash": "e8ef1df525017589e2720df52d183759", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 136, "avg_line_length": 35.719367588932805, "alnum_prop": 0.6408100033196857, "repo_name": "wangheda/youtube-8m", "id": "31d8babf6a47f6fc36d0070d244d424e2c424aa2", "size":...
from __future__ import absolute_import from .base_model_ import Model from datetime import date, datetime from typing import List, Dict from ..util import deserialize_model class Manifest(Model): """ NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. ...
{ "content_hash": "9aee620031d99c90a75b53a0b88a6639", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 207, "avg_line_length": 30.757009345794394, "alnum_prop": 0.5928289273776968, "repo_name": "EduJGURJC/elastest-service-manager", "id": "03ed71e57a03947f6407d2d418596e2b2595a...
import unittest def get_tests(): return full_suite() def full_suite(): from .msgpack_ext import MsgPackTestCase #from .nodes import NodeTestCase msgpack_suite = unittest.TestLoader().loadTestsFromTestCase(MsgPackTestCase) #node_suite = unittest.TestLoader().loadTestsFromTestCase(NodeTestCase) ...
{ "content_hash": "dd0c8b85324af518d46177c8cd9f1648", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 80, "avg_line_length": 24.533333333333335, "alnum_prop": 0.7472826086956522, "repo_name": "meteotest/hurray-py", "id": "bfe8cad90c4761832f1b199567571fa59a06677a", "size": "...
import glob import lxml.etree import os import re from checker.base import BakeryTestCase as TestCase from fontaine.builder import Director, Builder from fontaine.cmap import library COPYRIGHT_REGEX = re.compile(r'Copyright.*?20\d{2}.*', re.U | re.I) def get_test_subset_function(value): def function(self): ...
{ "content_hash": "3d124b446f770c6a667ef2cc0ef15103", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 107, "avg_line_length": 33.62162162162162, "alnum_prop": 0.5860128617363344, "repo_name": "vitalyvolkov/fontbakery", "id": "1e2b4daae69f0ea9707b5ce24e0749c671b91d1d", "siz...
import datetime from south.db import db from south.v2 import DataMigration from django.db import models from django.template.defaultfilters import slugify class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." for storytemplate in orm.StoryTemplate.objects.all...
{ "content_hash": "66be9b1f7ac69c5c530a38fc6fa87170", "timestamp": "", "source": "github", "line_count": 326, "max_line_length": 268, "avg_line_length": 87.97546012269939, "alnum_prop": 0.5591701534170154, "repo_name": "denverfoundation/storybase", "id": "aa550e687dbf03bae27b12c3e09d7fffd81da09c", "...
from tests.integration.integration_test_case import IntegrationTestCase class TestQuestionnairePiping(IntegrationTestCase): def test_given_quotes_in_answer_when_piped_into_page_then_html_escaped_quotes_on_page(self): # Given self.launchSurvey('test', 'multiple_piping') self.post(action='st...
{ "content_hash": "ba3e8474e8314a21280ac8d35a453557", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 96, "avg_line_length": 35.15853658536585, "alnum_prop": 0.5962539021852237, "repo_name": "ONSdigital/eq-survey-runner", "id": "655dab88d7ebf6f1685779cd231caa66e7f1a3d2", "s...
"""Utility function for installing MathJax javascript library into your IPython nbextensions directory, for offline use. Authors: * Min RK * Mark Sienkiewicz * Matthias Bussonnier To download and install MathJax: From Python: >>> from IPython.external.mathjax import install_mathjax >>> install_mathjax(...
{ "content_hash": "5aeb26ee1fe6e07ddeb6049dbf762110", "timestamp": "", "source": "github", "line_count": 240, "max_line_length": 103, "avg_line_length": 29.775, "alnum_prop": 0.6059333893087042, "repo_name": "mattvonrocketstein/smash", "id": "daf4744cd54c3c0e46709a01c041831af0ebccd8", "size": "7164"...
import _plotly_utils.basevalidators class DtickValidator(_plotly_utils.basevalidators.AnyValidator): def __init__( self, plotly_name="dtick", parent_name="scatterpolargl.marker.colorbar", **kwargs, ): super(DtickValidator, self).__init__( plotly_name=plotly_...
{ "content_hash": "9facd8774fae8474f0b9b0bb25520aa2", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 78, "avg_line_length": 31.11764705882353, "alnum_prop": 0.5784499054820416, "repo_name": "plotly/plotly.py", "id": "0a2c3842632a4c5d1527e7a8c6d6db57154babcc", "size": "529"...
import argparse import json import os from os import path import re import subprocess import sys KEYNAME = 'paperspace-termux-cli' VMNAME = 'ps-game' ## todo: generalize to include azure, bokken :D def fatal_paperspace(error): sys.exit(f"fatal (paperspace): {error}") def run_paperspace(args): result = sub...
{ "content_hash": "db527140f34a22756f1851f42a1b2bc7", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 82, "avg_line_length": 28.373333333333335, "alnum_prop": 0.6837406015037594, "repo_name": "scottbilas/dotfiles", "id": "f368847ad7770876715fb0cb09f7c788c2ceccd4", "size": "...
import setuptools with open("README.rst", "r") as fh: long_description = fh.read() namespaces = ['compatibility_lib'] setuptools.setup( name="compatibility_lib", version="0.1.11", author="Cloud Python", description="A library to get and store the dependency compatibility " "stat...
{ "content_hash": "5034a0ace773158114b09cd836cda349", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 78, "avg_line_length": 29.379310344827587, "alnum_prop": 0.6549295774647887, "repo_name": "GoogleCloudPlatform/cloud-opensource-python", "id": "030867e69e79df070b98f8918858a0...
""" Flip API Flip # noqa: E501 The version of the OpenAPI document: 3.1 Contact: [email protected] Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from telestream_cloud_flip.configuration import Configuration class CreateEncodingBo...
{ "content_hash": "dca0d32b2d2dcd12fba61343c3b12a80", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 119, "avg_line_length": 30.084269662921347, "alnum_prop": 0.576657329598506, "repo_name": "Telestream/telestream-cloud-python-sdk", "id": "7f4c4bf41b175f48173b3b7426e8c4bfe5...
"""Class for representing a single entity in the Cloud Datastore. Entities are akin to rows in a relational database, storing the actual instance of data. Each entity is officially represented with a :class:`gclouddatastore.key.Key` class, however it is possible that you might create an Entity with only a partial Key...
{ "content_hash": "3c2fa5b0ba7e7ef2bf49a4a45515af42", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 100, "avg_line_length": 32.17674418604651, "alnum_prop": 0.6704249783174328, "repo_name": "jgeewax/gclouddatastore", "id": "b9543bb75e8b0decebb0e2670feca1b1a49de49d", "siz...
from django.contrib import admin from restaurant.models import Suggestion, MenuCategory, FoodCategory, FoodItem, FoodMenu, ItemChoice, RestaurantInfo, BusinessHours, AlbumGallery, ImageGallery, LikeFoodMenu class FoodMenuInline(admin.StackedInline): model = FoodMenu extra = 0 class FoodItemAdmin(admin.ModelAd...
{ "content_hash": "95943b18f76e29a5b878b4c485f3782c", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 173, "avg_line_length": 33.785714285714285, "alnum_prop": 0.7610993657505285, "repo_name": "prinnb/cs242-final-project", "id": "b7ba066a456b993c797634e53b19095381bc2d6a", "...
from cpp11_thread_local import * t = ThreadLocals() if t.stval != 11: raise RuntimeError if t.tsval != 22: raise RuntimeError if t.tscval99 != 99: raise RuntimeError cvar.etval = -11 if cvar.etval != -11: raise RuntimeError cvar.stval = -22 if cvar.stval != -22: raise RuntimeError cvar.tsval = -...
{ "content_hash": "c5bd190b5932ed38622745a2be9cc9e9", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 32, "avg_line_length": 16.972972972972972, "alnum_prop": 0.6656050955414012, "repo_name": "DEKHTIARJonathan/BilletterieUTC", "id": "83f2390ecf07dc8cecef433a5ac43750c9ffec94",...
"""Python configuration for RatioExpressionInput interaction.""" from __future__ import annotations from extensions.interactions import base from typing import List, Optional MYPY = False if MYPY: # pragma: no cover from extensions import domain class RatioExpressionInput(base.BaseInteraction): """Intera...
{ "content_hash": "596d2953d2ca85b9b0a423e2a26e0e1a", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 77, "avg_line_length": 30.677966101694917, "alnum_prop": 0.5756906077348066, "repo_name": "oppia/oppia", "id": "5ef67990f7190e8d603246eb4347c643395392f3", "size": "2414", ...
from django.test import TestCase class BaseTestCase(TestCase): def test_response(self): response = self.client.get('/') self.assertEqual(response.status_code, 200) from django.contrib.auth.models import User user = User.objects.create(username='testuser') user.set_passwo...
{ "content_hash": "dd9d86c0361c1c881e5d89092bc96e2e", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 71, "avg_line_length": 28.727272727272727, "alnum_prop": 0.6550632911392406, "repo_name": "klen/starter-python-django", "id": "1d51170f49d425cabaff05fbca4a921c1176db0f", "s...
import logging import sys # Borrowed from (modified) https://www.electricmonk.nl/log/2011/08/14/redirect-stdout-and-stderr-to-a-logger-in-python/ # This class is to redirect stdout and stderr to a file class StreamToLogger(object): """ Fake file-like stream object that redirects writes to a logger instance....
{ "content_hash": "7c4491dc9264fd3dc921b15d730cd89e", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 119, "avg_line_length": 27.17948717948718, "alnum_prop": 0.6650943396226415, "repo_name": "aosoble/identitybot", "id": "40fd138ec0766fd1457952ea25046f0f480cea22", "size": "...
from collections import namedtuple import re from contextlib2 import ExitStack import numpy as np import pandas as pd import sqlalchemy as sa from toolz import first from zipline.errors import AssetDBVersionError from zipline.assets.asset_db_schema import ( ASSET_DB_VERSION, asset_db_table_names, asset_ro...
{ "content_hash": "7b30aa9635a302284a0ea644cbf618a9", "timestamp": "", "source": "github", "line_count": 684, "max_line_length": 79, "avg_line_length": 31.970760233918128, "alnum_prop": 0.5672672398024511, "repo_name": "bernoullio/toolbox", "id": "cbeb7c464caa1a3f263e9d3085582738b916586e", "size": "...
import json from tempest.common import rest_client class VersionV3ClientJSON(rest_client.RestClient): def __init__(self, config, username, password, auth_url, tenant_name=None): super(VersionV3ClientJSON, self).__init__(config, username, password, auth_u...
{ "content_hash": "92ebe5e00e785a910051f1b8f238f18c", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 79, "avg_line_length": 33.94117647058823, "alnum_prop": 0.5597920277296361, "repo_name": "BeenzSyed/tempest", "id": "1773af58a731f8f43b29555cc4f6c310c70107b3", "size": "120...
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import print_function, unicode_literals import os try: import koji as koji except ImportError: import inspect im...
{ "content_hash": "86ef7644ee2a761440fd14d1ca33039d", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 91, "avg_line_length": 29.256410256410255, "alnum_prop": 0.5896874087058136, "repo_name": "vrutkovs/atomic-reactor", "id": "a3fd406264d3d1c54108ef31513df04ab533129e", "siz...
import warnings from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ from django.core.exceptions import ImproperlyConfigured default_app_config = 'leonardo.module.search.SearchConfig' class Default(object): optgroup = 'Search' @property def apps(self): INST...
{ "content_hash": "b5af43a43a73020ec3cc4e1c0f4d7227", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 79, "avg_line_length": 26.568181818181817, "alnum_prop": 0.5936698032506416, "repo_name": "django-leonardo/django-leonardo", "id": "c544faa6fec38a658d8b4cb671a44f961dbf533a",...
import pygame, sys from screen import screen from constants import * # font_path = pygame.font.match_font('Arial') font_path = pygame.font.get_default_font() def draw_text(text, center, color=white, size=30, bold=False, background=None, left=False): font = pygame.font.Font(font_path, size, bold=bold...
{ "content_hash": "891c6ac050d87f920fd2bddee51ad3c5", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 78, "avg_line_length": 28.04225352112676, "alnum_prop": 0.6443997990959317, "repo_name": "lambdaloop/CIT-biosignals", "id": "66154479b67bce8386585a7d016d8f7957f230a9", "siz...
import os import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # sys.path.insert(0, os.path.abspath('.')) # -- General con...
{ "content_hash": "4fcb4eac84ad45a11841fe72a122c4eb", "timestamp": "", "source": "github", "line_count": 232, "max_line_length": 80, "avg_line_length": 31.70258620689655, "alnum_prop": 0.6924541128484024, "repo_name": "0cN/tb", "id": "c58026ba068afc01f2e87c565c881b637c59d391", "size": "7749", "bin...
import unittest from sql import Asc, Desc, Column, Table class TestOrder(unittest.TestCase): column = Column(Table('t'), 'c') def test_asc(self): self.assertEqual(str(Asc(self.column)), '"c" ASC') def test_desc(self): self.assertEqual(str(Desc(self.column)), '"c" DESC')
{ "content_hash": "3244ceba486d1e73ee7c34c350b74dea", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 60, "avg_line_length": 23.384615384615383, "alnum_prop": 0.6414473684210527, "repo_name": "shnergle/ShnergleServer", "id": "6d859cde8fa4ec264d39d022af0e9545a4fec2f0", "size...
''' Test framework for insights modules ----------------------------------- :copyright (c) 2014 Xavier Bruhiere :license: Apache 2.0, see LICENSE for more details. ''' import abc import unittest from nose.tools import ok_, nottest import pytz import pandas as pd import datetime as dt import random import yaml...
{ "content_hash": "a47243d45881a6fb7874517c17384f14", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 76, "avg_line_length": 29.606299212598426, "alnum_prop": 0.6058510638297873, "repo_name": "intuition-io/insights", "id": "c78ddc238f776fcfa4919c0c3402dfa9e1f3e7d5", "size"...
from django.shortcuts import render from django.http import HttpResponseRedirect, HttpResponse from FileManager.forms import CloudFileForm from FileManager.models import CloudFile, Genre import json def index(request): return render(request, 'index-fm.html') def show_genres(request): return render(request, ...
{ "content_hash": "9405e37ee3a053b0f37f63a1c4cc29b5", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 80, "avg_line_length": 30.735849056603772, "alnum_prop": 0.5991405770411296, "repo_name": "Yuvv/LearnTestDemoTempMini", "id": "ade58d39e6810c96ab511163563d896bfef361cb", "s...
''' This script is used for generating data for Deopen training. Usage: python Gen_data.py -pos <positive_bed_file> -neg <negative_bed_file> -out <outputfile> python Gen_data.py -l 1000 -s 100000 -in <inputfile> -out <outputfile> ''' import numpy as np from pyfasta import Fasta import hickle as hkl import argp...
{ "content_hash": "99cb850999a015aad6afa1b26bc8b083", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 99, "avg_line_length": 38.29347826086956, "alnum_prop": 0.5994890718137951, "repo_name": "kimmo1019/Deopen", "id": "7bb8205d0dbc30776b13b59ab481fb6c196b13a5", "size": "3523...
from django.db import models from django.utils.translation import ugettext_lazy as _ from sortedm2m.fields import SortedManyToManyField class LightningTalk(models.Model): title = models.CharField(_("Title"), max_length=255) speakers = SortedManyToManyField( "speakers.Speaker", related_name='lightning...
{ "content_hash": "621afde6b87edf5578392c18bd59a898", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 75, "avg_line_length": 36.25, "alnum_prop": 0.7086206896551724, "repo_name": "pysv/djep", "id": "3901208a2bf722404c276a5aed0c54caacdf0fb5", "size": "580", "binary": false...
import json from pprint import pprint ''' Find which program codes are not in the majors.json file ''' def parse(): code_file = open("codes.txt", "r") codes = [] for line in code_file: codes.append(line) with open('../json/majors.json') as data_file: data = json.load(data_file) ...
{ "content_hash": "bf314626cb56609de41a86a86b0aed4c", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 57, "avg_line_length": 19.675675675675677, "alnum_prop": 0.5686813186813187, "repo_name": "patrickleweryharris/major-finder", "id": "86acdbbff118d1fe86db7771a3b8cce12d51f07d"...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from train_utils import batchify_data, run_epoch, train_model, Flatten import utils_multiMNIST as U path_to_data_dir = '../Datasets/' use_mini_dataset = True batch_size = 64 nb_classes = 10 nb_epoch = 30 num_classes = 10 img_rows, im...
{ "content_hash": "c6d031ec0b264bab4edb2a146a0bc44d", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 126, "avg_line_length": 33.58461538461538, "alnum_prop": 0.6582684379294549, "repo_name": "xunilrj/sandbox", "id": "b3a9340a3008126b08a5a978777e695e25d37e30", "size": "2183...
""" Django settings for fitster project. Generated by 'django-admin startproject' using Django 1.10.2. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os...
{ "content_hash": "8b5c35dba3ba49c078001270f363e07a", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 96, "avg_line_length": 26.866336633663366, "alnum_prop": 0.6379215035931454, "repo_name": "TalatCikikci/Fall2016Swe573_HealthTracker", "id": "b033b148118b29087cb4532f86e706f...
from toontown.building import DistributedBBElevatorAI from toontown.building import FADoorCodes from toontown.building.DistributedBoardingPartyAI import DistributedBoardingPartyAI from toontown.coghq import DistributedCogKartAI from toontown.hood import CogHQAI from toontown.suit import DistributedBossbotBossAI from to...
{ "content_hash": "5a0e4ee849101d24234b93ddcb0347b2", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 89, "avg_line_length": 39.25, "alnum_prop": 0.6658500734933855, "repo_name": "ToonTownInfiniteRepo/ToontownInfinite", "id": "6ab44ecaf9b705085ca8fa6c03a185d8f03ab605", "siz...
from scout.commands import cli from scout.server.extensions import store def test_update_user(mock_app, user_obj): """Tests the CLI that updates a user""" runner = mock_app.test_cli_runner() assert runner # Test CLI base, no arguments provided result = runner.invoke(cli, ["update", "user"]) ...
{ "content_hash": "c42d70e45dada939e2598fbdb00d5004", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 92, "avg_line_length": 42.391304347826086, "alnum_prop": 0.6533333333333333, "repo_name": "Clinical-Genomics/scout", "id": "96dca4fcd2dbcf01997583ee5416b864782f1389", "size...
"""Rasterio""" from __future__ import absolute_import from collections import namedtuple import logging try: from logging import NullHandler except ImportError: # pragma: no cover class NullHandler(logging.Handler): def emit(self, record): pass import warnings from rasterio._base import ...
{ "content_hash": "a61cba56b36e4d24cc28a456aa766a64", "timestamp": "", "source": "github", "line_count": 326, "max_line_length": 81, "avg_line_length": 31.726993865030675, "alnum_prop": 0.6440104418447259, "repo_name": "ryfeus/lambda-packs", "id": "556e5c754edf56592bbee0d6e3a4f7a958028626", "size": ...
from __future__ import print_function from __future__ import division import gc import os from builtins import object from past.utils import old_div import tensorflow as tf import numpy as np import deep_architect.core as co from deep_architect.helpers.tensorflow_eager_support import set_is_training tfe = tf.contrib...
{ "content_hash": "0e57b46b1e5c4b65b61df360db80e44c", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 97, "avg_line_length": 39.24404761904762, "alnum_prop": 0.5696951311997573, "repo_name": "negrinho/deep_architect", "id": "cb20a897e0ce3fa0bb12341703714b3e822bc2d1", "size...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'ProjectMember.member' db.alter_column('cms_projectmember', 'member_id', self.gf('django.db.models.fields.r...
{ "content_hash": "c06c118c9b0076ab0d696a70c67557a6", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 182, "avg_line_length": 69.832, "alnum_prop": 0.541871921182266, "repo_name": "ncsu-stars/Stars-CMS", "id": "e4cb7726b5b81970c0f6b56c02f2ec91e68b44ae", "size": "8747", "...
""" Display drag from the app into the graph widget and the event bridge. This is similar to the hello world sample. """ import sys from PyQt5 import QtWidgets from PyQt5.QtCore import QSize from PyQt5.QtGui import QDrag from PyQt5.QtWidgets import QGridLayout from PyQt5.QtWidgets import QMainWindow from PyQt5.QtWidge...
{ "content_hash": "574ffac662c726732b7125deacd21c43", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 98, "avg_line_length": 33.62589928057554, "alnum_prop": 0.6050492083868207, "repo_name": "ESSS/qmxgraph", "id": "47945ee9c91833613f9582cd77c0fbbd4fe95637", "size": "4674",...
import os import json from datetime import datetime from flask import Flask from flask import render_template, url_for, request, jsonify from flask import send_from_directory from flask.ext.sqlalchemy import SQLAlchemy from werkzeug.utils import secure_filename ALLOWED_EXTENSIONS = ['JPEG', 'JPG', 'PNG', 'GIF'] a...
{ "content_hash": "43bded2ea3a197eb737bb519fcd7d779", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 84, "avg_line_length": 28.662790697674417, "alnum_prop": 0.598580121703854, "repo_name": "SoftwareDefinedBuildings/Building-Mapper", "id": "e63524cebcc6aed28fed35e42a758f1ad...
from django import http from mox import IsA from horizon import api from horizon import context_processors from horizon import middleware from horizon import test class ContextProcessorTests(test.TestCase): def setUp(self): super(ContextProcessorTests, self).setUp() self._prev_catalog = self.requ...
{ "content_hash": "639b2c8a265ddaf3c325b3a7af6b83da", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 73, "avg_line_length": 39.6764705882353, "alnum_prop": 0.6604892512972572, "repo_name": "developerworks/horizon", "id": "30102282b257579fc0419106f60c85ae73e88852", "size": ...
"""SumgMug OAuth client.""" from typing import Optional import signal import socket import subprocess import sys import threading from urllib import parse import webbrowser from dataclasses import dataclass import bottle import rauth import requests_oauthlib OAUTH_ORIGIN = 'https://secure.smugmug.com' REQUEST_TOKEN...
{ "content_hash": "8347bc8e9578f45666093bd990e1f0fe", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 77, "avg_line_length": 29.851282051282052, "alnum_prop": 0.6488575846074558, "repo_name": "graveljp/smugcli", "id": "62af6a6b96a6fa78d86a03b24e9e27163395a027", "size": "58...
from content import Content __author__ = 'carlos' from bottle import get, post, request, run # or route import json import content @post('content/') def create(): content = Content.from_json(request.json['cmd']) return "OK" run(host='localhost', port=8080, debug=True)
{ "content_hash": "111045c3c032e15c0723410aae7fc863", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 54, "avg_line_length": 20.142857142857142, "alnum_prop": 0.6950354609929078, "repo_name": "distributed-cms/rest-api", "id": "c361d9bb51d2ee6bb2fa898eb5d70ef6202df5b3", "siz...
import sys from django.conf import settings from django.core.management.base import BaseCommand, CommandError from ...utils import get_indices, create_indices, rebuild_indices, delete_indices try: raw_input except NameError: raw_input = input class Unbuffered(object): def __init__(self, stream): ...
{ "content_hash": "e10a121befd7ef1a1e6dddd782e36616", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 184, "avg_line_length": 41.415929203539825, "alnum_prop": 0.5918803418803419, "repo_name": "jaddison/django-simple-elasticsearch", "id": "f9ad91efa8e93cfeda4d76a8e9d1040aee4...
_remote_command = lambda magic_word: 'remote:{}'.format(magic_word) class Message(object): def __init__(self, content, additional = None): self.__content = content self.__additional = additional @property def content(self): return self.__content @property def additional...
{ "content_hash": "36e14bb48d8336f40244a7401700c031", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 67, "avg_line_length": 26.526315789473685, "alnum_prop": 0.628968253968254, "repo_name": "shiroyuki/vireo", "id": "dcd02670fb6e490767e37e3b46e457edc9424afe", "size": "504",...
import socket import bluetooth import threading class ServerWalle: def __init__(self,host,port): self.host = host self.port = port self.bt_address = '00:15:FF:F3:E2:09' self.bt_port = 1 self.buff_bt = 1024 self.buff_sock = 1024 self.run_thread = True ...
{ "content_hash": "4a54afce14a7b8346019eea44c901b05", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 75, "avg_line_length": 31.967032967032967, "alnum_prop": 0.5503609487796494, "repo_name": "GeorgEncinas/Multi-Agents", "id": "0ccfca7aa6663daf23c10a8431af4f6cb101ad4e", "si...
import os import json import subprocess from error_codes import * from errors import error_info, is_error, print_errors from helpers import general_info, geninfo_lookup from .check_endpts import check_internet_connect, check_ama_endpts from .check_imds import check_imds_api def ch...
{ "content_hash": "17ae5bcb3cf5c9f4694d843cab59d0ea", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 107, "avg_line_length": 39.816901408450704, "alnum_prop": 0.5795896710293598, "repo_name": "Azure/azure-linux-extensions", "id": "e4600caed3919cadf31b534dba75b5d98ad4c944", ...
import re, subprocess, os from typing import Callable, Tuple, Union, cast, Dict, Any from utils import getProjPath, runSubprocess TEXCOUNT_PATH = "../../TeXcount_3_1/texcount.pl" def parseOutput(data: str, regex: str) -> Dict[str, Any]: s, s2 = None, None if "Subcounts:" in data: s, s2 = data.split("Subcounts:\n...
{ "content_hash": "8876dcf4a09206104a535ca383a67ebb", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 278, "avg_line_length": 33.387387387387385, "alnum_prop": 0.6181867242309768, "repo_name": "mischnic/python-ci", "id": "024bb6e67cd2d0c105a7af0c746c280a7a3abf33", "size": ...
from django import forms from django.forms.util import ValidationError from django.utils.translation import ugettext as _ from selectfilter.forms import FilteredSelectMultiple, SelectBoxFilter, HyperLinksFilter from selectfilter import utils class AjaxManyToManyField(forms.ModelMultipleChoiceField): """ Base many t...
{ "content_hash": "53cc6a0fb7213fef5a9ff4b7b5334028", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 106, "avg_line_length": 35.35820895522388, "alnum_prop": 0.7049387927395525, "repo_name": "gista/django-selectfilter", "id": "712dadbe1664c27583751d429512536f98e7b9ea", "s...
"""This module contains an object that represents a location to which a chat is connected.""" from typing import TYPE_CHECKING, Optional from telegram._files.location import Location from telegram._telegramobject import TelegramObject from telegram._utils.types import JSONDict if TYPE_CHECKING: from telegram imp...
{ "content_hash": "e2347ee410dc925a08a118db6fa02acf", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 97, "avg_line_length": 32.148148148148145, "alnum_prop": 0.6532258064516129, "repo_name": "tzpBingo/github-trending", "id": "f32867235592a5a92e8bb3d18b306f30f4a7b35e", "siz...
""" This module is part of the nmeta suite running on top of Ryu SDN controller. It provides a policy class as an interface to policy configuration and classification of packets against policy. See Policy class docstring for more information. """ import sys import os import datetime #*** nmeta imports: import tc_sta...
{ "content_hash": "a297d6e9d368d77db5d5ae5912e51880", "timestamp": "", "source": "github", "line_count": 956, "max_line_length": 94, "avg_line_length": 39.99686192468619, "alnum_prop": 0.5587258414624579, "repo_name": "mattjhayes/nmeta", "id": "316d4c12cccc7e9304263734263d1e1546143b61", "size": "388...
"""ML-ENSEMBLE Test base functions used by sublearners """ import os import numpy as np from mlens.parallel._base_functions import slice_array, assign_predictions # TODO: Write tests
{ "content_hash": "1f01dbee90c5713ab157f0c37f833186", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 75, "avg_line_length": 20.666666666666668, "alnum_prop": 0.7741935483870968, "repo_name": "flennerhag/mlens", "id": "569af0a9ffb7ac3f9ae00449423f3ca2669721f5", "size": "186"...
import unittest from azure.cli.core.commands.client_factory import get_subscription_id from azure.cli.testsdk import ( ScenarioTest, record_only ) from azure.cli.command_modules.serviceconnector._resource_config import ( RESOURCE, SOURCE_RESOURCES, TARGET_RESOURCES ) from ._test_utils import Credent...
{ "content_hash": "a4c6bf76e0c0d6ff2266562c4ea6e759", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 158, "avg_line_length": 40.98148148148148, "alnum_prop": 0.610784756740473, "repo_name": "yugangw-msft/azure-cli", "id": "db45584544f837f154d8189c16333b6947afe15d", "size"...
"""Work with combinations of relationships, like *part_of* and *regulates*""" from __future__ import print_function __copyright__ = "Copyright (C) 2017-present, DV Klopfenstein, H Tang et al. All rights reserved." from goatools.godag.consts import RELATIONSHIP_SET class RelationshipCombos: """Work with combina...
{ "content_hash": "a61048674b6ee4fd058ebfe38531df44", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 99, "avg_line_length": 45.19101123595506, "alnum_prop": 0.6133764296369966, "repo_name": "tanghaibao/goatools", "id": "a844e908587982e9d1c89f0f0a1c81d495d7130b", "size": "4...
import numpy as np # C modules try: from chronostar._overall_likelihood import get_overall_lnlikelihood_for_fixed_memb_probs except ImportError: print("C IMPLEMENTATION OF expectation NOT IMPORTED") USE_C_IMPLEMENTATION = False TODO = True # NOW WHAT? # Read in stellar data from chronostar import tab...
{ "content_hash": "57e72bac192899e7e870cba64cc0be64", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 105, "avg_line_length": 35.94047619047619, "alnum_prop": 0.48526001987413053, "repo_name": "mikeireland/chronostar", "id": "c98d8f4a8207f34fe063f8469e57f30abcb98c66", "size...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cavstudio_backend.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the # is...
{ "content_hash": "42a701b539d8367c5fe96119f99622df", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 81, "avg_line_length": 37.76190476190476, "alnum_prop": 0.6242118537200504, "repo_name": "google-research/mood-board-search", "id": "264ad823076f1e62e9fe6e411c946eccb9663e96"...
from machina.core.db.models import get_model from machina.test.mixins import AdminBaseViewTestMixin from machina.test.testcases import AdminClientTestCase Post = get_model('forum_conversation', 'Post') Topic = get_model('forum_conversation', 'Topic') class TestPostAdmin(AdminClientTestCase, AdminBaseViewTestMixin):...
{ "content_hash": "421de60d985b2b0ffdcdd73afd840684", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 66, "avg_line_length": 28.333333333333332, "alnum_prop": 0.8023529411764706, "repo_name": "franga2000/django-machina", "id": "4828931a0866577a629cc063ca8a1680813256ad", "si...
""" OTAA Node example compatible with the LoPy Nano Gateway """ from network import LoRa from network import WLAN import binascii import pycom import socket import struct import time import config as c #Disable wifi or let default SSID if c.DIS_WIFI: wlan = WLAN() wlan.deinit() # Set heartbeat pycom.heartbe...
{ "content_hash": "a518f401c4cd3eb537d15612a58eeb17", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 97, "avg_line_length": 25.345238095238095, "alnum_prop": 0.6632221700328793, "repo_name": "FablabLannion/LoPy", "id": "cb656c1d011e4b367d88117005cd30bf16816d57", "size": "2...
import argparse def parse_args(): parser = argparse.ArgumentParser(description='A terminal based typing tutor') parser.add_argument('file', metavar='file', type=str,help='the file you want use for typing') parser.add_argument('-s','--silent',action="store_true",default=False,help='show stats at the end')...
{ "content_hash": "9fbe41f0fcd576520a2d0db0763792c4", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 103, "avg_line_length": 39.111111111111114, "alnum_prop": 0.7159090909090909, "repo_name": "girishramnani/t3", "id": "247279a32be32e47ec0fcd3faba4cb84ba779e6e", "size": "352...
from django.db import models class Event(models.Model): dt = models.DateTimeField() class MaybeEvent(models.Model): dt = models.DateTimeField(blank=True, null=True) class Timestamp(models.Model): created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True)
{ "content_hash": "d984b5c486c2de1246472baeb94db1ce", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 53, "avg_line_length": 28.272727272727273, "alnum_prop": 0.7459807073954984, "repo_name": "mixman/djangodev", "id": "9296edf92494d9f339cd01aa89298ffc88804a7c", "size": "311...
# Copyright Jacob Bennett 4/22/16 # v1.0 # Status: Stable import requests, lxml.html, json, re # Unique user-agent for crawling headers = {'user-agent': 'Simple Scraper'} class scrape_link: def __init__(self, url): # Request and Parse HTML of link try: t = req...
{ "content_hash": "579ba39c73e673ec73f48509b86ec3c2", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 133, "avg_line_length": 40.95192307692308, "alnum_prop": 0.48743836581357125, "repo_name": "jac0bbennett/simplescrape", "id": "5e31e4143c5666361ce87e65069856758cecf54d", "...
""" Test Templates """ from __future__ import absolute_import from __future__ import unicode_literals from __future__ import print_function import qisrc.templates def test_process_templates(tmpdir): """ Test Process Templates """ tmpl = tmpdir.mkdir("tmpl") tmpl_cmake_list = tmpl.ensure("CMakeLists.txt",...
{ "content_hash": "6512a544390cbca9e1a1d07b98e2cc8d", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 84, "avg_line_length": 28.676470588235293, "alnum_prop": 0.6338461538461538, "repo_name": "aldebaran/qibuild", "id": "ffaa89af7738905ddc955475098165446e57a18f", "size": "21...
""" WSGI config for friendlyphotos project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "friendlyphotos.settings") # Or...
{ "content_hash": "4e2fc78cf296db1dd8220997d9c51c3c", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 78, "avg_line_length": 27.53846153846154, "alnum_prop": 0.7122905027932961, "repo_name": "friendlydjango/friendly-photos", "id": "9e031dcbbf22c7769655418ce24c06296dc993e7", ...
import pytest from hypothesis import given, settings, HealthCheck from hypothesis import reproduce_failure # pylint: disable=unused-import from itertools import product import tempfile import subprocess # nosec from io import StringIO import pandas as pd import numpy as np from tests.helpers import assert_df_equa...
{ "content_hash": "a1a494691c95837a2a137912d99b3ebb", "timestamp": "", "source": "github", "line_count": 592, "max_line_length": 213, "avg_line_length": 32.125, "alnum_prop": 0.6499106110001052, "repo_name": "biocore-ntnu/pyranges", "id": "d82f41226f90c72429cb2ff7cec8bc89ab23bdca", "size": "19018", ...
""" theflasktest.config ~~~~~~~~~~~~ Implements the configuration related objects. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import imp import os import errno from werkzeug.utils import import_string from ._compat import string_types class ConfigA...
{ "content_hash": "d11cb95f219d8a9cc1b9889201618e1d", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 79, "avg_line_length": 37.26946107784431, "alnum_prop": 0.6222686375321337, "repo_name": "rosudrag/Freemium-winner", "id": "b9a30331fdb40cbe9b79a1e44d3b24aad1abbf62", "siz...
import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General conf...
{ "content_hash": "139748e53fb4f61c88ca596bdb165576", "timestamp": "", "source": "github", "line_count": 255, "max_line_length": 79, "avg_line_length": 31.352941176470587, "alnum_prop": 0.7036898061288305, "repo_name": "MartinThoma/pysec", "id": "dbae2b4add885f33a4f57b14b32828c375eadffc", "size": "8...
try: from StringIO import StringIO except ImportError: from io import StringIO import platform from mock import patch import numpy as np from numpy.testing import assert_allclose from nose.tools import raises from menpo.transform import PiecewiseAffine, ThinPlateSplines from menpo.feature import sparse_hog, ig...
{ "content_hash": "505b44aabb31c8b1706005e0150b0c24", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 79, "avg_line_length": 36.92462311557789, "alnum_prop": 0.6133641807294502, "repo_name": "mrgloom/menpofit", "id": "6bcaf3a2f1f908309f08d8cba56881826fbe0287", "size": "734...
from __future__ import absolute_import import math, logging, re, numpy as np from collections import OrderedDict from pbcore.io import FastaReader, FastaRecord class ReferenceContig(object): """ A contig from a reference (i.e. FASTA) file. """ def __init__(self, id, name, md5sum, sequence, length): ...
{ "content_hash": "fdb1dbc37ac6d97dd33ff537c907a3c8", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 83, "avg_line_length": 34.445205479452056, "alnum_prop": 0.6255716842314576, "repo_name": "afif-elghraoui/CorrelatedVariants", "id": "fdefad8eedd4792f788e6a5177c8e7423e9795d...
import datetime from mock import patch from django.contrib.auth.models import User from draalcore.test_utils.rest_api import AuthAPI from draalcore.test_utils.basetest import BaseTest from draalcore.auth.models import UserAccountProfile class UserRegistrationTestCase(BaseTest): ERROR_TEXT = 'Following data item...
{ "content_hash": "331df9196d7b2bf2cbef3a8ed9fa9079", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 101, "avg_line_length": 33.333333333333336, "alnum_prop": 0.6321311475409837, "repo_name": "jojanper/draalcore", "id": "caa7e7a85635f9c35e9b9a5cd4ac799828e08729", "size": ...
import functools import inspect import unittest from pecan import expose from pecan import util class TestArgSpec(unittest.TestCase): @property def controller(self): class RootController(object): @expose() def index(self, a, b, c=1, *args, **kwargs): return ...
{ "content_hash": "1c7b832296125a02fae84e9917bdb987", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 79, "avg_line_length": 31.144927536231883, "alnum_prop": 0.5516519311307585, "repo_name": "jdandrea/pecan", "id": "1e59ad0a30d316aea83711e8559e8d9ced91b406", "size": "4298...
""" The input generator =================== """ import argparse from .simultask import gen_simul_task_from_YAML from .gulpinter import COMPUTE_PARAM_FUNCS, GET_RES_FUNCS def gen_main(): """The main function for the input generator """ # Parse the command-line arguments parser = argparse.ArgumentP...
{ "content_hash": "116e62252cbebfa7faae252c0ba64e2e", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 68, "avg_line_length": 24.545454545454547, "alnum_prop": 0.6259259259259259, "repo_name": "tschijnmo/GCMCbyGULP", "id": "bbab0d91c228b23225906195d3254bbb3a04ce3b", "size": ...
from ._VerticalMeasurements import * from ._VelodynePacket import *
{ "content_hash": "82b463d45be51a4fbb5c0e1d66a66042", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 36, "avg_line_length": 34, "alnum_prop": 0.7941176470588235, "repo_name": "WuNL/mylaptop", "id": "d3cd52a953271b311bf5d7423530b0942e8bfebd", "size": "68", "binary": false,...
from types import CodeType from typing import Any, Optional import typing if typing.TYPE_CHECKING: from . import sketch # noqa: F401 from . import statements # noqa: F401 __all__ = ["PythonPrinter"] class PythonPrinter: """ Print Python code with indentation gracefully. """ def __init__( ...
{ "content_hash": "0ece787312cb542a662af24209069d9e", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 79, "avg_line_length": 26.752380952380953, "alnum_prop": 0.5567817728729085, "repo_name": "futursolo/sketchbook", "id": "cc16b4adfd46d0def47d48aef3b9c9b7a6ce39cb", "size":...
"""This module exports the Lintr plugin class.""" from SublimeLinter.lint import Linter, util class Lintr(Linter): """Provides an interface to lintr R package.""" defaults = { 'linters': 'default_linters', 'cache': 'TRUE', 'selector': 'source.r' } regex = ( r'^.+?:(?P...
{ "content_hash": "0e9430e41277bd842c129344e853038b", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 94, "avg_line_length": 29.24390243902439, "alnum_prop": 0.4645537948290242, "repo_name": "jimhester/SublimeLinter-contrib-lintr", "id": "441855ddb7dcfdcc2b88ca8565488f6fcfe40...
import gzip from deep_qa.models.memory_networks.differentiable_search import DifferentiableSearchMemoryNetwork from deep_qa.data.instances.true_false_instance import TrueFalseInstance from ...common.test_case import DeepQaTestCase class FakeEncoder: def predict(self, instances): predictions = [] f...
{ "content_hash": "57f198534af647027415f147b6547814", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 98, "avg_line_length": 42.34782608695652, "alnum_prop": 0.6339835728952772, "repo_name": "RTHMaK/RPGOne", "id": "90a30a775a7b272662fbc9555a75d1cf90880009", "size": "1978", ...
import copy import json import os import re import frappe from frappe import _, get_module_path from frappe.core.doctype.access_log.access_log import make_access_log from frappe.core.doctype.document_share_key.document_share_key import is_expired from frappe.utils import cint, sanitize_html, strip_html from frappe.uti...
{ "content_hash": "459ed55bea466a498d2f388e2532b091", "timestamp": "", "source": "github", "line_count": 641, "max_line_length": 99, "avg_line_length": 27.764430577223088, "alnum_prop": 0.695117154576614, "repo_name": "frappe/frappe", "id": "faf6a02067a6ae1c93cc6624adc0655d1af64192", "size": "17895"...
from gem5stats import log from gem5stats import logquery from gem5stats.util import BufferedISlice import sys import os import argparse def main(): parser = argparse.ArgumentParser(description='Plot a time series from a gem5 log.') parser.add_argument('log', metavar='LOG', type=argparse.FileType('r'), ...
{ "content_hash": "ef60cb90855a6ae63e693812dc5d0800", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 87, "avg_line_length": 32.78181818181818, "alnum_prop": 0.5490848585690515, "repo_name": "andysan/gem5utils", "id": "bd35fca7a49e984d2196cf5e06721c602fa7bb31", "size": "338...
u""" :Copyright: Copyright 2015 - 2022 Andr\xe9 Malo or his licensors, as applicable :License: Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0...
{ "content_hash": "ce007b0da541ad01036d9c6cbf5835df", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 73, "avg_line_length": 27.666666666666668, "alnum_prop": 0.7188755020080321, "repo_name": "ndparker/pyliblinear", "id": "730ebd74dbbfc8436e5ff7379147787f2bdaba7f", "size": ...
""" Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app """ import socket import os from .base import * # noqa # DEBUG # ------------------------------------------------------------------------------ DEBUG = env.bool('DJANGO_DEBUG', default...
{ "content_hash": "50d98eb1d6e8089de9426bfa58b21c12", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 99, "avg_line_length": 30.36986301369863, "alnum_prop": 0.48308525033829497, "repo_name": "tkovalsky/folio", "id": "1555fb30c142f34888806aff9017500f026fa032", "size": "2241...
''' Contains PidIo() class Typical contents of /proc/<pid>/io file:: rchar: 143848377 wchar: 4254218 syscr: 98216 syscw: 31339 read_bytes: 270336 write_bytes: 3489792 cancelled_write_bytes: 974848 ''' from logging import getLogger from os import path as ospath from re import compile as recompile...
{ "content_hash": "d579275b2adb2fc5f6e247bae58b60b1", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 74, "avg_line_length": 21.085106382978722, "alnum_prop": 0.5751765893037336, "repo_name": "eccles/lnxproc", "id": "556818908c084d7b116780502252359800750450", "size": "991",...
import sys import get_dictionary # tokens is a list of tokens, so no need to split it again def unkify(tokens, words_dict): final = [] for token in tokens: # only process the train singletons and unknown words if len(token.rstrip()) == 0: final.append('UNK') elif not(token.r...
{ "content_hash": "6aed76fe18fa1fe6570a3aeebc4789d5", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 137, "avg_line_length": 36.91836734693877, "alnum_prop": 0.4906025428413488, "repo_name": "clab/lstm-parser-with-beam-search", "id": "6581800143b77156737b1da9fc1304eca5d4d5e...
""" This module provides some helper functions to allow straightforward publishing of messages in a one-shot manner. In other words, they are useful for the situation where you have a single/multiple messages you want to publish to a broker, then disconnect and nothing else is required. """ import paho.mqtt.client as ...
{ "content_hash": "7d0a827d9c245c20276e0f88c3d7cd9e", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 79, "avg_line_length": 40.22167487684729, "alnum_prop": 0.6153092467850582, "repo_name": "wendal/yeelink_tester", "id": "029721b317ac8f58c3b15fbb9cdae327b9638242", "size":...
import os from pathlib import Path from setuptools import setup, find_packages, Command ROOTDIR = Path(__file__).parent __version__ = None # Overwritten by executing version.py. with open(ROOTDIR / "puncover/version.py") as f: exec(f.read()) with open(ROOTDIR / "requirements-test.txt") as f: tests_require...
{ "content_hash": "db9c163732e8ce5a4e2a2dab6c997766", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 96, "avg_line_length": 31.319444444444443, "alnum_prop": 0.6301552106430155, "repo_name": "HBehrens/puncover", "id": "d94c0f7831abb06e3c352e9ba6128818bced47cb", "size": "22...
from __future__ import print_function import copy import errno import gc import logging import os import pprint import socket import sys import traceback import eventlet.backdoor import greenlet from oslo_config import cfg from conveyor.common._i18n import _LI help_for_backdoor_port = ( "Acceptable values are 0...
{ "content_hash": "29bf56f877177aaf0c60a92bdaf70331", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 77, "avg_line_length": 30.659259259259258, "alnum_prop": 0.6272046388016429, "repo_name": "Hybrid-Cloud/conveyor", "id": "bba19da1336cd6bc7fbfba021c495a58e69be882", "size"...
""" Design and implement methods of an LRU cache. There are two methods defined as follows: get(x): Gets the value of the key x if the key exists in the cache, otherwise returns -1. set(x,y): Inserts the value if the key x is not already present. If the cache reaches its capacity, it should invalidate the least recentl...
{ "content_hash": "49e735b4179d8e87c0b9b4bb38d0a1e7", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 111, "avg_line_length": 30.198347107438018, "alnum_prop": 0.6023535851122058, "repo_name": "prathamtandon/g4gproblems", "id": "9c4d8f3394dcf16fba2997bccbac90432fdea71e", "...
from unittest import mock from django.test import TestCase from p3.models import TICKET_CONFERENCE_SHIRT_SIZES, TICKET_CONFERENCE_DIETS from p3.stats import shirt_sizes, diet_types from . import factories class StatsTestCase(TestCase): def setUp(self): self.conference = factories.ConferenceFactory() ...
{ "content_hash": "bf36176b5fb2450115375bb2f5d98076", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 105, "avg_line_length": 37.0990099009901, "alnum_prop": 0.6688017080330931, "repo_name": "EuroPython/epcon", "id": "b6b6efeeb8e8c09ea4a349165202c76ca76bc428", "size": "374...
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import unicode_literals import json import os try: import koji except ImportError: import inspect import sys ...
{ "content_hash": "645fdbcca4e29f762fb5372cbe29766c", "timestamp": "", "source": "github", "line_count": 991, "max_line_length": 93, "avg_line_length": 35.32088799192734, "alnum_prop": 0.5270119704025369, "repo_name": "jpopelka/atomic-reactor", "id": "817b93686992242eda6bc7b428c7a448329acaf7", "size...
import matplotlib.pyplot as plt import matplotlib.animation as animation import time import serial fig = plt.figure() ax1 = fig.add_subplot(1,1,1) def animate(i): pullData = '' with open('meusdados.txt', 'r+') as arq: with serial.Serial('/dev/ttyACM0',9600,timeout=1) as ser: arq.write(ser.readline()) pullDat...
{ "content_hash": "e3cfdc50e1f12f98c5401237d5d1c391", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 59, "avg_line_length": 22.37037037037037, "alnum_prop": 0.6788079470198676, "repo_name": "italogfernandes/minicurso-arduino-avancado", "id": "4f6255ec51a9f4220495c06f2639847b...
"""Classes used for tracking game state. The game state is defined as all the data which is being used by the game itself. This excludes things like the package listing, the logging class, and various other bits defined in the rpg.app.Game class. """ from enum import IntEnum, unique from rpg.data import actor, resour...
{ "content_hash": "cb1d18ef20fe893ad7baf0cb2200992c", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 79, "avg_line_length": 34.8150289017341, "alnum_prop": 0.617632409098456, "repo_name": "tvarney/txtrpg", "id": "3b5485e0c56bd06f750eae35dc06b1f5c24ba40f", "size": "6023", ...
""" Configuration reader and defaults. Author: Henrik Thostrup Jensen <[email protected]> Copyright: NORDUnet (2011) """ import os import configparser from opennsa import constants as cnt # defaults DEFAULT_CONFIG_FILE = '/etc/opennsa.conf' DEFAULT_LOG_FILE = '/var/log/opennsa.log' DEFAULT_TLS = 'true' DEFAULT_TOPOLOGY...
{ "content_hash": "a84c9f34ca15c447c59ed07574cd93dd", "timestamp": "", "source": "github", "line_count": 424, "max_line_length": 113, "avg_line_length": 32.615566037735846, "alnum_prop": 0.6223877359172753, "repo_name": "NORDUnet/opennsa", "id": "90ba7e5a9a8e11853b366b057d4855305e81adfc", "size": "1...
from ...utils import validate_type from ..base_1d import BaseEM1DSimulation from .receivers import PointMagneticFieldSecondary, PointMagneticField from .survey import Survey import numpy as np from geoana.kernels.tranverse_electric_reflections import rTE_forward, rTE_gradient ########################################...
{ "content_hash": "167d6249bdc2850d1e847f46b0c53809", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 88, "avg_line_length": 38.48979591836735, "alnum_prop": 0.46005655708731, "repo_name": "simpeg/simpeg", "id": "f4d22f0ad3df84b19f77446e67ae1cfd3eb3a0af", "size": "11316", ...
import json import nltk from urllib.request import urlopen import utils.prettylogger as pl from nltk.corpus import * def word_links(): # to_analyze = nltk.data.load(, format='auto', cache=true, # verbose=False, logic_parser=None, fstruct_reader=None, encoding=None) # Download dict.json word resource f...
{ "content_hash": "9b959c29c531d85d87c6edd406fdb3c1", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 86, "avg_line_length": 31.676470588235293, "alnum_prop": 0.6722376973073352, "repo_name": "EngLang/EL-Python", "id": "3907834ee7f698c2aa9d20229ee29f0113a57388", "size": "10...
import pytz import sqlalchemy from sqlalchemy import types from sqlalchemy.dialects import sqlite from backend.extensions import db # alias common names BigInteger = db.BigInteger().with_variant(sqlite.INTEGER(), 'sqlite') # type: sqlalchemy.types.BigInteger Boolean = db.Boolean # type: sqlalchemy.types...
{ "content_hash": "bbad89964e9efd4130cd31e49010eb8f", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 106, "avg_line_length": 38.78048780487805, "alnum_prop": 0.6490566037735849, "repo_name": "briancappello/flask-react-spa", "id": "6ec3d82371a67a3dfb198fa95bece443cef88f35", ...
from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse from azure.core.p...
{ "content_hash": "f0da5d340aa27bd60bb5a3ffec613eae", "timestamp": "", "source": "github", "line_count": 547, "max_line_length": 221, "avg_line_length": 42.42961608775137, "alnum_prop": 0.6468611314576242, "repo_name": "Azure/azure-sdk-for-python", "id": "08e1cc209a597b36f839592653f72bd08a1f0db5", "...