text stringlengths 0 1.05M | meta dict |
|---|---|
__all__ = 'run',
from . import coroutines
from . import events
from . import tasks
def run(main, *, debug=False):
"""Execute the coroutine and return the result.
This function runs the passed coroutine, taking care of
managing the asyncio event loop and finalizing asynchronous
generators.
This ... | {
"repo_name": "xyuanmu/XX-Net",
"path": "python3.8.2/Lib/asyncio/runners.py",
"copies": "10",
"size": "2021",
"license": "bsd-2-clause",
"hash": 7605121880532272000,
"line_mean": 27.0694444444,
"line_max": 79,
"alpha_frac": 0.6150420584,
"autogenerated": false,
"ratio": 4.219206680584551,
"conf... |
__all__ = ["runsimple"]
import sys
import webapi as web
def runsimple(func, server_address=("0.0.0.0", 8080)):
"""
Runs a simple HTTP server hosting WSGI app `func`. The directory `static/`
is hosted statically.
Based on [WsgiServer][ws] from [Colin Stewart][cs].
[ws]: http://www.owlfish.com/... | {
"repo_name": "CymaticLabs/Unity3D.Amqp",
"path": "lib/rabbitmq-dotnet-client-rabbitmq_v3_4_4/docs/pyle2-fcfcf7e/web/httpserver.py",
"copies": "1",
"size": "5071",
"license": "mit",
"hash": 1546180734391509800,
"line_mean": 39.568,
"line_max": 84,
"alpha_frac": 0.5103529876,
"autogenerated": false,... |
__all__ = ["runsimple"]
import sys, os
from SimpleHTTPServer import SimpleHTTPRequestHandler
import urllib
import posixpath
import webapi as web
import net
import utils
def runbasic(func, server_address=("0.0.0.0", 8080)):
"""
Runs a simple HTTP server hosting WSGI app `func`. The directory `static/`
is... | {
"repo_name": "mttpla/elbaBridge",
"path": "elbaBridgeServer/web/httpserver.py",
"copies": "67",
"size": "11487",
"license": "apache-2.0",
"hash": -8785179657475508000,
"line_mean": 35.0094043887,
"line_max": 105,
"alpha_frac": 0.5598502655,
"autogenerated": false,
"ratio": 4.366020524515394,
"... |
__all__ = ["runsimple"]
import sys, os
from SimpleHTTPServer import SimpleHTTPRequestHandler
import webapi as web
import net
import utils
def runbasic(func, server_address=("0.0.0.0", 8080)):
"""
Runs a simple HTTP server hosting WSGI app `func`. The directory `static/`
is hosted statically.
Based ... | {
"repo_name": "thunderace/newtifry",
"path": "appengine/web.0.34/httpserver.py",
"copies": "18",
"size": "9100",
"license": "apache-2.0",
"hash": 676182498289640100,
"line_mean": 35.4,
"line_max": 105,
"alpha_frac": 0.5435164835,
"autogenerated": false,
"ratio": 4.398260028999517,
"config_test"... |
__all__ = ["runsimple"]
import sys, os
import webapi as web
import net
import utils
def runbasic(func, server_address=("0.0.0.0", 8080)):
"""
Runs a simple HTTP server hosting WSGI app `func`. The directory `static/`
is hosted statically.
Based on [WsgiServer][ws] from [Colin Stewart][cs].
[w... | {
"repo_name": "bsmith3541/rapcollab",
"path": "webpy/web/httpserver.py",
"copies": "13",
"size": "8744",
"license": "mit",
"hash": 179747703592387330,
"line_mean": 37.1834061135,
"line_max": 84,
"alpha_frac": 0.519441903,
"autogenerated": false,
"ratio": 4.547061882475299,
"config_test": false,... |
__all__ = ["runsimple"]
import sys, os
from SimpleHTTPServer import SimpleHTTPRequestHandler
import webapi as web
import net
import utils
def runbasic(func, server_address=("0.0.0.0", 8080)):
"""
Runs a simple HTTP server hosting WSGI app `func`. The directory `static/`
is hosted statically.... | {
"repo_name": "ProfessionalIT/customers",
"path": "persianas_paludo/src/webapps/web/httpserver.py",
"copies": "1",
"size": "9350",
"license": "mit",
"hash": -1077894138232056600,
"line_mean": 35.4,
"line_max": 105,
"alpha_frac": 0.5289839572,
"autogenerated": false,
"ratio": 4.4566253574833175,
... |
__all__ = ['runtime', 'pluginBundle', 'registerPlugin']
class Runtime:
"""
Backward compatibility interface.
This class provides (partial) support for the interface of
older versions of PyObjC.
"""
def __getattr__(self, name):
import warnings
warnings.warn("Deprecated: use objc... | {
"repo_name": "rays/ipodderx-core",
"path": "objc/_compat.py",
"copies": "1",
"size": "1627",
"license": "mit",
"hash": -7746436694042057000,
"line_mean": 27.0517241379,
"line_max": 72,
"alpha_frac": 0.6441303012,
"autogenerated": false,
"ratio": 4.421195652173913,
"config_test": false,
"has_... |
__all__ = ['rvm']
import numpy as np
from scipy.linalg import cholesky
import pdb
from pyandres import cholInvert
class rvm(object):
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Constructor
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
def __init__(self, basis, targets, noise=None):
"""
C... | {
"repo_name": "aasensio/rvmMilne",
"path": "rvmOrig.py",
"copies": "1",
"size": "17318",
"license": "mit",
"hash": -4705856686013648000,
"line_mean": 33.2930693069,
"line_max": 155,
"alpha_frac": 0.6395657697,
"autogenerated": false,
"ratio": 2.727244094488189,
"config_test": false,
"has_no_k... |
__all__ = ['rvm']
import numpy as np
#import pdb
#from pyandres import cholInvert
class rvm(object):
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Constructor
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
def __init__(self, basis, targets, noise=None):
"""
Class that implements a Relevance... | {
"repo_name": "aasensio/pyAndres",
"path": "rvm.py",
"copies": "1",
"size": "17249",
"license": "mit",
"hash": 2086654084291598000,
"line_mean": 33.3605577689,
"line_max": 154,
"alpha_frac": 0.6395153342,
"autogenerated": false,
"ratio": 2.7223800505050506,
"config_test": false,
"has_no_keywo... |
__all__ = ["save_model", "load_model"]
import os
from .models import Lm, Lm2, Lmer
from .utils import _df_meta_to_arr
from rpy2.robjects.packages import importr
import deepdish as dd
import pandas as pd
import warnings
from tables import NaturalNameWarning
base = importr("base")
def save_model(model, filepath, comp... | {
"repo_name": "ejolly/pymer4",
"path": "pymer4/io.py",
"copies": "1",
"size": "8966",
"license": "mit",
"hash": -5985140483151603000,
"line_mean": 45.4559585492,
"line_max": 226,
"alpha_frac": 0.5089225965,
"autogenerated": false,
"ratio": 4.329309512312892,
"config_test": false,
"has_no_keyw... |
__all__ = ['savetxt', 'loadtxt', 'genfromtxt', 'ndfromtxt', 'mafromtxt',
'recfromtxt', 'recfromcsv', 'load', 'loads', 'save', 'savez',
'packbits', 'unpackbits', 'fromregex', 'DataSource']
import numpy as np
import format
import sys
import os
import sys
import itertools
import warnings
from operator imp... | {
"repo_name": "dagss/numpy_svn",
"path": "numpy/lib/npyio.py",
"copies": "4",
"size": "56059",
"license": "bsd-3-clause",
"hash": -7707728112892135000,
"line_mean": 33.7760545906,
"line_max": 82,
"alpha_frac": 0.5646550955,
"autogenerated": false,
"ratio": 4.141780568895456,
"config_test": fals... |
__all__ = ['savetxt', 'loadtxt', 'genfromtxt', 'ndfromtxt', 'mafromtxt',
'recfromtxt', 'recfromcsv', 'load', 'loads', 'save', 'savez',
'savez_compressed', 'packbits', 'unpackbits', 'fromregex', 'DataSource']
import numpy as np
import format
import sys
import os
import re
import sys
import itertoo... | {
"repo_name": "pelson/numpy",
"path": "numpy/lib/npyio.py",
"copies": "9",
"size": "65323",
"license": "bsd-3-clause",
"hash": -4798908887681938000,
"line_mean": 33.9507758159,
"line_max": 87,
"alpha_frac": 0.5584709827,
"autogenerated": false,
"ratio": 4.1288793375892805,
"config_test": false,... |
__all__ = ['savetxt', 'loadtxt',
'genfromtxt', 'ndfromtxt', 'mafromtxt', 'recfromtxt', 'recfromcsv',
'load', 'loads',
'save', 'savez',
'packbits', 'unpackbits',
'fromregex',
'DataSource']
import numpy as np
import format
import cStringIO
import os
impor... | {
"repo_name": "NirBenTalLab/proorigami-cde-package",
"path": "cde-root/usr/lib64/python2.4/site-packages/numpy/lib/io.py",
"copies": "2",
"size": "53226",
"license": "mit",
"hash": -2120336389264801800,
"line_mean": 33.6072821847,
"line_max": 82,
"alpha_frac": 0.5619997745,
"autogenerated": false,
... |
__all__ = ["scale_samples", "read_param_file"]
from collections import OrderedDict
import csv
from warnings import warn
import numpy as np
def scale_samples(params, bounds):
'''
Rescales samples in 0-to-1 range to arbitrary bounds.
Arguments:
bounds - list of lists of dimensions num_params-by-2
... | {
"repo_name": "t2abdulg/SALib",
"path": "SALib/util/__init__.py",
"copies": "2",
"size": "5466",
"license": "mit",
"hash": -1327670954280167700,
"line_mean": 34.0384615385,
"line_max": 79,
"alpha_frac": 0.6042810099,
"autogenerated": false,
"ratio": 4.112866817155756,
"config_test": false,
"h... |
__all__ = ["ScanDirectoryNode"]
from panda3d.core import VirtualFileSystem, VirtualFileMountSystem, Filename, TiXmlDocument
vfs = VirtualFileSystem.getGlobalPtr()
class ScanDirectoryNode:
""" This class is used to scan a list of files on disk. """
def __init__(self, pathname, ignoreUsageXml = False):
... | {
"repo_name": "tobspr/panda3d",
"path": "direct/src/p3d/ScanDirectoryNode.py",
"copies": "19",
"size": "3592",
"license": "bsd-3-clause",
"hash": 3610360276469740000,
"line_mean": 36.8105263158,
"line_max": 96,
"alpha_frac": 0.5534521158,
"autogenerated": false,
"ratio": 4.757615894039735,
"con... |
__all__ = ['Schema']
import os
import sys
import yaml
from collections import OrderedDict
from .column import Column
class Schema(object):
def __init__(self, table, type_fields=None):
self.table = table
# schema path
schema_path = self.get_path()
# type_fields
if... | {
"repo_name": "yadb/yadb",
"path": "backup/store/schema.py",
"copies": "1",
"size": "1998",
"license": "mit",
"hash": -2057294538741646000,
"line_mean": 27.1408450704,
"line_max": 76,
"alpha_frac": 0.5055055055,
"autogenerated": false,
"ratio": 4.044534412955466,
"config_test": false,
"has_no... |
# All Schevo schema modules must have these lines.
from schevo.schema import *
schevo.schema.prep(locals())
class SchevoIcon(E.Entity):
_hidden = True
name = f.string()
data = f.image()
_key(name)
class Gender(E.Entity):
"""Gender of a person."""
code = f.string()
name = f.string()
... | {
"repo_name": "Schevo/schevo",
"path": "schevo/example/todo/schema/todo_001.py",
"copies": "1",
"size": "1861",
"license": "mit",
"hash": -217341552666518080,
"line_mean": 17.61,
"line_max": 70,
"alpha_frac": 0.5325094035,
"autogenerated": false,
"ratio": 3.2764084507042255,
"config_test": fals... |
# All scorer.py files must contain the function score(), which takes as input the following items: an instance of one of
# the models of a modelclass.py file, a feature set, the corresponding correct labels of the feature set, and the set of
# "hyperparameters" of the scoring function. It then returns a dictionary cont... | {
"repo_name": "reiinakano/ensemble_helper",
"path": "src/enScorers/NFoldCV/scorer.py",
"copies": "1",
"size": "2392",
"license": "mit",
"hash": -3140590475851311000,
"line_mean": 45,
"line_max": 131,
"alpha_frac": 0.6755852843,
"autogenerated": false,
"ratio": 3.697063369397218,
"config_test": ... |
__all__ = ["SCPI"]
import socket
import time
from utility.log import VLOG
from utility.status import *
class SCPI(object):
def __init__(self, host_ip):
self.host_ip = host_ip
self.port = 1024
self.client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.client.connect((host_ip, self.port))
... | {
"repo_name": "weibohit/tools",
"path": "driver/scpi.py",
"copies": "1",
"size": "2058",
"license": "mit",
"hash": -2955820927644370400,
"line_mean": 27.985915493,
"line_max": 70,
"alpha_frac": 0.5962099125,
"autogenerated": false,
"ratio": 2.8114754098360657,
"config_test": false,
"has_no_ke... |
__all__ = ['scraper', 'local_scraper', 'pw_scraper', 'uflix_scraper', 'watchseries_scraper', 'movie25_scraper', 'merdb_scraper', '2movies_scraper', 'icefilms_scraper',
'movieshd_scraper', 'yifytv_scraper', 'viooz_scraper', 'filmstreaming_scraper', 'myvideolinks_scraper', 'filmikz_scraper', 'clickplay_scraper... | {
"repo_name": "aplicatii-romanesti/allinclusive-kodi-pi",
"path": ".kodi/addons/plugin.video.salts/scrapers/__init__.py",
"copies": "1",
"size": "4030",
"license": "apache-2.0",
"hash": 8293275888796567000,
"line_mean": 45.8604651163,
"line_max": 174,
"alpha_frac": 0.6285359801,
"autogenerated": fa... |
__all__ = ["Scraper"]
from .parser import ChapterParser
from .story import Chapter, Story
from .util import get_choice_names
import re
CHYOA_URL_REGEX = re.compile(r"^https://chyoa.com/story/[^ ]+\.[0-9]+$")
class Scraper(object):
def __init__(self):
self.parser = ChapterParser()
def _reset(self):
... | {
"repo_name": "sexypants/chyoa-scraper",
"path": "chyoa/scraper.py",
"copies": "1",
"size": "1703",
"license": "mit",
"hash": 4660243847295012000,
"line_mean": 26.4677419355,
"line_max": 92,
"alpha_frac": 0.5513799178,
"autogenerated": false,
"ratio": 3.4897540983606556,
"config_test": false,
... |
__all__ = ('ScriptError', 'ImportScriptError', 'InstallDependencyError',
'DependencyBlacklistedError', 'ScriptExecutionError', 'BadBehavingScriptError',
'RequirementError')
class ScriptError(Exception):
"""
A general script exception all other exceptions are derived from.
"""
pas... | {
"repo_name": "lgrahl/scripthookvpy3k",
"path": "python/gta/exceptions.py",
"copies": "1",
"size": "2127",
"license": "mit",
"hash": -1783305598626295600,
"line_mean": 23.4482758621,
"line_max": 90,
"alpha_frac": 0.6276445698,
"autogenerated": false,
"ratio": 4.535181236673774,
"config_test": f... |
__all__ = ["SelectReactor"]
from .abstractreactor import AbstractReactor
from select import select
from collections import defaultdict
# 基于select的Reactor的具体实现
class SelectReactor(AbstractReactor):
EV_NULL = 0x00
EV_DISCONNECTED = 0x18
EV_IN = 0x01
EV_OUT = 0x04
def __init__(self):
self.... | {
"repo_name": "Hevienz/greenev",
"path": "greenev/reactor/selectreactor.py",
"copies": "1",
"size": "1260",
"license": "apache-2.0",
"hash": 4848696320817896000,
"line_mean": 26.0434782609,
"line_max": 80,
"alpha_frac": 0.557073955,
"autogenerated": false,
"ratio": 3.1815856777493607,
"config_t... |
__all__ = ["send",
"track_send_item",
"send_shipment",
"receive",
"track_recv_item",
"recv_shipment",
"recv_sent_shipment",
"send_rec",
"send_get_id",
"send_get_ref",
"recv_rec",
"recv_get_id",
"dbcallback_getStockLevels",
]
from ... | {
"repo_name": "anubhav929/eden",
"path": "modules/tests/inv/helper.py",
"copies": "1",
"size": "14536",
"license": "mit",
"hash": -4250696132323733500,
"line_mean": 40.0621468927,
"line_max": 217,
"alpha_frac": 0.5163043478,
"autogenerated": false,
"ratio": 4.369101292455666,
"config_test": tru... |
__all__ = ["send",
"track_send_item",
"send_shipment",
"receive",
"track_recv_item",
"recv_shipment",
"recv_sent_shipment",
"send_rec",
"send_get_id",
"send_get_ref",
"recv_rec",
"recv_get_id",
... | {
"repo_name": "tudorian/eden",
"path": "modules/tests/inv/helper.py",
"copies": "28",
"size": "16790",
"license": "mit",
"hash": -5690788515202574000,
"line_mean": 38.8812351544,
"line_max": 217,
"alpha_frac": 0.522334723,
"autogenerated": false,
"ratio": 4.332903225806452,
"config_test": true,... |
__all__ = ('SensorNotFound', 'SensorListener', 'sensortypes')
from jnius import PythonJavaClass, java_method, autoclass, cast
PythonActivity = autoclass('org.renpy.android.PythonActivity')
Context = autoclass('android.content.Context')
Sensor = autoclass('android.hardware.Sensor')
SensorManager = autoclass('android.h... | {
"repo_name": "tshirtman/pyconfr-2013-kivy",
"path": "jnius_3.py",
"copies": "1",
"size": "2505",
"license": "mit",
"hash": -4945805223044634000,
"line_mean": 33.7916666667,
"line_max": 82,
"alpha_frac": 0.6786427146,
"autogenerated": false,
"ratio": 3.6676427525622253,
"config_test": false,
... |
__all__ = ["SentryNotifier"]
from freight import http
from freight.models import App, TaskStatus
from .base import Notifier, NotifierEvent
class SentryNotifier(Notifier):
def get_options(self):
return {"webhook_url": {"required": True}}
def should_send_deploy(self, deploy, task, config, event):
... | {
"repo_name": "getsentry/freight",
"path": "freight/notifiers/sentry.py",
"copies": "1",
"size": "1459",
"license": "apache-2.0",
"hash": 4609676488881996300,
"line_mean": 30.0425531915,
"line_max": 87,
"alpha_frac": 0.5702535984,
"autogenerated": false,
"ratio": 4.030386740331492,
"config_test... |
__all__ = ["sentry_tower", "machine_gun_tower", "rocket_tower"]
from .tools import create_building
SENTRY_TOWER_BASIS = {
'alias': 'sniper',
'type': 'sentryGun',
'firing_range': 12,
'rate_of_fire': 0.7,
'role': 'tower',
'status': 'idle',
'size': 3,
'level': None,
'tile_position': N... | {
"repo_name": "CheckiO/EoC-battle-mocks",
"path": "battle_mocks/towers.py",
"copies": "1",
"size": "2424",
"license": "mit",
"hash": -5265394104865299000,
"line_mean": 30.0769230769,
"line_max": 99,
"alpha_frac": 0.6262376238,
"autogenerated": false,
"ratio": 2.6205405405405404,
"config_test": ... |
__all__ = ['seq_cpg_analysis']
def drop_small_region(items, length):
"""
>>> drop_small_region([(10,20),(100,300),(1000,2000)], 0)
[(10, 20), (100, 300), (1000, 2000)]
>>> drop_small_region([(10,20),(100,300),(1000,2000)], 200)
[(100, 300), (1000, 2000)]
>>> drop_small_region([(10,20),(100,300)... | {
"repo_name": "mizuy/seqtool",
"path": "seqtool/nucleotide/cpgisland.py",
"copies": "1",
"size": "3601",
"license": "mit",
"hash": -4189080280865785300,
"line_mean": 26.0751879699,
"line_max": 94,
"alpha_frac": 0.5173562899,
"autogenerated": false,
"ratio": 3.0133891213389123,
"config_test": fa... |
__all__ = ['seqToKV', 'kvToSeq', 'dictToKV', 'kvToDict']
from openid import oidutil
import types
class KVFormError(ValueError):
pass
def seqToKV(seq, strict=False):
"""Represent a sequence of pairs of strings as newline-terminated
key:value pairs. The pairs are generated in the order given.
@param ... | {
"repo_name": "vbshah1992/microblog",
"path": "flask/lib/python2.7/site-packages/openid/kvform.py",
"copies": "146",
"size": "3294",
"license": "bsd-3-clause",
"hash": -7146062292637374000,
"line_mean": 25.7804878049,
"line_max": 79,
"alpha_frac": 0.5085003036,
"autogenerated": false,
"ratio": 3.... |
__all__ = ['seqToKV', 'kvToSeq', 'dictToKV', 'kvToDict']
import types
import logging
class KVFormError(ValueError):
pass
def seqToKV(seq, strict=False):
"""Represent a sequence of pairs of strings as newline-terminated
key:value pairs. The pairs are generated in the order given.
@param seq: The pair... | {
"repo_name": "jcnelson/syndicate",
"path": "old/ms/openid/kvform.py",
"copies": "13",
"size": "3283",
"license": "apache-2.0",
"hash": -1544924639849895000,
"line_mean": 25.9098360656,
"line_max": 79,
"alpha_frac": 0.507767286,
"autogenerated": false,
"ratio": 3.599780701754386,
"config_test":... |
__all__ = ["SeqValue"]
class SeqValue:
""" This represents a sequence value read from a contents.xml
file, either from the <contents> or the <package> section. It's
represented as series of dotted integers in the xml file, and
stored internally as a tuple of integers.
It may be incremented, whic... | {
"repo_name": "brakhane/panda3d",
"path": "direct/src/p3d/SeqValue.py",
"copies": "1",
"size": "2660",
"license": "bsd-3-clause",
"hash": 1607253535921754400,
"line_mean": 30.2941176471,
"line_max": 68,
"alpha_frac": 0.5763157895,
"autogenerated": false,
"ratio": 4.367816091954023,
"config_test... |
__all__ = ["SeqValue"]
import types
class SeqValue:
""" This represents a sequence value read from a contents.xml
file, either from the <contents> or the <package> section. It's
represented as series of dotted integers in the xml file, and
stored internally as a tuple of integers.
It may be inc... | {
"repo_name": "mgracer48/panda3d",
"path": "direct/src/p3d/SeqValue.py",
"copies": "1",
"size": "2722",
"license": "bsd-3-clause",
"hash": 2419831020425167400,
"line_mean": 30.2873563218,
"line_max": 68,
"alpha_frac": 0.5833945628,
"autogenerated": false,
"ratio": 4.348242811501597,
"config_tes... |
__all__ = ["SerialImpl"]
from utility.log import VLOG
from utility.status import *
import serial
import time
class SerialImpl(object):
def __init__(self):
# Serial Port RS232 basic configure parameters
self.ser_ = serial.Serial('/dev/ttyUSB0')
self.ser_.setBaudrate(9600)
self.ser_.setStopbits(seria... | {
"repo_name": "weibohit/tools",
"path": "driver/serial_impl.py",
"copies": "1",
"size": "5395",
"license": "mit",
"hash": -5845878013984578000,
"line_mean": 26.8092783505,
"line_max": 60,
"alpha_frac": 0.5975903614,
"autogenerated": false,
"ratio": 3.2896341463414633,
"config_test": false,
"h... |
__all__ = ["SerializerManager"]
class SerializerManager(object):
def __init__(self):
self.registry = {}
def add(self, type, cls_or_none=None):
if cls_or_none is not None:
return self.add(type)(cls_or_none)
def wrapped(cls):
self.registry[type] = cls()
... | {
"repo_name": "getsentry/freight",
"path": "freight/api/serializer/manager.py",
"copies": "1",
"size": "1073",
"license": "apache-2.0",
"hash": 1194482062909094700,
"line_mean": 25.825,
"line_max": 89,
"alpha_frac": 0.5852749301,
"autogenerated": false,
"ratio": 4.049056603773585,
"config_test"... |
"""All serializers for the extension."""
from rest_framework import serializers
from geokey.users.serializers import UserSerializer
from geokey_sapelli.models import SapelliLogFile
class SapelliLogFileSerializer(serializers.ModelSerializer):
"""Serializer for geokey_sapelli.models.SapelliLogFile instances."""
... | {
"repo_name": "ExCiteS/geokey-sapelli",
"path": "geokey_sapelli/serializers.py",
"copies": "1",
"size": "2001",
"license": "mit",
"hash": -703307550348095600,
"line_mean": 25.3289473684,
"line_max": 76,
"alpha_frac": 0.5807096452,
"autogenerated": false,
"ratio": 4.516930022573363,
"config_test... |
__all__ = ["serve_fs"]
import SimpleHTTPServer
import SocketServer
from fs.path import pathjoin, dirname
from fs.errors import FSError
from time import mktime
from cStringIO import StringIO
import cgi
import urllib
import posixpath
import time
import threading
import socket
def _datetime_to_epoch(d):
return mktim... | {
"repo_name": "atty303/pyfilesystem",
"path": "fs/expose/http.py",
"copies": "14",
"size": "5609",
"license": "bsd-3-clause",
"hash": 1333354941885863200,
"line_mean": 33.4171779141,
"line_max": 119,
"alpha_frac": 0.5683722589,
"autogenerated": false,
"ratio": 4.085214857975236,
"config_test": ... |
__all__ = ["ServerInfo"]
import psutil
import time
from execute_async import ExecuteAsync
class ServerInfo(object):
@staticmethod
def Create():
server_info = {}
command = ExecuteAsync("uname -m")
command.Run()
(status, output) = command.GetResponse()
if status.IsOk():
server_info["ar... | {
"repo_name": "weibohit/tools",
"path": "utility/server_info.py",
"copies": "1",
"size": "1865",
"license": "mit",
"hash": -4352658893277456400,
"line_mean": 30.6101694915,
"line_max": 72,
"alpha_frac": 0.6209115282,
"autogenerated": false,
"ratio": 3.642578125,
"config_test": false,
"has_no_... |
__all__ = ["Server", "ServerStatistics", "ServerStatus", "ServerRefiller"]
from abc import ABC
from copy import copy
from sys import getsizeof
from threading import Lock, Thread
from time import time
from typing import Any, Dict, Optional, Type, Union
from weakref import ref as weak_ref
from nichtparasoup import VERS... | {
"repo_name": "k4cg/nichtparasoup",
"path": "nichtparasoup/core/server.py",
"copies": "1",
"size": "7977",
"license": "mit",
"hash": 9056316017208411000,
"line_mean": 33.5324675325,
"line_max": 108,
"alpha_frac": 0.5530901341,
"autogenerated": false,
"ratio": 3.998496240601504,
"config_test": f... |
__all__ = ["Session"]
import time
from basic_types import WebPoint
from capabilities import Capabilities
from geoposition import Geoposition
from browser.status import *
from browser.xwalk import Xwalk
from base.log import VLOG
class FrameInfo(object):
def __init__(self, parent_frame_id, frame_id, xwalkdriver_fram... | {
"repo_name": "PeterWangIntel/crosswalk-webdriver-python",
"path": "misc/session.py",
"copies": "1",
"size": "3275",
"license": "bsd-3-clause",
"hash": 6817627009321732000,
"line_mean": 31.4257425743,
"line_max": 82,
"alpha_frac": 0.6974045802,
"autogenerated": false,
"ratio": 3.5714285714285716,... |
__all__=['set_length_units','init_dirs']
import os
import sastool.libconfig as libconfig
from IPython.core.getipython import get_ipython
from sastool.classes2 import Loader
from sastool.io import credo_saxsctrl, credo_cct
def set_length_units(units):
"""Set the length units: either 'nm' or 'A'.
"""
libco... | {
"repo_name": "awacha/credolib",
"path": "credolib/initialization.py",
"copies": "1",
"size": "3709",
"license": "bsd-3-clause",
"hash": 305364757760909440,
"line_mean": 44.243902439,
"line_max": 105,
"alpha_frac": 0.6505796711,
"autogenerated": false,
"ratio": 3.683217477656405,
"config_test":... |
__all__ = ['SetMode']
import time
import logging
import dronekit
import geopy
from ...configuration import Configuration
from ...state import State
from ...specification import Specification
from ...environment import Environment
from ...command import Parameter, Command
from ...specification import Specification, I... | {
"repo_name": "squaresLab/Houston",
"path": "houston/ardu/copter/setmode.py",
"copies": "1",
"size": "2718",
"license": "mit",
"hash": 2967443804641049000,
"line_mean": 22.8421052632,
"line_max": 74,
"alpha_frac": 0.5820456218,
"autogenerated": false,
"ratio": 3.682926829268293,
"config_test": ... |
__all__ = ('set_options', 'add_options', 'get_options',
'set_classpath', 'add_classpath', 'get_classpath',
'expand_classpath')
import platform
if platform.system() == 'Windows':
split_char = ';'
else:
split_char = ':'
vm_running = False
options = []
classpath = None
def set_options(*opt... | {
"repo_name": "physion/pyjnius",
"path": "jnius_config.py",
"copies": "1",
"size": "2462",
"license": "mit",
"hash": -9040899539550102000,
"line_mean": 27.6279069767,
"line_max": 122,
"alpha_frac": 0.654752234,
"autogenerated": false,
"ratio": 4.0627062706270625,
"config_test": false,
"has_no... |
__all__ = ['Setting', 'BoolSetting', 'IntSetting', 'StrSetting']
class Setting:
def __init__(self, default=None, choices=None):
self.default = default
self.choices = choices
def clean(self, value):
if not self.choices is None and not value in self.choices:
raise ValueError... | {
"repo_name": "natano/tiget",
"path": "tiget/plugins/settings.py",
"copies": "1",
"size": "2671",
"license": "isc",
"hash": -4539372739914918000,
"line_mean": 25.9797979798,
"line_max": 72,
"alpha_frac": 0.5567203295,
"autogenerated": false,
"ratio": 4.32200647249191,
"config_test": false,
"h... |
__all__ = ["ShellProvider"]
from .base import Provider
from freight.models import App, Deploy
class ShellProvider(Provider):
def get_options(self):
return {"command": {"required": True}, "env": {"required": False, "type": dict}}
def get_command(self, deploy, task, ssh_key):
params = task.par... | {
"repo_name": "getsentry/freight",
"path": "freight/providers/shell.py",
"copies": "1",
"size": "1293",
"license": "apache-2.0",
"hash": 4145228857005067000,
"line_mean": 32.1538461538,
"line_max": 88,
"alpha_frac": 0.5993812838,
"autogenerated": false,
"ratio": 3.7369942196531793,
"config_test... |
# All shows: http://www.funimation.com/feeds/ps/shows?limit=100000
# http://www.funimation.com/feeds/ps/shows?sort=SortOptionLatestSubscription (limit no workie)
# Single show: http://www.funimation.com/feeds/ps/videos?ut=FunimationSubscriptionUser&show_id=7556914&limit=100000
from logging import debug, info, warn... | {
"repo_name": "TheEnigmaBlade/holo",
"path": "src/services/stream/funimation_new.py",
"copies": "2",
"size": "3889",
"license": "mit",
"hash": 1527680576630743600,
"line_mean": 33.4159292035,
"line_max": 175,
"alpha_frac": 0.6994085883,
"autogenerated": false,
"ratio": 3.138821630347054,
"confi... |
__all__ = ['shuffleMockCatalog', 'generate_upid']
import warnings
from itertools import izip
import numpy as np
from numpy.lib.recfunctions import rename_fields
def _iter_plateau_in_sorted_array(a):
if len(a):
k = np.where(a[1:] != a[:-1])[0]
k += 1
i = 0
for j in k:
yie... | {
"repo_name": "manodeep/yymao-helpers",
"path": "helpers/shuffleMockCatalog.py",
"copies": "1",
"size": "10527",
"license": "mit",
"hash": -8202520162064339000,
"line_mean": 35.9368421053,
"line_max": 80,
"alpha_frac": 0.5709128907,
"autogenerated": false,
"ratio": 3.4571428571428573,
"config_t... |
__all__ = ('SideBar')
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.scrollview import ScrollView
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.uix.image import Image
from kivy.uix.boxlayout import BoxLayout
from pocketthrone.entities.event import *
from pocketthrone.entities.e... | {
"repo_name": "herrschr/pocket-throne",
"path": "pocketthrone/widgets/sidebar.py",
"copies": "2",
"size": "3780",
"license": "bsd-2-clause",
"hash": -2649730090788869000,
"line_mean": 32.1578947368,
"line_max": 151,
"alpha_frac": 0.7177248677,
"autogenerated": false,
"ratio": 3.1738035264483626,
... |
__all__ = ["side_by_side_diff", "context_diff"]
import itertools
import re
import diff_match_patch
line_split = re.compile(r'(?:\r?\n)')
def side_by_side_diff(old_text, new_text):
"""
Calculates a side-by-side line-based difference view.
Wraps insertions in <ins></ins> and deletions in <del></del>.
... | {
"repo_name": "cburgmer/django-wikify",
"path": "src/wikify/diff_utils.py",
"copies": "1",
"size": "5779",
"license": "bsd-3-clause",
"hash": 5740293291239060000,
"line_mean": 33.6047904192,
"line_max": 80,
"alpha_frac": 0.5286381727,
"autogenerated": false,
"ratio": 4.007628294036061,
"config_... |
#ALL SID UNIQUE
#BLOCKS = 7
#TYPES = 2
#TYPE128368.NAME = DFT1
#TYPE128424.NAME = DFT2
#BLOCK128365.NAME = DFP1
#BLOCK128365.INPORT_COUNT = 15
#BLOCK128365.OUTPORT_COUNT = 22
#BLOCK128365.DESCRIPTION = Description128365
#BLOCK128366.NAME = DFP2
#BLOCK128366.INPORT_COUNT = 15
#BLOCK128366.OUTPORT_COUNT = 22
#BLOCK128366... | {
"repo_name": "mukatee/dsm-mbt-example",
"path": "example/checker.py",
"copies": "1",
"size": "4251",
"license": "mit",
"hash": 9045874768941266000,
"line_mean": 33.8442622951,
"line_max": 185,
"alpha_frac": 0.6271465538,
"autogenerated": false,
"ratio": 2.9831578947368422,
"config_test": false... |
__all__ = ['SimpleDoc']
class SimpleDoc(object):
"""
class generating xml/html documents using context managers
doc, tag, text = SimpleDoc().tagtext()
with tag('html'):
with tag('body', id = 'hello'):
with tag('h1'):
text('Hello world!')
print(doc.getvalu... | {
"repo_name": "ritashugisha/ASUEvents",
"path": "ASUEvents/MetronicElements/yattag/simpledoc.py",
"copies": "1",
"size": "7957",
"license": "mit",
"hash": 235635698391779040,
"line_mean": 31.8801652893,
"line_max": 90,
"alpha_frac": 0.5014452683,
"autogenerated": false,
"ratio": 4.362390350877193... |
__all__ = ["SimpleHTTPRequestHandler"]
import os
import posixpath
import BaseHTTPServer
import urllib
import cgi
import shutil
import mimetypes
import re
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler)... | {
"repo_name": "wrongu/AlphaGo",
"path": "interface/server/goServer.py",
"copies": "1",
"size": "9254",
"license": "mit",
"hash": -6806876144680090000,
"line_mean": 33.9245283019,
"line_max": 90,
"alpha_frac": 0.5778041928,
"autogenerated": false,
"ratio": 4.191123188405797,
"config_test": false... |
__all__ = ["SimpleHTTPRequestHandler"]
import time
import os
import posixpath
import BaseHTTPServer
import urllib
import urlparse
import cgi
import shutil
import mimetypes
from StringIO import StringIO
class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""Simple HTTP request handler with GET... | {
"repo_name": "flashscope/testJavaWebServer",
"path": "public_html/ex07_svr1.py",
"copies": "1",
"size": "6656",
"license": "apache-2.0",
"hash": -1100281477096939100,
"line_mean": 32.6161616162,
"line_max": 78,
"alpha_frac": 0.5914963942,
"autogenerated": false,
"ratio": 4.319273199221285,
"co... |
__all__ = ['simplex_array_searchsorted','simplex_array_boundary','simplex_array_parity']
from scipy import ravel, zeros, ones, arange, empty, alltrue, array, lexsort, \
hstack, vstack, rank, bincount, cumsum, ascontiguousarray, zeros_like, \
concatenate, asarray
from scipy.sparse import csr_matrix
def simple... | {
"repo_name": "whereisravi/pydec",
"path": "pydec/dec/simplex_array.py",
"copies": "6",
"size": "6808",
"license": "bsd-3-clause",
"hash": -5970975961294593000,
"line_mean": 25.1846153846,
"line_max": 100,
"alpha_frac": 0.5243830787,
"autogenerated": false,
"ratio": 3.0352206865804727,
"config_... |
__all__ = ['Simplex','SimplicialMesh','simplex','simplicial_mesh']
from pydec.math import signed_volume,relative_parity,combinations
from base_mesh import base_mesh
from scipy import asarray
import numpy,scipy
class simplex(tuple):
def __new__(cls,s,parity=0):
obj = tuple.__new__(cls,sorted(s))
... | {
"repo_name": "whereisravi/pydec",
"path": "pydec/mesh/simplex.py",
"copies": "6",
"size": "6366",
"license": "bsd-3-clause",
"hash": 1304307029112823000,
"line_mean": 31.4795918367,
"line_max": 99,
"alpha_frac": 0.5326735784,
"autogenerated": false,
"ratio": 4.0214782059380925,
"config_test": ... |
__all__ = ['SimplicialComplex','simplicial_complex']
from warnings import warn
import numpy
import scipy
from scipy import sparse, zeros, asarray, mat, hstack
import pydec
from pydec.mesh.simplex import simplex, simplicial_mesh
from pydec.math import circumcenter, unsigned_volume, signed_volume
from simplex_array i... | {
"repo_name": "DongliangGao/pydec",
"path": "pydec/dec/simplicial_complex.py",
"copies": "6",
"size": "9674",
"license": "bsd-3-clause",
"hash": 2920776700342406000,
"line_mean": 33.304964539,
"line_max": 115,
"alpha_frac": 0.5461029564,
"autogenerated": false,
"ratio": 3.9055308841340333,
"con... |
__all__ = ['simplicial_grid_2d','cube_grid']
from scipy import zeros,resize,arange,ravel,concatenate,matrix, \
transpose,prod,mgrid,ndindex,sum,array,cumprod,tile,ones
import scipy
def simplicial_grid_2d(n):
"""
Create an NxN 2d grid in the unit square
The number of vertices along each axis is... | {
"repo_name": "whereisravi/pydec",
"path": "pydec/mesh/generation.py",
"copies": "7",
"size": "2495",
"license": "bsd-3-clause",
"hash": 2301288058153898000,
"line_mean": 27.3522727273,
"line_max": 111,
"alpha_frac": 0.5386773547,
"autogenerated": false,
"ratio": 2.9352941176470586,
"config_tes... |
__all__ = ["simulate_displacement_field"]
import numpy as np
from ..core import ants_image as iio
from .. import utils
def simulate_displacement_field(domain_image,
field_type="bspline",
number_of_random_points=1000,
... | {
"repo_name": "ANTsX/ANTsPy",
"path": "ants/utils/simulate_displacement_field.py",
"copies": "1",
"size": "3368",
"license": "apache-2.0",
"hash": -1728118725614469000,
"line_mean": 35.6086956522,
"line_max": 102,
"alpha_frac": 0.6199524941,
"autogenerated": false,
"ratio": 4.142681426814268,
"... |
"""All single flight related functionalities and representations"""
from flight_genie.utils import (
get_value_by_key_in_pairs_list,
get_numerical_value,
month_day_from_date,
weekday_from_date,
country_from_airport,
city_code_from_airport,
days_in_range,
)
class Flight(object):
"""Sim... | {
"repo_name": "lyuboraykov/flight-genie",
"path": "flight_genie/flight.py",
"copies": "1",
"size": "4732",
"license": "mit",
"hash": 5350743397279617000,
"line_mean": 31.1904761905,
"line_max": 79,
"alpha_frac": 0.5422654269,
"autogenerated": false,
"ratio": 3.986520640269587,
"config_test": fa... |
__all__ = ['sisotool']
from control.exception import ControlMIMONotImplemented
from .freqplot import bode_plot
from .timeresp import step_response
from .lti import issiso, isdtime
from .xferfcn import TransferFunction
from .bdalg import append, connect
import matplotlib
import matplotlib.pyplot as plt
import warnings
... | {
"repo_name": "python-control/python-control",
"path": "control/sisotool.py",
"copies": "1",
"size": "7184",
"license": "bsd-3-clause",
"hash": -7654380755537825000,
"line_mean": 39.3595505618,
"line_max": 91,
"alpha_frac": 0.6570155902,
"autogenerated": false,
"ratio": 3.3320964749536177,
"con... |
__all__ = ['sisotool']
from .freqplot import bode_plot
from .timeresp import step_response
from .lti import issiso, isdtime
import matplotlib
import matplotlib.pyplot as plt
import warnings
def sisotool(sys, kvect = None, xlim_rlocus = None, ylim_rlocus = None,
plotstr_rlocus = 'b' if int(matplotlib.__ve... | {
"repo_name": "roryyorke/python-control",
"path": "control/sisotool.py",
"copies": "1",
"size": "5605",
"license": "bsd-3-clause",
"hash": -2541408984538417700,
"line_mean": 36.119205298,
"line_max": 177,
"alpha_frac": 0.6508474576,
"autogenerated": false,
"ratio": 3.2268278641335635,
"config_t... |
__all__ = ['SitemapIndex', 'Sitemap']
import os
import xml.etree.ElementTree as ET
from datetime import datetime
from lxml import etree
class BaseSiteMap(object):
_init_content = ''
CHANGEFREQ_ALWAYS = 'always'
CHANGEFREQ_HOURLY = 'hourly'
CHANGEFREQ_DAILY = 'daily'
CHANGEFREQ_WEEKLY = 'weekly'... | {
"repo_name": "inabhi9/pysitemapgen",
"path": "pysitemapgen/__init__.py",
"copies": "1",
"size": "2519",
"license": "mit",
"hash": -7470767598461785000,
"line_mean": 30.8860759494,
"line_max": 90,
"alpha_frac": 0.6292179436,
"autogenerated": false,
"ratio": 3.394878706199461,
"config_test": fal... |
__all__ = ['sm']
from math import exp, log10
def sm(hm, z=0):
"""stellar mass given halo mass, redshift (Eq. 3 of Behroozi+13)"""
a = 1.0/(1.0+z)
loghm = log10(hm)
logm1 = _logm1(a)
logsm = _logeps(a) + logm1 + _eff(loghm-logm1, a) - _eff(0., a)
return 10.0**logsm
def _eff(x, a):
alpha, d... | {
"repo_name": "yymao/slackbots",
"path": "smhm.py",
"copies": "1",
"size": "1270",
"license": "mit",
"hash": 5018075728328070000,
"line_mean": 30.75,
"line_max": 78,
"alpha_frac": 0.5346456693,
"autogenerated": false,
"ratio": 1.9568567026194146,
"config_test": false,
"has_no_keywords": false... |
__all__ = ['SortedDict']
from itertools import imap as _imap
class SortedDict(dict):
def __init__(self, value=None, kvio=False):
"""
SortedDict will implement Key Insertion Order (KIO: updates of values
do not affect the position of the key), Key Value Insertion Order (KVIO,
... | {
"repo_name": "limodou/uliweb",
"path": "uliweb/utils/sorteddict.py",
"copies": "2",
"size": "3624",
"license": "bsd-2-clause",
"hash": 4390575032423411700,
"line_mean": 27.2258064516,
"line_max": 118,
"alpha_frac": 0.4950331126,
"autogenerated": false,
"ratio": 4.151202749140894,
"config_test"... |
"""All sorts of geo utils for measurement project
"""
import math, sys, getopt
def distance(origin, destination, radius = 6371):
"""Based on Haversine formula, default return result is kilometers"""
# The Haversine formula is an equation that can be used to find great-circle distances between two points on a sphere ... | {
"repo_name": "nebgnahz/CS268NetworkMeasurement",
"path": "king/utilities.py",
"copies": "1",
"size": "2627",
"license": "bsd-2-clause",
"hash": -3475045028332974600,
"line_mean": 30.6506024096,
"line_max": 162,
"alpha_frac": 0.6478873239,
"autogenerated": false,
"ratio": 3.231242312423124,
"co... |
__all__ = ['sources_list', 'newsApi_API', 'further_read_theNextWeb', 'invalid', 'thankyou', 'notready']
#functions
import json
from pprint import pprint
from urllib.request import urlopen
import binascii
from image_retriever import return_image
import re
from apikey import key
apiKey = key()
keys = {'1': "https://... | {
"repo_name": "thepiprogrammer/PyNewsApp",
"path": "functions.py",
"copies": "1",
"size": "2418",
"license": "mit",
"hash": 77128028462996720,
"line_mean": 26.4886363636,
"line_max": 186,
"alpha_frac": 0.6244830438,
"autogenerated": false,
"ratio": 2.7539863325740317,
"config_test": false,
"h... |
__all__ = ['splinequad']
import numpy as np
def splinequad(x):
"""Return the quadrature weights when a function is interpolated with cubic splines
The function retuns the values of the weights for a function that is evaluated in the locations x,
so that
int(f(x),x=a..b) = sum(w*f(x)), with x a partit... | {
"repo_name": "aasensio/pyiacsun",
"path": "pyiacsun/util/splinequad.py",
"copies": "1",
"size": "2002",
"license": "mit",
"hash": 7561980533589249000,
"line_mean": 26.0675675676,
"line_max": 129,
"alpha_frac": 0.507992008,
"autogenerated": false,
"ratio": 2.3608490566037736,
"config_test": fal... |
__all__ = ['splrep', 'splprep', 'splev', 'splint', 'sproot', 'spalde',
'bisplrep', 'bisplev', 'insert', 'splder', 'splantider']
import warnings
import numpy as np
# These are in the API for fitpack even if not used in fitpack.py itself.
from ._fitpack_impl import bisplrep, bisplev, dblint
from . import _f... | {
"repo_name": "WarrenWeckesser/scipy",
"path": "scipy/interpolate/fitpack.py",
"copies": "16",
"size": "26807",
"license": "bsd-3-clause",
"hash": -8576654773767334000,
"line_mean": 34.1336828309,
"line_max": 80,
"alpha_frac": 0.6148767113,
"autogenerated": false,
"ratio": 3.614264527436969,
"c... |
__all__ = ["sqlite_dump", "sqlite_merge"]
from random import Random
import math
def random_expectations(depth=0, breadth=3, low=1, high=10, random=Random()):
"""
Generate depth x breadth array of random numbers where each row sums to
high, with a minimum of low.
"""
result = []
if depth == 0:... | {
"repo_name": "greenape/risky-aging-model",
"path": "disclosuregame/Util/__init__.py",
"copies": "1",
"size": "3317",
"license": "mpl-2.0",
"hash": -4898991236380945000,
"line_mean": 27.8434782609,
"line_max": 180,
"alpha_frac": 0.5963219777,
"autogenerated": false,
"ratio": 3.4516129032258065,
... |
__all__ = ["sqlite_dump", "sqlite_merge"]
from random import Random
def random_expectations(depth=0, breadth=3, low=1, high=10, random=Random()):
"""
Generate depth x breadth array of random numbers where each row sums to
high, with a minimum of low.
"""
result = []
if depth == 0:
init... | {
"repo_name": "greenape/disclosure-game-module",
"path": "disclosuregame/Util/__init__.py",
"copies": "1",
"size": "2545",
"license": "mpl-2.0",
"hash": 1928217043758980000,
"line_mean": 32.4868421053,
"line_max": 179,
"alpha_frac": 0.6141453831,
"autogenerated": false,
"ratio": 3.288113695090439... |
"""All sql pragmas to generate the sqlite database."""
# Pragmas relating to adsorbates
PRAGMA_ADSORBATES = """
DROP TABLE IF EXISTS "adsorbates";
CREATE TABLE "adsorbates" (
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
`name` TEXT NOT NULL UNIQUE
... | {
"repo_name": "pauliacomi/pyGAPS",
"path": "src/pygaps/utilities/sqlite_db_pragmas.py",
"copies": "1",
"size": "4288",
"license": "mit",
"hash": -8629820648865162000,
"line_mean": 29.1971830986,
"line_max": 81,
"alpha_frac": 0.5583022388,
"autogenerated": false,
"ratio": 3.4720647773279354,
"co... |
# All square roots are periodic when written as continued fractions and can
# be written in the form:
# sqrt(N) = a0 + 1
# ------------------
# a1 + 1
# -------------
# a2 + 1
# --------
# ... | {
"repo_name": "cloudzfy/euler",
"path": "src/64.py",
"copies": "1",
"size": "3644",
"license": "mit",
"hash": 1198390766332313900,
"line_mean": 31.2477876106,
"line_max": 76,
"alpha_frac": 0.3240944018,
"autogenerated": false,
"ratio": 3.1742160278745644,
"config_test": false,
"has_no_keyword... |
__all__ = ['squash']
from operator import add, eq
def squash(predicate, list_):
"""Squash multiple consecutive list elements into one
For each sequence of elements, optionally interspersed with whitespace or
empty strings, for which the predicate returns True, leave the first
element in the sequenc... | {
"repo_name": "alco/numspell",
"path": "numspell/squash.py",
"copies": "1",
"size": "1668",
"license": "mit",
"hash": -960326404658227800,
"line_mean": 27.2711864407,
"line_max": 78,
"alpha_frac": 0.5959232614,
"autogenerated": false,
"ratio": 4.459893048128342,
"config_test": false,
"has_no_... |
__all__ = ['SSTable']
import os
import sys
import mmap
import time
import struct
from .index import Index
from .offset import Offset
class SSTable(object):
def __init__(self, table, t=None, rows=None):
self.table = table
if not t: t = '%.4f' % time.time()
self.t = t
self.opened = ... | {
"repo_name": "yadb/yadb",
"path": "backup/store/sstable.py",
"copies": "1",
"size": "5681",
"license": "mit",
"hash": 16020724616903260,
"line_mean": 24.9406392694,
"line_max": 72,
"alpha_frac": 0.5271959162,
"autogenerated": false,
"ratio": 3.6627981947130883,
"config_test": false,
"has_no_... |
__all__ = ['standardize_agent_name', 'standardize_db_refs', 'get_standard_name',
'standardize_name_db_refs', 'get_standard_agent']
import logging
from copy import deepcopy
from collections import defaultdict
from indra.statements.agent import default_ns_order, get_grounding, Agent
from indra.statements.vali... | {
"repo_name": "bgyori/indra",
"path": "indra/ontology/standardize.py",
"copies": "3",
"size": "8718",
"license": "bsd-2-clause",
"hash": 2306476647895578000,
"line_mean": 36.4163090129,
"line_max": 80,
"alpha_frac": 0.6425785731,
"autogenerated": false,
"ratio": 3.8422212428382547,
"config_test... |
__all__ = ['standardize_agent_name', 'standardize_db_refs', 'get_standard_name',
'standardize_name_db_refs']
import logging
from copy import deepcopy
from collections import defaultdict
from indra.statements.agent import default_ns_order, get_grounding
logger = logging.getLogger(__name__)
default_ns_prio... | {
"repo_name": "johnbachman/belpy",
"path": "indra/ontology/standardize.py",
"copies": "1",
"size": "7402",
"license": "mit",
"hash": 8135058347529703000,
"line_mean": 35.8258706468,
"line_max": 80,
"alpha_frac": 0.6465820049,
"autogenerated": false,
"ratio": 3.817431665807117,
"config_test": fa... |
"""AllStars URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | {
"repo_name": "belatrix/BackendAllStars",
"path": "AllStars/urls.py",
"copies": "1",
"size": "1433",
"license": "apache-2.0",
"hash": 8650061700512537000,
"line_mean": 46.7666666667,
"line_max": 82,
"alpha_frac": 0.7013258897,
"autogenerated": false,
"ratio": 3.6186868686868685,
"config_test": ... |
__all__ = ['StateChecker']
# FEATURES
# Allow overriding limits - CHECK
# Allow captcha or block not to be used - CHECK
# Allow overriding expiration times - CHECK
# Allow changing format of storage keys - CHECK
# Easy to use asynchronously (client should not need to wait for the throttling module before returning an ... | {
"repo_name": "sapo/securitylib-python",
"path": "securitylib/throttling/client.py",
"copies": "1",
"size": "4510",
"license": "mit",
"hash": -1359517365153365500,
"line_mean": 56.0886075949,
"line_max": 187,
"alpha_frac": 0.7019955654,
"autogenerated": false,
"ratio": 4.4831013916500995,
"conf... |
__all__ = ['statement_to_annotations']
from indra.assemblers.english import EnglishAssembler
from indra.databases import identifiers
from indra.statements.agent import get_grounding, default_ns_order
grounding_ns = default_ns_order + \
['NCIT', 'PUBCHEM', 'CHEMBL']
def statement_to_annotations(stmt, annotate_a... | {
"repo_name": "sorgerlab/indra",
"path": "indra/sources/hypothesis/annotator.py",
"copies": "3",
"size": "2404",
"license": "bsd-2-clause",
"hash": 6818856717971041000,
"line_mean": 34.3529411765,
"line_max": 74,
"alpha_frac": 0.578202995,
"autogenerated": false,
"ratio": 3.6646341463414633,
"c... |
__all__ = ['State']
from ..connection import MAVLinkMessage, MAVLinkConnection
from ...state import State as BaseState
from ...state import var
# These are the messages we should later listen to
IMPORTANT_MESSAGE_NAMES = [
'GLOBAL_POSITION_INT',
'ATTITUDE',
'VFR_HUD',
'SYS_STATUS',
'EKF_STATUS_REP... | {
"repo_name": "squaresLab/Houston",
"path": "houston/ardu/copter/state.py",
"copies": "1",
"size": "2409",
"license": "mit",
"hash": 3167014822209871400,
"line_mean": 39.15,
"line_max": 93,
"alpha_frac": 0.5873806559,
"autogenerated": false,
"ratio": 3.345833333333333,
"config_test": false,
"... |
__all__ = ['State']
from ...state import State as BaseState
from ...state import var
class State(BaseState):
home_latitude = var(float, lambda c: -35.362938) # TODO: fixed
home_longitude = var(float, lambda c: 149.165085) # TODO: fixed
altitude = var(float,
lambda c: c.connection.loc... | {
"repo_name": "squaresLab/Houston",
"path": "houston/ardu/rover/state.py",
"copies": "1",
"size": "1441",
"license": "mit",
"hash": 3697347207647927000,
"line_mean": 48.6896551724,
"line_max": 99,
"alpha_frac": 0.6426092991,
"autogenerated": false,
"ratio": 3.3126436781609194,
"config_test": fa... |
__all__ = ['State', 'var', 'Variable']
from typing import Dict, Any, Optional, Union, TypeVar, Generic, Type, \
Callable, FrozenSet, Iterator
import logging
import copy
import json
import math
import attr
from . import exceptions
from .connection import Message
logger = logging.getLogger(__name__) # type: logg... | {
"repo_name": "squaresLab/Houston",
"path": "houston/state.py",
"copies": "1",
"size": "8906",
"license": "mit",
"hash": -7561222528326115000,
"line_mean": 30.8071428571,
"line_max": 105,
"alpha_frac": 0.5488434763,
"autogenerated": false,
"ratio": 4.136553646075244,
"config_test": false,
"ha... |
# All steps for configuring an SPNG Backend server (except for the JAAS J2C Authentication entries which require a save and server restart to take effect)
import os
myServerName = os.environ["WAS_PROFILE_SERVER_NAME"]
myNodeName = os.environ["MY_WAS_NODE"]
myCellName = myNodeName+"Cell"
doneMarker = "#"
def createJD... | {
"repo_name": "millarde/wasadmin-automation",
"path": "ConfigureServer.py",
"copies": "1",
"size": "16418",
"license": "mit",
"hash": 1827793537246454300,
"line_mean": 52.4788273616,
"line_max": 187,
"alpha_frac": 0.6623827506,
"autogenerated": false,
"ratio": 3.5583008235804074,
"config_test":... |
__all__ = ['stmts_from_json', 'stmts_from_json_file', 'stmts_to_json',
'stmts_to_json_file', 'draw_stmt_graph', 'pretty_print_stmts',
'UnresolvedUuidError', 'InputError',
'set_pretty_print_max_width', 'print_stmt_summary']
import json
import logging
from collections import Counter
from... | {
"repo_name": "bgyori/indra",
"path": "indra/statements/io.py",
"copies": "3",
"size": "12526",
"license": "bsd-2-clause",
"hash": -4281784553078690000,
"line_mean": 34.4844192635,
"line_max": 80,
"alpha_frac": 0.6084144978,
"autogenerated": false,
"ratio": 3.9601644008852355,
"config_test": fa... |
__all__ = ['Store']
import os
import sys
import thread
import threading
from collections import defaultdict, deque
from .database import Database
from .transaction import Transaction
class Store(object):
def __init__(self, data_path=None):
self.data_path = data_path
self.opened = False
se... | {
"repo_name": "yadb/yadb",
"path": "backup/store/store.py",
"copies": "1",
"size": "1632",
"license": "mit",
"hash": 1701569158208975000,
"line_mean": 21.985915493,
"line_max": 57,
"alpha_frac": 0.568627451,
"autogenerated": false,
"ratio": 4.173913043478261,
"config_test": false,
"has_no_key... |
__all__ = ['string_converter', 'datetuple_converter', 'boolean_converter',
'file_converter','json_converter']
import csv
from cStringIO import StringIO
from datetime import date, datetime, time
from simplegeneric import generic
import schemaish
try:
import decimal
haveDecimal = True
except ImportEr... | {
"repo_name": "ish/convertish",
"path": "convertish/convert.py",
"copies": "1",
"size": "18069",
"license": "bsd-3-clause",
"hash": -279441433810245900,
"line_mean": 28.6699507389,
"line_max": 130,
"alpha_frac": 0.6055122032,
"autogenerated": false,
"ratio": 3.982587612960106,
"config_test": fa... |
# All strings in python are unicode strings
# create string
str1 = "string one"
str2 = 'string two'
print(str1, str2)
# ascii char
c1_m = 'm'
# octal
c2_m = '\155'
# hex
c3_m = '\x6D'
# unicode (python 3)
c4_m = '\N{LATIN SMALL LETTER M}'
print(c1_m, c2_m, c3_m, c4_m)
# join some words into a space separated sent... | {
"repo_name": "kevgraham7/toolbox",
"path": "python/samples/basics/strings_demo.py",
"copies": "1",
"size": "1144",
"license": "apache-2.0",
"hash": 6883313253021699000,
"line_mean": 23.8695652174,
"line_max": 84,
"alpha_frac": 0.652972028,
"autogenerated": false,
"ratio": 2.838709677419355,
"c... |
__all__ = ['strip_comments']
def strip_comments(contents):
"""Strips the comments from coq code in contents.
The strings in contents are only preserved if there are no
comment-like tokens inside of strings. Stripping should be
successful and correct, regardless of whether or not there are
comment... | {
"repo_name": "JasonGross/coq-tools",
"path": "strip_comments.py",
"copies": "1",
"size": "1434",
"license": "mit",
"hash": -3887989297886766000,
"line_mean": 38.8333333333,
"line_max": 125,
"alpha_frac": 0.5808926081,
"autogenerated": false,
"ratio": 4.1686046511627906,
"config_test": false,
... |
__all__ = ["StructureFile", "StructureFileData"]
from nbtlib import File, CompoundSchema, tag
class StructureFileData(CompoundSchema):
"""Schema that matches the Minecraft structure file format."""
class BlockState(CompoundSchema):
schema = {
"Name": tag.String,
"Properties"... | {
"repo_name": "vberlier/nbtlib",
"path": "nbtlib/contrib/minecraft/structure.py",
"copies": "1",
"size": "1383",
"license": "mit",
"hash": 1450197719683052000,
"line_mean": 25.5961538462,
"line_max": 85,
"alpha_frac": 0.5726681128,
"autogenerated": false,
"ratio": 3.928977272727273,
"config_tes... |
__all__ = ['SUB']
from .base import heads_precedence, ArithmeticHead
class SubHead(ArithmeticHead):
"""
SubHead represents subtraction n-ary operation where operands is
given as a n-tuple of expressions.
"""
op_mth = '__sub__'
op_rmth = '__rsub__'
def new(self, cls, operands, evaluate=Tr... | {
"repo_name": "pearu/sympycore",
"path": "sympycore/heads/sub.py",
"copies": "1",
"size": "1781",
"license": "bsd-3-clause",
"hash": 4989315778296697000,
"line_mean": 27.7258064516,
"line_max": 68,
"alpha_frac": 0.4862436833,
"autogenerated": false,
"ratio": 3.5197628458498023,
"config_test": f... |
__all__ = ['summarize', 'unite', 'subtract_bg']
import numbers
import os
import sys
import traceback
import ipy_table
import matplotlib
import matplotlib.cm
import matplotlib.colors
import matplotlib.pyplot as plt
import numpy as np
from IPython.core.getipython import get_ipython
from IPython.display import display
f... | {
"repo_name": "awacha/credolib",
"path": "credolib/procedures.py",
"copies": "1",
"size": "28890",
"license": "bsd-3-clause",
"hash": 34032802577506990,
"line_mean": 46.9900332226,
"line_max": 129,
"alpha_frac": 0.5670474213,
"autogenerated": false,
"ratio": 3.55656777052813,
"config_test": fal... |
__all__ = ['switch']
__version__ = '0.1'
class _case:
""" `_case` class realizes case statement in `switch`.
Is returned to context manager from `switch` class, and is used as
callable, or it's `default` method.
"""
def __init__(self, switch):
""" Initialize object
Arg... | {
"repo_name": "mysz/py-simpleswitch",
"path": "simpleswitch.py",
"copies": "2",
"size": "4376",
"license": "mit",
"hash": 5618020379700384000,
"line_mean": 34.008,
"line_max": 104,
"alpha_frac": 0.5804387569,
"autogenerated": false,
"ratio": 4.393574297188755,
"config_test": false,
"has_no_ke... |
all_symbols = {}
all_words = {}
# Stores file information
class FileStats(object):
def __init__(self, file_path):
self.symbols = {}
self.words = {}
self.file_path = file_path
self.analyze_content()
def analyze_content(self):
# count symbols in file content
fo... | {
"repo_name": "aistis-/symbol-counting",
"path": "FileStats.py",
"copies": "1",
"size": "2054",
"license": "mit",
"hash": -5794981211948427000,
"line_mean": 26.7702702703,
"line_max": 63,
"alpha_frac": 0.470788705,
"autogenerated": false,
"ratio": 4.149494949494949,
"config_test": false,
"has... |
__all__ = ["Synchronizer", "NameLock", "_threading", "_thread"]
import os
import sys
import tempfile
try:
import thread as _thread
import threading as _threading
except ImportError:
import dummy_thread as _thread
import dummy_threading as _threading
# check for fcntl module
try:
sys.getwindowsve... | {
"repo_name": "carlgao/lenga",
"path": "images/lenny64-peon/usr/share/python-support/python-beaker/beaker/synchronization.py",
"copies": "3",
"size": "11680",
"license": "mit",
"hash": -2791819739071680000,
"line_mean": 30.4824797844,
"line_max": 175,
"alpha_frac": 0.5886130137,
"autogenerated": fa... |
__all__ = ['System']
from typing import List, Dict, FrozenSet, Any, Type
import warnings
import logging
import bugzoo
from bugzoo.client import Client as BugZooClient
from .command import Command
from .configuration import Configuration
from .sandbox import Sandbox
from .state import Variable, State
logger = loggin... | {
"repo_name": "squaresLab/Houston",
"path": "houston/system.py",
"copies": "1",
"size": "4934",
"license": "mit",
"hash": -57739860505749840,
"line_mean": 37.2480620155,
"line_max": 104,
"alpha_frac": 0.5545196595,
"autogenerated": false,
"ratio": 4.347136563876652,
"config_test": true,
"has_... |
__all__ = ["TableDesc", "Row", "Table"]
class TableDesc(object):
__slots__ = ["__nameFromIdx", "__idxFromName", "__getitem__", "idxFromName"]
def __init__(self, *colNames):
self.__nameFromIdx = colNames
self.__idxFromName = {}
for n, name in enumerate(colNames):
assert isin... | {
"repo_name": "KMU-embedded/mosbench-ext",
"path": "mparts/table.py",
"copies": "1",
"size": "9105",
"license": "mit",
"hash": -6259416222173680000,
"line_mean": 31.8700361011,
"line_max": 80,
"alpha_frac": 0.5185063152,
"autogenerated": false,
"ratio": 4.097659765976598,
"config_test": false,
... |
__all__ = ['Table']
import os
import sys
from pprint import pprint
from collections import defaultdict
from .column import Column
from .schema import Schema
from .memtable import MemTable
from .sstable import SSTable
from .query import Query
from .deferred import Deferred
from .expr import Expr
class Table(object):
... | {
"repo_name": "yadb/yadb",
"path": "backup/store/table.py",
"copies": "1",
"size": "14645",
"license": "mit",
"hash": 2001666128140889900,
"line_mean": 29.7668067227,
"line_max": 77,
"alpha_frac": 0.3640150222,
"autogenerated": false,
"ratio": 4.392621475704859,
"config_test": false,
"has_no_... |
__all__ = ['Tag', 'DataTag', 'TreeTag', 'ExplicitTag',
'parse_rbml_data', 'load_tags']
class Tag:
def __init__(self, reader, _tag_map):
self.bin = reader.clone()
@classmethod
def read_len(klass, reader):
return read_vuint(reader)
@property
def tag_name(self):
re... | {
"repo_name": "arielb1/rtypes",
"path": "src/metadata/rbml.py",
"copies": "1",
"size": "4298",
"license": "mit",
"hash": 3707033288099061000,
"line_mean": 28.0405405405,
"line_max": 70,
"alpha_frac": 0.5635179153,
"autogenerated": false,
"ratio": 3.212257100149477,
"config_test": false,
"has_... |
__all__ = ['TAG_TUPLE_STRING_PARSERS']
import re
TAG_TUPLE_STRING_PARSERS = []
def pep440(tag_str):
"""
Parse tag_str in accordance with PEP440.
https://www.python.org/dev/peps/pep-0440/
"""
# Strip common non-numeric numbers from beginning of string
tag_str = tag_str.lstrip('v')
# Pul... | {
"repo_name": "logston/plottags",
"path": "plottags/tag_parsers.py",
"copies": "1",
"size": "1367",
"license": "bsd-3-clause",
"hash": -1763200939413015000,
"line_mean": 29.3777777778,
"line_max": 68,
"alpha_frac": 0.5369422092,
"autogenerated": false,
"ratio": 3.6164021164021163,
"config_test"... |
__all__ = ['Takeoff']
import time
import math
from pymavlink import mavutil
from ..connection import CommandLong
from ...configuration import Configuration
from ...state import State
from ...specification import Specification
from ...environment import Environment
from ...command import Parameter, Command
from ...sp... | {
"repo_name": "squaresLab/Houston",
"path": "houston/ardu/copter/takeoff.py",
"copies": "1",
"size": "1876",
"license": "mit",
"hash": 2622813509021494300,
"line_mean": 24.0133333333,
"line_max": 63,
"alpha_frac": 0.5751599147,
"autogenerated": false,
"ratio": 3.8840579710144927,
"config_test":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.