text
stringlengths
4
1.02M
meta
dict
from google.net.proto import ProtocolBuffer import array import dummy_thread as thread __pychecker__ = """maxreturns=0 maxbranches=0 no-callinit unusednames=printElemNumber,debug_strs no-special""" if hasattr(ProtocolBuffer, 'ExtendableProtocolMessage'): _extension_runtime = True _ExtendablePro...
{ "content_hash": "08f276f64f5d4f9e868f6c7d924ee582", "timestamp": "", "source": "github", "line_count": 7525, "max_line_length": 851, "avg_line_length": 29.643322259136212, "alnum_prop": 0.6357669927286095, "repo_name": "ProfessionalIT/maxigenios-website", "id": "a3750576a17fce01de62f7c7b67ba60bfc06e...
"""Remove an app_name(s) from installed apps.""" from magpy.management import BaseCommand, CommandError from magpy.server.database import Database class Command(BaseCommand): """Remove an app_name(s) from installed apps.""" help = ('Remove an app_name(s) from installed apps.') args = '[app_name ...]' ...
{ "content_hash": "e3b83d1490011b5e53172649860a844f", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 57, "avg_line_length": 32, "alnum_prop": 0.6540178571428571, "repo_name": "zeth/magpy", "id": "ab95053c8a324db838e6ea509a933b7917b1fcde", "size": "448", "binary": false, ...
import os import urllib import json import sys import ast import argparse import utils def settings(default_parser): parser = default_parser args = default_parser.parse_args() boost_version = args.track if args.track != "master" else "1.57.0" passwords = ast.literal_eval(args.passwords.replace('->',...
{ "content_hash": "e02e8f906a4da7839cd7260af95c334a", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 157, "avg_line_length": 49.152542372881356, "alnum_prop": 0.5779310344827586, "repo_name": "bowlofstew/boost", "id": "fe9deb935cb6f08956a1e490b8b849c8be587603", "size": "29...
import deep_architect.searchers.common as se import numpy as np # NOTE: this searcher does not do any budget adjustment and needs to be # combined with an evaluator that does. class SuccessiveNarrowing(se.Searcher): def __init__(self, search_space_fn, num_initial_samples, reduction_factor, reset...
{ "content_hash": "ffb420bc70a7e5c47bebed68e7cea8ea", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 78, "avg_line_length": 42, "alnum_prop": 0.6038961038961039, "repo_name": "negrinho/deep_architect", "id": "134a53471e6d7282b03c7bc82d81337f7df6746c", "size": "3234", "bi...
import six import inspect import redis import redis.sentinel import redis_sentinel_url from flask import current_app from werkzeug.local import Local, LocalProxy from werkzeug.utils import import_string _EXTENSION_KEY = 'redissentinel' class RedisSentinelInstance(object): def __init__(self, url, client_class, ...
{ "content_hash": "ddd8e5562d07f3ab4017e1fa66ec69f1", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 108, "avg_line_length": 37.626506024096386, "alnum_prop": 0.6402497598463016, "repo_name": "exponea/flask-redis-sentinel", "id": "d8d9f7eef4c87130f98bd995326b03ca6158d1d2", ...
"""Tests for the "update_gcp_log_flow_filter" module.""" import unittest from unittest import mock from google.auth.transport import requests from . import update_gcp_log_flow_filter SAMPLE_FILTER_ID = "00000000-0000-0000-0000-000000000000" DEFAULT_FILTER_EXPRESSION = ( "log_id(\"dns.googleapis.com/dns_queries...
{ "content_hash": "0fc3b3ba5bfd615d15dfa624c5cabcc9", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 73, "avg_line_length": 39.37837837837838, "alnum_prop": 0.7086479066575154, "repo_name": "chronicle/api-samples-python", "id": "f395af459ffa0e73a8277bde59cca82c3d7fff63", "...
import gym from gym import Wrapper from gym import error, version import os, json, logging, numpy as np, six from gym.monitoring import stats_recorder, video_recorder from gym.utils import atomic_write, closer from gym.utils.json_utils import json_encode_np logger = logging.getLogger(__name__) FILE_PREFIX = 'openaigy...
{ "content_hash": "82b5070a5d0f1d0246fc645dfc1a12d9", "timestamp": "", "source": "github", "line_count": 386, "max_line_length": 302, "avg_line_length": 39.432642487046635, "alnum_prop": 0.6341239077590172, "repo_name": "dianchen96/gym", "id": "ca62135fa10726fd2a326d40740e1b91401e9bff", "size": "152...
from flask_testing import TestCase import json from tests import app, config, db, User class TestRegLogin(TestCase): ''' ''' @staticmethod def init_db(): db.drop_all() db.create_all() def create_app(self): app.config.from_object('config.TestingConfig') return app ...
{ "content_hash": "dc950be9603814862a3f9e4ecdee7629", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 76, "avg_line_length": 34.89344262295082, "alnum_prop": 0.5968992248062015, "repo_name": "andela-oadeniran/bucket_list_api", "id": "01ee2572e697c3d0cd806db93292b9aa7f7101fd"...
class DgisError(Exception): """2Gis API error""" def __init__(self, code, message, error_code): self.code = code self.message = message self.error_code = error_code def __str__(self): return self.message
{ "content_hash": "98d95528b05d7ce962929f7a12f8f339", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 50, "avg_line_length": 25, "alnum_prop": 0.58, "repo_name": "svartalf/python-aio2gis", "id": "74b185a728f8173ef39e6c1a88a89778a0fca642", "size": "250", "binary": false, ...
import logging from abc import ABCMeta, abstractmethod import six from ryu.lib.packet import packet LOG = logging.getLogger(__name__) def packet_in_filter(cls, args=None): def _packet_in_filter(packet_in_handler): def __packet_in_filter(self, ev): pkt = packet.Packet(ev.msg.data) ...
{ "content_hash": "6b21ad3d61ecdd4946015085799ba5d5", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 75, "avg_line_length": 27.51219512195122, "alnum_prop": 0.6223404255319149, "repo_name": "yamada-h/ryu", "id": "a84f7bb48be4f3e9fced8fe3be730aeb694f0883", "size": "1759", ...
"""Automatically setup docs for a project Call from command line: bench frappe --setup_docs app docs_app path """ import os, json, frappe, markdown2, shutil class setup_docs(object): def __init__(self): """Generate source templates for models reference and module API and templates at `templates/autodoc` "...
{ "content_hash": "1d860b3e66844c1265d56d2366572998", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 92, "avg_line_length": 31.987951807228917, "alnum_prop": 0.6532956685499058, "repo_name": "ashokrajbathu/secondrep", "id": "a9e0f61b28d3e3b97b857c6f81ac0f529b9d003a", "siz...
import os, sys import argparse import types import glob import numpy as np import pickle import tensorflow as tf import data import model from util import * from learning import LearnerCls, LearnerDACls, LearnerClsSelf, LearnerConfPred from learning import TempScalingCls as CalibratorCls ##TODO: clean-up tf options...
{ "content_hash": "95c21fcc30ee04c74035384790e0a86f", "timestamp": "", "source": "github", "line_count": 474, "max_line_length": 188, "avg_line_length": 49.040084388185655, "alnum_prop": 0.6138524413852441, "repo_name": "googleinterns/intern2020_cocal", "id": "db7bd30ccce68349f1627862836f7a983f8b6992"...
import collections from supriya.tools import osctools from supriya.tools.requesttools.Request import Request class NodeAfterRequest(Request): ### CLASS VARIABLES ### __slots__ = ( '_node_id_pairs', ) ### INITIALIZER ### def __init__( self, node_id_pairs=None, ...
{ "content_hash": "ad289c4bd90dfa0716e1f9c499c6941b", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 71, "avg_line_length": 26.90909090909091, "alnum_prop": 0.597972972972973, "repo_name": "andrewyoung1991/supriya", "id": "1cede7b1949404ae8587adea6d642c8ab63aa6c6", "size":...
import ui from view_lock import * from view_messages import * from view_settings import * def make_button_item(action, image_name): return ui.ButtonItem(action=action, image=ui.Image.named(image_name)) class NavController(ui.View): def __init__(self): self.vc = {} # self.vc['lock'] = LockController() se...
{ "content_hash": "965765493215c81f4a0a511d0d2a28cf", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 106, "avg_line_length": 26.71875, "alnum_prop": 0.7005847953216374, "repo_name": "jadeblaquiere/controller-example", "id": "ecbbe4f4b98e2fe7b87f621acd7e495ffb062740", "size...
from __future__ import unicode_literals from django.db import migrations, models import datetime from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('blogapp', '0005_sponsors'), ] operations = [ migrations.AddField( model_name='spon...
{ "content_hash": "fc3ec66a6f88ff1d86a01b9dc06925ab", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 132, "avg_line_length": 25.761904761904763, "alnum_prop": 0.6303142329020333, "repo_name": "jgsjv/treinamento_django", "id": "dc6b76b69e10b9309747c90d11fe1de572e0583a", "si...
""" Data: Vincent Data Class for data importing and Vega Data type """ from __future__ import (print_function, division) import time import json from .core import ( _assert_is_type, ValidationError, grammar, GrammarClass, LoadError ) from ._compat import str_types try: import pandas as pd exc...
{ "content_hash": "9e7bba493ac3b58d53ef23c42611c4b2", "timestamp": "", "source": "github", "line_count": 478, "max_line_length": 79, "avg_line_length": 35.33472803347281, "alnum_prop": 0.5413854351687389, "repo_name": "myusuf3/vincent", "id": "cd8593950890f9688756611dd2fda3ddffaa3d31", "size": "1691...
from setuptools import setup, find_packages setup(name='hyde', version='0.4', description='static site generator', packages=find_packages(), install_requires=( 'django', 'pyYAML', 'markdown2', 'pygments', 'pyrss2gen', ), )
{ "content_hash": "c7d24bf3b2d99ca200412b6703eb0492", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 43, "avg_line_length": 21.714285714285715, "alnum_prop": 0.5328947368421053, "repo_name": "sjl/hyde", "id": "1e94f2249fac5ca13d4d481efc0127946c9c22f6", "size": "304", "bi...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('dictionary', '0015_auto_20171120_1211'), ] operations = [ migrations.CreateModel( name='AnnotationIdglo...
{ "content_hash": "59fa047ef8fa25d63e9f2c836eb867d6", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 225, "avg_line_length": 38.457142857142856, "alnum_prop": 0.6181277860326895, "repo_name": "Signbank/NGT-signbank", "id": "1cb3bfae94e2b1fee8c1dccc3a8762c7b832bac8", "size"...
from mako import runtime, filters, cache UNDEFINED = runtime.UNDEFINED __M_dict_builtin = dict __M_locals_builtin = locals _magic_number = 9 _modified_time = 1382819994.53595 _enable_loop = True _template_filename = u'/home/ali/BLOG/VENV/local/lib/python2.7/site-packages/nikola/data/themes/base/templates/base_helper.tm...
{ "content_hash": "7d520d6451fb0baa6194ecd712b86d29", "timestamp": "", "source": "github", "line_count": 272, "max_line_length": 259, "avg_line_length": 38.88970588235294, "alnum_prop": 0.4905464170920779, "repo_name": "apjd/wwwapjd", "id": "0599313cffbb1b35de5004a47331236d1c254b88", "size": "10603"...
""" Sleep sort is a proof of concept sorting algorithm that creates threads for each number in the sorting queue and sleeps for the amount of time before giving the result. It has no practical usage and doesn't works for negative numbers. Also for very close positive numbers, results are not guaranteed to be consisten...
{ "content_hash": "0ef6662d3326616878395daf35eebd27", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 75, "avg_line_length": 28.17241379310345, "alnum_prop": 0.6701346389228886, "repo_name": "Enether/algos", "id": "55c44e4d082abd9330fcb40f1effa0d21b504909", "size": "1634", ...
""" Defines how attr is organized and displayed. """ from collections import namedtuple from collections.abc import Iterable from itertools import groupby from typing import List from . import api # noqa: F401, '.api' imported but unused from .attr_category import AttrCategory from .configuration import attribute_col...
{ "content_hash": "50bf974183b64990527107e6c9fd0ae8", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 87, "avg_line_length": 36.55789473684211, "alnum_prop": 0.7002591419522027, "repo_name": "laike9m/pdir2", "id": "1ba574f7befdd6cb76899d4bf3ee437a76dbfd47", "size": "3473", ...
from datetime import timedelta import resource import time import urllib from django.core.exceptions import ObjectDoesNotExist from snh.models.youtubemodel import * from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned import snhlogger logger = snhlogger.init_logger(__name__, "youtube.log") ...
{ "content_hash": "0d8aec3f068fe1b8d1dc5226d142e3e6", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 158, "avg_line_length": 39.985, "alnum_prop": 0.6179817431536826, "repo_name": "pylanglois/Social-Network-Harvester", "id": "515fbac1c9421ae450872853790edcc0060756f8", "si...
from flask import Flask, request, g, render_template from flask.ext.triangle import Triangle from flask.ext.socketio import SocketIO, emit from scipy import sparse, io import numpy as np from matlab import engine import os, json, time from flask.ext.cors import CORS # Configuration app = Flask(__name__, static_path='...
{ "content_hash": "beb2b071bb10a01dc6d3a6eda6ef1099", "timestamp": "", "source": "github", "line_count": 279, "max_line_length": 118, "avg_line_length": 24.010752688172044, "alnum_prop": 0.6989102851171817, "repo_name": "intuinno/topiclens", "id": "e852ae9eebebddf6a211949d70f4259ba3bb3335", "size": ...
"""Copyright 2015 Roger R Labbe Jr. FilterPy library. http://github.com/rlabbe/filterpy Documentation at: https://filterpy.readthedocs.org Supporting book at: https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python This is licensed under an MIT license. See the readme.MD file for more information. """ from...
{ "content_hash": "01e2105e5c425959eb244258f7017b21", "timestamp": "", "source": "github", "line_count": 531, "max_line_length": 125, "avg_line_length": 30.6120527306968, "alnum_prop": 0.5768071362657644, "repo_name": "rlabbe/filterpy", "id": "37875ae177be18dac5baf565d9e36e4309b5d979", "size": "1634...
import contextlib import hashlib import os import time import mock from oslo_concurrency import lockutils from oslo_concurrency import processutils from oslo_config import cfg from oslo_log import formatters from oslo_log import log as logging from oslo_serialization import jsonutils from oslo_utils import importutils...
{ "content_hash": "2ead46d7799a4e1a95f87c2c562b84f3", "timestamp": "", "source": "github", "line_count": 994, "max_line_length": 79, "avg_line_length": 42.18913480885312, "alnum_prop": 0.5684853109500191, "repo_name": "dims/nova", "id": "62c193be5481ff8d218e2eb9373053e5e4c341be", "size": "42584", ...
from dogapi.stats.dog_stats_api import DogStatsApi
{ "content_hash": "ffcc575aa46c8b174b97f0cc180e0b98", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 50, "avg_line_length": 51, "alnum_prop": 0.8431372549019608, "repo_name": "DataDog/dogapi", "id": "e003eb3e87ffde9e6d913eeea78dfd138f488a81", "size": "51", "binary": false...
""" .. module:: Timeseries_field_corrections :platform: Unix :synopsis: A Plugin to apply a simple dark and flatfield correction to some raw timeseries data .. moduleauthor:: Mark Basham <scientificsoftware@diamond.ac.uk> """ from savu.data.structures import RawTimeseriesData, ProjectionData from savu.pl...
{ "content_hash": "107ac61da7fedba93bc694b917bd0db8", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 78, "avg_line_length": 29.597701149425287, "alnum_prop": 0.6139805825242718, "repo_name": "swtp1v07/Savu", "id": "938ac19eadee15dd2fd15058c03305826a2e3c4e", "size": "3165",...
from setuptools import find_packages, setup setup( name='blocks_extras', install_requires=['blocks'], packages=find_packages(), scripts=['bin/blocks-plot', 'bin/blocks-controller'], extras_require={'plot': ['bokeh']}, zip_safe=False )
{ "content_hash": "181596c23aea4b20a85abcc4dacb75ff", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 57, "avg_line_length": 26, "alnum_prop": 0.6615384615384615, "repo_name": "mila-udem/blocks-extras", "id": "918342300e1ec06de984ea080ca0e69ca776d5e6", "size": "260", "bin...
import os, sys, platform import requests, time, re, subprocess import json, xml.dom.minidom BASE_URL = 'https://login.weixin.qq.com' OS = platform.system() INTERACT_URL = None session = requests.Session() uuid = None baseRequest = {} def get_QRuuid(): url = '%s/jslogin'%BASE_URL params = { ...
{ "content_hash": "763102ffb5ee11f1e87f95e0e681b5bd", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 91, "avg_line_length": 35.93693693693694, "alnum_prop": 0.5695663073451993, "repo_name": "littlecodersh/EasierLife", "id": "af4c2b2a83026705267e9fd2eb08acf8856b8601", "siz...
from amqpstorm.management import ApiError from amqpstorm.management import ManagementApi from amqpstorm.tests import HTTP_URL from amqpstorm.tests import PASSWORD from amqpstorm.tests import USERNAME from amqpstorm.tests.utility import TestFunctionalFramework from amqpstorm.tests.utility import setup class ApiExchang...
{ "content_hash": "9a6b7484c901ea69dec1634d82d6e600", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 75, "avg_line_length": 37.22222222222222, "alnum_prop": 0.6042643923240938, "repo_name": "eandersson/amqp-storm", "id": "ad5a802709c31d712a9b0fa14eb6dd084cb9d14f", "size":...
"""sda.element .. codeauthor:: John Lane <jlane@fanthreesixty.com> """ from __future__ import unicode_literals import keyword from six import string_types from lxml.cssselect import CSSSelector, SelectorError from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.by import By...
{ "content_hash": "2cd425b70fb721ff6217fb4ae8dbc7c2", "timestamp": "", "source": "github", "line_count": 503, "max_line_length": 120, "avg_line_length": 28.904572564612327, "alnum_prop": 0.5983905358002614, "repo_name": "jlane9/selenium_data_attributes", "id": "c5f50a130a3a6a3fed6b8fa45fe2b15bc432ed5c...
import Gaffer def __scriptAdded( container, script ) : variables = script["variables"] if "projectName" not in variables : projectName = variables.addMember( "project:name", IECore.StringData( "default" ), "projectName" ) projectName["name"].setFlags( Gaffer.Plug.Flags.ReadOnly, True ) if "projectRootDirectory...
{ "content_hash": "01ec9549f0ddf91ac418c08a0a4f90a1", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 148, "avg_line_length": 50.53846153846154, "alnum_prop": 0.7503805175038052, "repo_name": "paulondc/gaffer", "id": "b4bb299fbb9bdb4ec3141ccc1d35a92847d81215", "size": "2474...
"""Multi-electrode arrays.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import os import os.path as op import itertools import numpy as np from ..utils._types import _as_array from ..util...
{ "content_hash": "8ef866b37753544b9a74386cfc9fcd3a", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 79, "avg_line_length": 30.850515463917525, "alnum_prop": 0.5279866332497911, "repo_name": "nsteinme/phy", "id": "714cf732275574446cfeb5bf2e3765e4ef643816", "size": "6010",...
try: import wpilib except ImportError: from pyfrc import wpilib import timed_shoot class HotShootAutonomous(timed_shoot.TimedShootAutonomous): ''' Based on the TimedShootAutonomous mode. Modified to allow shooting based on whether the hot goal is enabled or not. ''' ...
{ "content_hash": "b870212df0077d10dc5c8cffdd2fe9ce", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 96, "avg_line_length": 37.097345132743364, "alnum_prop": 0.5260019083969466, "repo_name": "frc1418/2014", "id": "ef812c9d84c6c4e0a7d979ac6196f2c4e22a5004", "size": "4192",...
import sys import serial as s import glob conn = s.Serial(glob.glob("/dev/tty.usbmodem*")[0]) while True: sys.stdout.write(conn.read())
{ "content_hash": "7876eb5396fe01a65787ef5933ee6e94", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 51, "avg_line_length": 17.75, "alnum_prop": 0.6971830985915493, "repo_name": "deets/raspberry-racer", "id": "8a25edf704dbc4b1a12b6b7c0528fa6c79b9ed59", "size": "142", "bin...
from django.contrib import admin from .models import Bird, State, Bird_type admin.site.register(Bird) admin.site.register(State) admin.site.register(Bird_type)
{ "content_hash": "fce227fd04f8806976262f3aa79777f0", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 42, "avg_line_length": 26.833333333333332, "alnum_prop": 0.8012422360248447, "repo_name": "annerainywoods/birding_ear", "id": "f73d6140a83b2ab3bd0dd3bf09db9ff4114e708a", "si...
from ecnet import Server from ecnet.utils.logging import logger def main(): logger.stream_level = 'debug' sv = Server(num_processes=4) sv.load_data('../kv_model_v1.0_full.csv') sv.limit_inputs(15, output_filename='../kv_model_v1.0.csv') if __name__ == '__main__': main()
{ "content_hash": "10c030d95a9d2a2cd90fa98115ecc226", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 63, "avg_line_length": 19.8, "alnum_prop": 0.6296296296296297, "repo_name": "TJKessler/ECNet", "id": "9af77def5aaaea787d91f6b6d1e9930de5c50336", "size": "297", "binary": ...
def need_to_debug(): # some code here from doit import tools tools.set_trace() # more code def task_X(): return {'actions':[(need_to_debug,)]}
{ "content_hash": "32a17943c34eb074643c150b20fe9af0", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 41, "avg_line_length": 20.5, "alnum_prop": 0.5975609756097561, "repo_name": "okin/doit", "id": "bc5237d3fa81797c1ded76e5425b1346bad70527", "size": "165", "binary": false, ...
"""Fichier contenant la fonction configuration.""" from fractions import Fraction from primaires.scripting.fonction import Fonction from primaires.scripting.instruction import ErreurExecution # Fonction de conversion def convertir_liste(liste): """Convertit la liste passée en argument, récursivement.""" for ...
{ "content_hash": "8a25505a5facc2c21fe092bccb619d3e", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 76, "avg_line_length": 37.99598393574297, "alnum_prop": 0.6468660818095339, "repo_name": "stormi/tsunami", "id": "63f6268ddcf54cdfc22bb75e02f8845ecd2127ab", "size": "11188...
from __future__ import print_function import hotshot import hotshot.stats import unittest import os import tempfile from tables import * verbose = 0 class WideTreeTestCase(unittest.TestCase): """Checks for maximum number of childs for a Group.""" def test00_Leafs(self): """Checking creation of lar...
{ "content_hash": "a89a0092c4aa08692e531f1f722882ae", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 76, "avg_line_length": 32.724409448818896, "alnum_prop": 0.5459576515880654, "repo_name": "joonro/PyTables", "id": "c5f6651b1c84d28c4aa6ad3f9c671e3c2c7d2f8d", "size": "415...
import _plotly_utils.basevalidators class SizeValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="size", parent_name="table.cells.font", **kwargs): super(SizeValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "b0e73b46943306ac29c2ef23969b5ef9", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 85, "avg_line_length": 37.38461538461539, "alnum_prop": 0.5925925925925926, "repo_name": "plotly/plotly.py", "id": "2a30886b391f6c1b3702a5f4b260c79cb9b383db", "size": "486"...
from django.views.generic import TemplateView #from apiclient.discovery import build from googleapiclient.discovery import build from .utils import SearchResults from . import * class SearchView(TemplateView): template_name = "googlesearch/search_results.html" def get_context_data(self, **kwargs): c...
{ "content_hash": "02a5afc152b3fd32a66198593869e51b", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 104, "avg_line_length": 31.920454545454547, "alnum_prop": 0.551441794232823, "repo_name": "hzdg/django-google-search", "id": "c987f60790823115ceed6a494abece037e26fee0", "si...
""" Global Sea Ice Extent Graph for 1979-Current Website : https://github.com/emmatoday/PyClimateGraphs Author : Emma M - GitHub: @emmatoday Date : 15 February 2017 This code will download and render a current graph of the global sea ice extent. Beginning in 1979 until yesterday (based on availability of th...
{ "content_hash": "712036302677063026a47b871d77101d", "timestamp": "", "source": "github", "line_count": 571, "max_line_length": 97, "avg_line_length": 34.57092819614711, "alnum_prop": 0.5744174265450861, "repo_name": "emmatoday/PyClimateGraphs", "id": "df7e548fad5fe977cd80212b7fa34ba004568ea1", "si...
from __future__ import absolute_import from django.test.client import RequestFactory from sentry.testutils.helpers.datetime import iso_format, before_now from tests.apidocs.util import APIDocsTestCase class ProjectGroupEventBase(APIDocsTestCase): def setUp(self): first_release = { "firstEven...
{ "content_hash": "e2d2b37c771fd291bbecb0aa7985d6c4", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 91, "avg_line_length": 32.2, "alnum_prop": 0.6583850931677019, "repo_name": "beeftornado/sentry", "id": "42fad78018cf7f51ee2557737ed20343a0d6f891", "size": "2118", "binar...
import pytest @pytest.mark.online class TestRadarrListActions: config = """ templates: global: disable: [seen] tasks: clear_and_add_to_radarr_list: list_clear: what: - radarr_list: base_url: http://127.0....
{ "content_hash": "09175d45b4d6c0fdd391f832c987106f", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 113, "avg_line_length": 44.41732283464567, "alnum_prop": 0.5708207764580748, "repo_name": "ianstalk/Flexget", "id": "4a2ace0890887f711df843afbad5070ef23a0389", "size": "56...
"""Chex variants utilities.""" import enum import functools import inspect import itertools from typing import Any, Sequence import unittest from absl import flags from absl.testing import parameterized from chex._src import fake from chex._src import pytypes import jax from jax import tree_util import jax.numpy as j...
{ "content_hash": "d4b9aa6288ec3af62cd17a8cb3016a89", "timestamp": "", "source": "github", "line_count": 596, "max_line_length": 80, "avg_line_length": 33.14093959731544, "alnum_prop": 0.6479343863912516, "repo_name": "deepmind/chex", "id": "f067ebbb3504589a8743157ba88393f2ff52de76", "size": "20448"...
c.NotebookApp.ip = '0.0.0.0' ## Supply extra arguments that will be passed to Jinja environment. #c.NotebookApp.jinja_environment_options = {} ## Extra variables to supply to jinja templates when rendering. #c.NotebookApp.jinja_template_vars = {} ## The kernel manager class to use. #c.NotebookApp.kernel_manager_clas...
{ "content_hash": "f4afb663cd11451a410c7f921e3ee878", "timestamp": "", "source": "github", "line_count": 491, "max_line_length": 103, "avg_line_length": 37.686354378818734, "alnum_prop": 0.6754215304798963, "repo_name": "agaveapi/SC17-container-tutorial", "id": "158467a8aae395339c76326c9fd18efff66a46a...
import sys import os path = os.path.dirname(sys.modules[__name__].__file__) path = os.path.join(path, '..') sys.path.insert(0, path) import artview def main(argv): script, DirIn, filename, field = artview.parser.parse(argv) if script: artview.scripts.scripts[script](DirIn, filename, field) else...
{ "content_hash": "b6579cd5b687e60cb5fe2c2a30a89a68", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 63, "avg_line_length": 20.65, "alnum_prop": 0.639225181598063, "repo_name": "jjhelmus/artview", "id": "ba5523b60e8767eea1e8a3697d330b8bed5a5148", "size": "463", "binary":...
import simplegui # Import module, which contains functions that involve # randomness. import random #--------------------------------------------------------- # Define and initialize global constants. # Initialize global constants that will hold the "width" # and "height" of the "canvas" ("Pong" table). WIDTH = 600 ...
{ "content_hash": "840aa55de15d9a7e24cc62019260012c", "timestamp": "", "source": "github", "line_count": 492, "max_line_length": 115, "avg_line_length": 38.0609756097561, "alnum_prop": 0.5908896721136387, "repo_name": "aristotelis-metsinis/ArcadeGames", "id": "58c0b200c04ee94f844e9238ffab08f7bef4b94e"...
from django.conf.urls import patterns, url urlpatterns = patterns( 'users.views', url(r'^(?P<username>.+?)/$', 'user_profile', name="user-profile"), )
{ "content_hash": "22ab0661a39d6f54ab463434edce08d8", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 42, "avg_line_length": 19.666666666666668, "alnum_prop": 0.5819209039548022, "repo_name": "lemonad/behorighet", "id": "18643510f4649ab3ed33f890562fc32c62557e16", "size": "20...
from bs4 import BeautifulSoup #import requests import sys import urllib2 from HTMLParser import HTMLParser DOCS_ROOT = 'http://www.kbase.us/services/docs/' DEPLOY_DICT = [ {'name': 'CDM API', 'service': 'cdmi_api', 'target_dir':'kb_seed', 'html_name': '...
{ "content_hash": "1cde71bf2c3102723a9ea499865e2543", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 84, "avg_line_length": 30.643835616438356, "alnum_prop": 0.4714647593503204, "repo_name": "kbase/docs", "id": "5339b315b56f2611fb6af0729d1a3618b75b6abc", "size": "6730", ...
""" Methods for running a chain of plugins .. module:: process :platform: Unix :synopsis: Methods for running a chain of plugins .. moduleauthor:: Mark Basham <scientificsoftware@diamond.ac.uk> """ import os import logging import time from mpi4py import MPI import savu.plugins.utils as pu from savu.core.uti...
{ "content_hash": "d776d2b78b06dd69bb7f485e8a2e8b93", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 79, "avg_line_length": 33.79220779220779, "alnum_prop": 0.5920445810914681, "repo_name": "swtp1v07/Savu", "id": "9ee5e34b44ddce8ec7963d90c67baf0adb0f8776", "size": "5794",...
"""Script for generating test bundles""" import argparse import subprocess import sys from typing import Dict, Optional from pw_software_update import dev_sign, keys, metadata, root_metadata from pw_software_update.update_bundle_pb2 import Manifest, UpdateBundle from pw_software_update.tuf_pb2 import (RootMetadata, S...
{ "content_hash": "f6bd6cb8aca335687adabed92fcc262b", "timestamp": "", "source": "github", "line_count": 432, "max_line_length": 80, "avg_line_length": 43.354166666666664, "alnum_prop": 0.6556676811362059, "repo_name": "google/pigweed", "id": "1e5e0f7e93b2953421325adfa66c45244ed2c2aa", "size": "1931...
from __future__ import unicode_literals from django.db import models, migrations import shortuuidfield.fields from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('accounts', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ...
{ "content_hash": "fe123ddc08970b6a379c925bdac2981d", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 119, "avg_line_length": 38.08571428571429, "alnum_prop": 0.5753938484621155, "repo_name": "tabdon/crmeasyapp", "id": "112d2b4e454a5068cc7a29888b196a906e2b51de", "size": "13...
""" This module is to define how TimeStamp model is represented in the Admin site It also registers the model to be shown in the admin site .. seealso:: :class:`..models.TimeStamp` """ from django.contrib import admin from .models import TimeStamp class FilterUserAdmin(admin.ModelAdmin): """ Makes the ...
{ "content_hash": "d4b118410817d9a05fb28f97c94a320a", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 125, "avg_line_length": 32.86363636363637, "alnum_prop": 0.6454587367450438, "repo_name": "zandegran/django-timeStamp", "id": "a39d78970a2b5428929cac47bbcd677dcd4fd411", "s...
import numpy as np import theano import theano.tensor as T class OutputLayer: def __init__(self, n_in, n_out, activation, name): self.n_in=n_in self.n_out=n_out W_init= np.asarray(np.random.uniform(size=(n_in, n_out), low=-.01, h...
{ "content_hash": "820054476613e59b27787ebf0ae3a768", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 105, "avg_line_length": 35.484848484848484, "alnum_prop": 0.5138058639339596, "repo_name": "anoopkunchukuttan/theano-rnn", "id": "d5444401caf07126bc0693bdd8608d378ebacc41", ...
import os,sys PROJECT_DIR = os.path.dirname(__file__) sys.path.append(os.path.split(os.path.split(PROJECT_DIR)[0])[0]) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', #...
{ "content_hash": "afd5b58cb7265e5ef916a7c2ea486889", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 122, "avg_line_length": 34.19867549668874, "alnum_prop": 0.6841595662277304, "repo_name": "glenrobertson/django-dynamo", "id": "528e2eab0248fb02bc68df80e73097c4a304aba1", ...
from google.cloud import retail_v2alpha def sample_tune_model(): # Create a client client = retail_v2alpha.ModelServiceClient() # Initialize request argument(s) request = retail_v2alpha.TuneModelRequest( name="name_value", ) # Make the request operation = client.tune_model(reques...
{ "content_hash": "c6f6e33d019e944f35a605a88b4ed265", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 60, "avg_line_length": 22.869565217391305, "alnum_prop": 0.6958174904942965, "repo_name": "googleapis/python-retail", "id": "7d47091931980b227a531e043e35a16230530ab9", "siz...
""" Python utility to build opt and counters benchmarks """ import bm_constants import argparse import subprocess import multiprocessing import os import shutil def _args(): argp = argparse.ArgumentParser(description='Builds microbenchmarks') argp.add_argument( '-b', '--benchmarks', ...
{ "content_hash": "cd367091b6a4b26e068cb0e266d7c5a4", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 97, "avg_line_length": 30.78125, "alnum_prop": 0.6203045685279188, "repo_name": "deepaklukose/grpc", "id": "a4cd61707d3876257ed724c4781cda672d45cc3e", "size": "2574", "bi...
import unittest import MyPack.wrap as wrap class TestDict(unittest.TestCase): def test_return(self): import numpy as np a = np.arange(10, dtype=np.float32) b = a.copy()*-1 self.assertEqual(45, wrap.test(a)) for i,j in zip(a,b): self.assertEqual(i, j) if __name...
{ "content_hash": "0a28400b84c5019886b2fc3ab422fd40", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 43, "avg_line_length": 20, "alnum_prop": 0.5722222222222222, "repo_name": "POFK/utilTool", "id": "40c5db8df2bde14dbb5144c316a3cddf24e6f0b5", "size": "397", "binary": fals...
from django.utils.module_loading import autodiscover_modules from . import base def autodiscover(): autodiscover_modules('social', register_to=base) default_app_config = 'socializr.apps.SocializrConfig'
{ "content_hash": "bb9594931df79f6c89459208f1515710", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 60, "avg_line_length": 21.2, "alnum_prop": 0.7783018867924528, "repo_name": "albertoconnor/django-socializr", "id": "69593e763a8806ab9a30e6c850a60027e51245cb", "size": "213...
from kubeflow.fairing.preprocessors.base import BasePreProcessor def test_checking_reqs_file_found_use_case_with_input_files(): input_files = ["foo", "bar", "/foo/bar", "requirements.txt"] preprocessor = BasePreProcessor(input_files=input_files) assert preprocessor.is_requirements_txt_file_present() def...
{ "content_hash": "fe611c731190aa1171b3da9b799ae1e9", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 69, "avg_line_length": 36.96774193548387, "alnum_prop": 0.6980802792321117, "repo_name": "kubeflow/fairing", "id": "12b82f91d0ff375ccee98c4cdb0012b8b537c53a", "size": "1146...
"""The tests for the Google Wifi platform.""" import unittest from unittest.mock import patch, Mock from datetime import datetime, timedelta import requests_mock from homeassistant import core as ha from homeassistant.setup import setup_component import homeassistant.components.google_wifi.sensor as google_wifi from ...
{ "content_hash": "793de3b9c3fe19e21134796122e77b21", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 78, "avg_line_length": 39.425339366515836, "alnum_prop": 0.5478021347411913, "repo_name": "jnewland/home-assistant", "id": "ee0cf3b0658653e5445a89239205627d7fcd2dfc", "siz...
import tkinter as tk import constants import circle import utils class simulationGUI(tk.Frame): def __init__(self, parent, beObj): const = constants.simulationWindow self.beObj = beObj self.canvas = tk.Canvas(parent, bg=const.background, width=const.width, ...
{ "content_hash": "58fa21420cac78a55c0f43417f52c65c", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 71, "avg_line_length": 33.17391304347826, "alnum_prop": 0.5504587155963303, "repo_name": "dekespo/EVSTimulator", "id": "5ab0f7062b160c65c896f7d3ae0744dce2bba592", "size": "...
import re import mock from oslo_utils import units from oslo_vmware import exceptions as vexc from oslo_vmware.objects import datastore as ds_obj from nova import exception from nova import test from nova.tests.unit.virt.vmwareapi import fake from nova.virt.vmwareapi import ds_util class DsUtilTestCase(test.NoDBTes...
{ "content_hash": "62299929583a098c86ad56537d02049c", "timestamp": "", "source": "github", "line_count": 471, "max_line_length": 79, "avg_line_length": 45.34819532908705, "alnum_prop": 0.5480593660751908, "repo_name": "rahulunair/nova", "id": "ce10dc430fbf689a5c501c132ae2eca4fce0e26c", "size": "2196...
from __future__ import unicode_literals from django import forms from django.contrib.sites.models import Site from django.core.exceptions import PermissionDenied from django.utils.encoding import smart_text from django.utils.translation import ( ugettext, ugettext_lazy as _, get_language, ) from cms.api i...
{ "content_hash": "e598eea20447c19fe0e073449083ccfd", "timestamp": "", "source": "github", "line_count": 300, "max_line_length": 80, "avg_line_length": 36.71666666666667, "alnum_prop": 0.5893781207444394, "repo_name": "keimlink/django-cms", "id": "61f80fe1722faefef678edd9ae641bb222a5e7a4", "size": "...
"""## Activation Functions The activation ops provide different types of nonlinearities for use in neural networks. These include smooth nonlinearities (`sigmoid`, `tanh`, and `softplus`), continuous but not everywhere differentiable functions (`relu`, `relu6`, and `relu_x`), and random regularization (`dropout`). A...
{ "content_hash": "7fb78ca090aaf653045ea4a558cf4012", "timestamp": "", "source": "github", "line_count": 867, "max_line_length": 80, "avg_line_length": 42.509803921568626, "alnum_prop": 0.6731875406989364, "repo_name": "MehdiSfr/tensor-flow", "id": "17160f909e0ec12f303ef92647e4a92231fa5785", "size":...
""" Kubeflow Pipelines API This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition. Contact: kubeflow-pipelines@google.com Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from kfp_serv...
{ "content_hash": "5963476d12c26de55acf5ae1c435bc79", "timestamp": "", "source": "github", "line_count": 256, "max_line_length": 169, "avg_line_length": 30.69921875, "alnum_prop": 0.5976587352080417, "repo_name": "kubeflow/pipelines", "id": "3c6369981e9e9d212e6f9ca840b8db78ff4ac90a", "size": "7876",...
""" Support for Wink sensors. """ import logging # pylint: disable=no-name-in-module, import-error import homeassistant.external.wink.pywink as pywink from homeassistant.helpers.entity import Entity from homeassistant.const import CONF_ACCESS_TOKEN, STATE_OPEN, STATE_CLOSED def setup_platform(hass, config, add_devi...
{ "content_hash": "923a13b80722c1cd6b12da45d14b63a3", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 76, "avg_line_length": 28.327272727272728, "alnum_prop": 0.6225930680359435, "repo_name": "sanmiguel/home-assistant", "id": "ff61f02d041251026da0dd963ac1f073ddffedad", "siz...
"""Registry for tensor conversion functions.""" # pylint: disable=g-bad-name import collections import threading import numpy as np import six from tensorflow.python.util import lazy_loader from tensorflow.python.util.tf_export import tf_export # Loaded lazily due to a circular dependency # ops->tensor_conversion_re...
{ "content_hash": "430353038af04f2531e2c3746fddbad2", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 80, "avg_line_length": 36.806451612903224, "alnum_prop": 0.6998247151621385, "repo_name": "Intel-Corporation/tensorflow", "id": "6f4ec5ff05bde364a8dffda2684443518c1f271f", ...
from django.contrib.auth.models import User def is_empresa(self): return (self.empresa.CUIT is not None) and (self.empresa.CUIT is not "") def is_desocupado(self): return (self.desocupado.DNI is not None) and (self.desocupado.DNI is not "") def profile(self): return self.empresa if self.is_empresa() els...
{ "content_hash": "66f2a03dd99a0bf213f4287936a1f7cc", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 80, "avg_line_length": 30.17391304347826, "alnum_prop": 0.6988472622478387, "repo_name": "agustinhansen/SIDECO", "id": "9d8414a63a3c94e75e3caa34e7430c68563b676c", "size": "...
# -*- coding: utf-8 -*- # # 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 # # Unless required by applicable law or agreed to in writing, software ...
{ "content_hash": "b7ed0f4a45c5a8aaed589e3830c4ded2", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 223, "avg_line_length": 29.309278350515463, "alnum_prop": 0.6843123461132606, "repo_name": "saguziel/incubator-airflow", "id": "fce017515f8ffc7762dffe5ab8988078529e359c", ...
import numpy as np from numpy.testing import assert_allclose import pytest import scipy.sparse as sp from sklearn.datasets import make_regression from sklearn.utils._testing import assert_array_almost_equal from sklearn.utils._testing import assert_almost_equal from sklearn.utils._testing import create_memmap_backed_d...
{ "content_hash": "eea847fb86c479fd30c305460a988691", "timestamp": "", "source": "github", "line_count": 370, "max_line_length": 88, "avg_line_length": 32.413513513513514, "alnum_prop": 0.6285333110981406, "repo_name": "betatim/scikit-learn", "id": "7434729819716d022f3e6ddc246f27bbb2391bf0", "size":...
""" Decorator and utilities for the integration with TOPI and NNVM """ import warnings import logging from ... import tensor, placeholder, create_schedule, target as _target from ..util import get_const_tuple from .task import create, register logger = logging.getLogger('autotvm') def serialize_args(args): ""...
{ "content_hash": "4c635befce21cf789bf7049d7114ab14", "timestamp": "", "source": "github", "line_count": 320, "max_line_length": 91, "avg_line_length": 33.734375, "alnum_prop": 0.5910143584993053, "repo_name": "mlperf/training_results_v0.6", "id": "80b62229a34ed6d502c9a993a38dc54da87ab6a3", "size": ...
from .rarity import RarityStrategy
{ "content_hash": "189aee03465ccd64822e450dcb1b93bb", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 34, "avg_line_length": 35, "alnum_prop": 0.8571428571428571, "repo_name": "vtemian/university_projects", "id": "6b561204ab5a2d3b7a745c234f7a6e761f145631", "size": "35", "b...
from __future__ import unicode_literals import re from setuptools import find_packages, setup def get_version(filename): with open(filename) as fh: metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", fh.read())) return metadata['version'] setup( name='Mopidy-Raspberry-Jam', version=...
{ "content_hash": "1ee37752cf41a8cb0e38bb598b028f21", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 101, "avg_line_length": 31, "alnum_prop": 0.6129032258064516, "repo_name": "VeryBigCorp/mopidy-raspberryjam", "id": "329e27f39e9df48831b1dc34e38cbc1f43f188ce", "size": "136...
import os import pytest from spotify.auth import OAuth from spotify.client import Client CLIENT_ID = os.environ['SPOTAPI_CLIENT_ID'] CLIENT_SECRET = os.environ['SPOTAPI_CLIENT_SECRET'] REFRESH_TOKEN = os.environ['SPOTAPI_REFRESH_TOKEN'] FRANK_ZAPPA = '6ra4GIOgCZQZMOaUECftGN' @pytest.fixture def spotify_auth(): ...
{ "content_hash": "b8f635f3adc06843c68268ea8a7c255e", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 54, "avg_line_length": 22.91176470588235, "alnum_prop": 0.7163029525032092, "repo_name": "steinitzu/spotify-api", "id": "1ca7ac626e0e49ef3ebe3ba7966ba8033c7ad33c", "size": ...
__all__ = ['DeltaSigma'] class DeltaSigma: ''' Returns an instance of the DeltaSigma class. ''' _address = 0x68 # default address for adc1 on the delta-sigma pi _address2 = 0x69 # default address for adc2 on the delta-sigma pi _config1 = 0x1C # 28 or 11100 _currentchannel1 = 1 # channel variable for adc1 ...
{ "content_hash": "4e962d49b036e8461401d8a6f76f7fb0", "timestamp": "", "source": "github", "line_count": 259, "max_line_length": 81, "avg_line_length": 31.772200772200772, "alnum_prop": 0.6306963179001094, "repo_name": "dhhagan/ADCPi", "id": "e03e7da184f4819112a4136173a04face56e1bcc", "size": "8229"...
from unittest import runner import sys, time, os, sublime class DeferringTextTestRunner(runner.TextTestRunner): r'''deferred test runner. This test runner runs tests in deferred slices. It gives back control to sublime text, such that it can draw views, do syntax highlighting and whatever. ''' ...
{ "content_hash": "3612adc5322c4da43b9a0ba935f30d57", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 124, "avg_line_length": 34.794117647058826, "alnum_prop": 0.5190194420963652, "repo_name": "randy3k/SublimePluginUnitTestHarness", "id": "65d4e2624647d3b52be291700f1007cbd82...
"""Implementation of odin_data Meta Writer This module is passed meta data messages for a single acquisition which it writes to disk. Will need to be subclassed by detector specific implementation. Matt Taylor, Diamond Light Source """ import os from time import time import logging import h5py from odin_data import...
{ "content_hash": "eaa0eeed92100b022c03ee4ceacb1d01", "timestamp": "", "source": "github", "line_count": 556, "max_line_length": 93, "avg_line_length": 33.32374100719424, "alnum_prop": 0.594559585492228, "repo_name": "percival-detector/odin-data", "id": "2374f07f4d690373a49ecb82c2f0cc18aaeac184", "s...
from django import forms from localflavor.gb.forms import GBPostcodeField from core.helpers import geocode from .models import Leaflet, LeafletImage import constants class ImageForm(forms.Form): image = forms.ImageField(widget=forms.FileInput( attrs={'accept': "image/*;capture=camera"}), error_messages=...
{ "content_hash": "45c5a5fa4ffcfdf8a685468b4a5b3743", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 121, "avg_line_length": 30.321428571428573, "alnum_prop": 0.6368276403612093, "repo_name": "JustinWingChungHui/electionleaflets", "id": "97007e015e0284ab89f84aec8d0834205f5c7...
from __future__ import annotations import sys from copy import deepcopy from datetime import datetime from pathlib import Path from unittest import mock from urllib.parse import ParseResult, urlsplit import pytest import yaml from _pytest._code import ExceptionInfo from botocore.exceptions import ClientError from fre...
{ "content_hash": "478935aa2f0f9cc429564f4c0ea73cc8", "timestamp": "", "source": "github", "line_count": 1336, "max_line_length": 110, "avg_line_length": 42.92814371257485, "alnum_prop": 0.6420351513460734, "repo_name": "apache/airflow", "id": "3d3e51f94acf7a42a50f15741deadcc985f0b246", "size": "581...
""" Test the save_trajs function of the coordinates API by comparing the direct, sequential retrieval of frames via mdtraj.load_frame() vs the retrival via save_trajs @author: gph82, clonker """ import unittest import numpy as np import pyemma.coordinates as coor class TestClusterSamples(unittest.TestCase): @cla...
{ "content_hash": "644cdb9ef3ef6c7922d6a254d43aa3f7", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 104, "avg_line_length": 34.425925925925924, "alnum_prop": 0.5422270037654653, "repo_name": "arokem/PyEMMA", "id": "f224ea844bb23cfab3637c45537df49cf44e8b9a", "size": "3273"...
from __future__ import unicode_literals import datetime from django.db import models from healthcare.api import client from healthcare.exceptions import PatientDoesNotExist, ProviderDoesNotExist class Report(models.Model): """An abstract model describing the structure of a 1000 days report.""" # Meta data. ...
{ "content_hash": "67d36b629c4482f07c82930b9cc105e2", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 87, "avg_line_length": 36.63636363636363, "alnum_prop": 0.6440978376462247, "repo_name": "caktus/rapidsms-reports", "id": "95557b9fe2868024e4d0bcd72aa48ccd86d151c0", "size"...
"""Install Debian sysroots for building chromium. """ # The sysroot is needed to ensure that binaries that get built will run on # the oldest stable version of Debian that we currently support. # This script can be run manually but is more often run as part of gclient # hooks. When run from hooks this script is a no-o...
{ "content_hash": "3967d06d9dea8b8a2d92063e6442f3db", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 80, "avg_line_length": 30.7875, "alnum_prop": 0.669305724725944, "repo_name": "flutter/buildroot", "id": "d3e76649e6524dcb9f98b480f08f56d747aba865", "size": "5118", "bin...
from django.db import models from django.utils.translation import ugettext_lazy as _ from cms.models import CMSPlugin, Page from cms.models.fields import PageField class Link(CMSPlugin): """ A link to an other page or to an external website """ name = models.CharField(_("name"), max_length=256) ur...
{ "content_hash": "66e329247e517a23ed511baf4fac06c6", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 178, "avg_line_length": 38.92307692307692, "alnum_prop": 0.5904150197628458, "repo_name": "kohout/djangocms-link", "id": "696f27d275a5957008f0e105c768ff96d6b14151", "size":...
"""Gym utilities.""" from typing import Any from acme import wrappers import gym from rlds_creator import environment from rlds_creator import gym_renderer class InfoWrapper(gym.Wrapper): """Wrapper that provides access to the information of the last step.""" def __init__(self, env): super().__init__(env) ...
{ "content_hash": "835de71f1bd81c1c501274d776711a1e", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 73, "avg_line_length": 26.25, "alnum_prop": 0.6817460317460318, "repo_name": "google-research/rlds-creator", "id": "0e6bfe7dfa48b4e75f8d087318eab560119e8417", "size": "1860...
import sys, os sys.path.append('../') # 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.append(os.path.abspath('.')) # --...
{ "content_hash": "4b7e1f4bac362fcda328d009e375b0e2", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 80, "avg_line_length": 32.94475138121547, "alnum_prop": 0.7105483816870702, "repo_name": "hamish2014/batchOpenMPI", "id": "2b3fe3d307f41ca88fe08f398abea232412d3677", "size...
from .board import GreatFETBoard # Ensure that we have access to all GreatFET boards. Normally, we'd avoid # importing an entire namespace, but in this case, this allows us to ensure # that all board modules are loaded for autoidentification. from .boards import * active_connections = {} def GreatFET(**board_identi...
{ "content_hash": "73bdb9726f3e87d461115f896b6eb7ae", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 121, "avg_line_length": 36.659574468085104, "alnum_prop": 0.693557748113755, "repo_name": "greatscottgadgets/greatfet", "id": "5b90fcb4712de7ec4877f5a2f257dd0ae8461b46", "s...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.RunSQL("""DROP TABLE IF EXISTS variant CASCADE; DROP FUNCTION IF EXISTS variant_fts_trigger(); ...
{ "content_hash": "7eddcd3370ccd614e407f36bd5fdef0e", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 114, "avg_line_length": 54.679611650485434, "alnum_prop": 0.5550426136363636, "repo_name": "BD2KGenomics/brca-website", "id": "8c069fe5e48e0e3d54caf85fbe58a750ff95dd54", "...
from __future__ import absolute_import, print_function, division import sys import multiprocessing as mp import traceback import pickle import numpy as np from numba import cuda from numba.cuda.cudadrv import drvapi, devicearray from numba import unittest_support as unittest from numba.cuda.testing import skip_on_cu...
{ "content_hash": "ae1990792ade49fb1ee55c07432c266d", "timestamp": "", "source": "github", "line_count": 299, "max_line_length": 80, "avg_line_length": 32.69899665551839, "alnum_prop": 0.577477753912243, "repo_name": "jriehl/numba", "id": "cebf2a3af66222c1a655521f9f30a78e7d0c113e", "size": "9777", ...
import socket, re version = '1.0' def dequote(str): """Will remove single or double quotes from the start and end of a string and return the result.""" quotechars = "'\"" while len(str) and str[0] in quotechars: str = str[1:] while len(str) and str[-1] in quotechars: str = str[0:-1...
{ "content_hash": "4e892058775a935f55792d0fadf34b7f", "timestamp": "", "source": "github", "line_count": 299, "max_line_length": 101, "avg_line_length": 38.62207357859532, "alnum_prop": 0.5886733633529615, "repo_name": "mazaclub/mazabot-core", "id": "8701dbf9ad107c419970effe3309674b76147f65", "size"...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging import os import sys import threading from setproctitle import setproctitle as set_process_title from pants.base.build_environment import get_buildroo...
{ "content_hash": "d74314b1aeeeddd133baed3d7033c3d5", "timestamp": "", "source": "github", "line_count": 325, "max_line_length": 104, "avg_line_length": 37.92307692307692, "alnum_prop": 0.6906288032454361, "repo_name": "fkorotkov/pants", "id": "c97e0c444a20cd22b32305212d4a85b266430c21", "size": "124...
from .send_recv import send_u_recv # noqa: F401 from .send_recv import send_ue_recv # noqa: F401 from .send_recv import send_uv # noqa: F401 __all__ = []
{ "content_hash": "0abba27474780c778b8341500060559b", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 49, "avg_line_length": 31.6, "alnum_prop": 0.6708860759493671, "repo_name": "PaddlePaddle/Paddle", "id": "c07f9bc40c6b39967ed168afb11928eb2ba1d635", "size": "769", "binary...
""" ================================================= Orthogonal distance regression (:mod:`scipy.odr`) ================================================= .. currentmodule:: scipy.odr Package Content =============== .. autosummary:: :toctree: generated/ Data -- The data to fit. RealData -- Dat...
{ "content_hash": "960434f474d996abcbc81a3346fa97f7", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 80, "avg_line_length": 30.228571428571428, "alnum_prop": 0.6732041587901701, "repo_name": "lhilt/scipy", "id": "f504937eb11e5bde9a8ddfce6ce6de6d5d07e9fb", "size": "4232", ...
import arcpy import os import logging logger = logging.getLogger("style_debug") #------------------------------------------------------------------------------- # Calculates the style code value def CalculateStyleCode(row): descTerm = row[3] descGroup = row[4] make = row[5] physicalPres = row[6] ...
{ "content_hash": "332bf967a09ff6f12c7569be7ed08bf8", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 130, "avg_line_length": 37.72680412371134, "alnum_prop": 0.5879218472468917, "repo_name": "AstunTechnology/Loader", "id": "01ee95f163130325730425ff312fc6151cdefbfe", "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): # Adding field 'Build.state' db.add_column('builds_build', 'state', self.gf('django.db.models.fields.CharField...
{ "content_hash": "30972241f13769161d48eee00c082602", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 230, "avg_line_length": 79.08695652173913, "alnum_prop": 0.5488363569726956, "repo_name": "sils1297/readthedocs.org", "id": "6b9dfeea59d6cceffba2e7ba84882b350cbae20d", "si...
from pyramid.view import view_config from pyramid import httpexceptions as exception from ..juliette.modelGroup import Grupo from ..juliette.excepciones import DatosException, ConflictoException from ..schemas.grupos import EsquemaGrupo import logging log = logging.getLogger(__name__) @view_config(route_name="gru...
{ "content_hash": "ade2a3ff7f8143e5667fc0b66c867d2b", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 104, "avg_line_length": 31.984126984126984, "alnum_prop": 0.6669975186104219, "repo_name": "VTacius/justine", "id": "f259fc7ceea2e9f4dfcd973c0c99d94665ab5d04", "size": "40...
from .cube import HoloCube # noqa (API import) from .geo import (GeoElement, GeoFeature, GeoTiles, # noqa (API import) WMTS, Points, Image, Text, Contours)
{ "content_hash": "250bb405173a91c454c382ef3129cf9e", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 75, "avg_line_length": 69, "alnum_prop": 0.5603864734299517, "repo_name": "ContinuumIO/cube-explorer", "id": "da5bbb4e4cbfe6c8f3d7c2f591fa3a3ef2f5619b", "size": "207", "bi...
import os import re import sys import socket import argparse import threading import multiprocessing from arp.arp import Arp_Spoof from logger.logger import Logger from arp.ping import Arp_Ping from banner.banner import New_Banner from server.server import HTTP_Server from dns.dns import Decode_Packet, DNS_Server clas...
{ "content_hash": "b5cadec869376ee9ab8681e400334a5a", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 156, "avg_line_length": 33.4635761589404, "alnum_prop": 0.6698990698594894, "repo_name": "Dylan-halls/Theseus", "id": "675e627f3d9c0a1e48cdbfa7f8686e7e3ba2a9d7", "size": "...