text stringlengths 0 1.05M | meta dict |
|---|---|
"""A little utility for manually patching in posts."""
import argparse
import codecs
import datetime
import errno
from glob import glob
import os
import pprint
import time
import subprocess
import sys
from rauth import OAuth1Session
import yaml
from models import Post
import tla
aid = os.environ['CIO_AID']
cio_requ... | {
"repo_name": "simon-weber/the-listserve-archive",
"path": "bootstrap.py",
"copies": "1",
"size": "4775",
"license": "mit",
"hash": 6065262873768246000,
"line_mean": 24.5347593583,
"line_max": 78,
"alpha_frac": 0.5832460733,
"autogenerated": false,
"ratio": 3.7072981366459627,
"config_test": fa... |
"""aliveim URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/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-bas... | {
"repo_name": "aliveim/aliveim",
"path": "aliveim/aliveim/urls.py",
"copies": "1",
"size": "1083",
"license": "mit",
"hash": 1181806000568783000,
"line_mean": 39.1111111111,
"line_max": 79,
"alpha_frac": 0.7109879963,
"autogenerated": false,
"ratio": 3.5742574257425743,
"config_test": false,
... |
"""A Live Parsed JSON Object"""
import os
import json
import pickle
import collections
from datetime import datetime
class LiveJSON(collections.MutableMapping):
"Live Parsed JSON Object"
def __init__(self, filepath, use_pickle=False, *args, **kwargs):
self.filepath = filepath
self.use_pickle ... | {
"repo_name": "bayangan1991/pinger",
"path": "livejson/__init__.py",
"copies": "1",
"size": "2210",
"license": "mit",
"hash": 7963780343008490000,
"line_mean": 28.0789473684,
"line_max": 74,
"alpha_frac": 0.5316742081,
"autogenerated": false,
"ratio": 4.138576779026217,
"config_test": false,
... |
"""A live poll for Twitch chat.
Votes are cast with hashtags, i.e. messages starting with the
pound-sign (#) and containing no spaces.
Example:
#thisisavote
"""
from __future__ import division
from pubsub import pub
import wx
import plugins
class Poll(object):
def __init__(self):
self.votes = ... | {
"repo_name": "ronald-d-rogers/twitchy",
"path": "plugins/poll.py",
"copies": "1",
"size": "3269",
"license": "bsd-2-clause",
"hash": -8789658703851810000,
"line_mean": 26.7033898305,
"line_max": 72,
"alpha_frac": 0.5747935148,
"autogenerated": false,
"ratio": 3.736,
"config_test": false,
"ha... |
"""A live word cloud for Twitch chat.
"""
from __future__ import division
from collections import deque
from pubsub import pub
import wx
import gui
import plugins
class Tail(object):
def __init__(self, length=100):
self._words = {}
self._tail = deque(maxlen=length)
self._length = length
... | {
"repo_name": "ronald-d-rogers/twitchy",
"path": "plugins/wordcloud.py",
"copies": "1",
"size": "5135",
"license": "bsd-2-clause",
"hash": 6952330343516529000,
"line_mean": 30.1212121212,
"line_max": 88,
"alpha_frac": 0.5199610516,
"autogenerated": false,
"ratio": 3.4256170780520345,
"config_te... |
# -- ==alkane== --
import mbuild as mb
from mbuild.lib.moieties import CH2
from mbuild.lib.moieties import CH3
class Alkane(mb.Compound):
"""An alkane which may optionally end with a hydrogen or a Port."""
def __init__(self, n=3, cap_front=True, cap_end=True):
"""Initialize an Alkane Compound.
... | {
"repo_name": "summeraz/mbuild",
"path": "mbuild/examples/alkane/alkane.py",
"copies": "4",
"size": "1577",
"license": "mit",
"hash": 4848906609465500000,
"line_mean": 33.3043478261,
"line_max": 97,
"alpha_frac": 0.5320228282,
"autogenerated": false,
"ratio": 3.5358744394618835,
"config_test": ... |
__all__ = ['abbrevs', 'states', 'mod_acttype_map', 'get_binding_site_name',
'get_mod_site_name']
from indra.statements import *
from indra.ontology.bio import bio_ontology
from .common import _n
abbrevs = {
'phosphorylation': 'phospho',
'ubiquitination': 'ub',
'farnesylation': 'farnesyl',
'h... | {
"repo_name": "johnbachman/belpy",
"path": "indra/assemblers/pysb/sites.py",
"copies": "1",
"size": "3029",
"license": "mit",
"hash": 4298471577382894000,
"line_mean": 31.5698924731,
"line_max": 75,
"alpha_frac": 0.6266094421,
"autogenerated": false,
"ratio": 2.940776699029126,
"config_test": f... |
__all__ = ['abbrevs', 'states', 'mod_acttype_map', 'get_binding_site_name',
'get_mod_site_name']
from indra.statements import *
from indra.tools.expand_families import _agent_from_uri
from indra.preassembler.hierarchy_manager import hierarchies
from .common import _n
abbrevs = {
'phosphorylation': 'phos... | {
"repo_name": "pvtodorov/indra",
"path": "indra/assemblers/pysb/sites.py",
"copies": "2",
"size": "3177",
"license": "bsd-2-clause",
"hash": 8254361075936285000,
"line_mean": 32.09375,
"line_max": 75,
"alpha_frac": 0.6307837583,
"autogenerated": false,
"ratio": 3.022835394862036,
"config_test":... |
# All abilities available
from ..champion.ability import AbilityRawDamage, \
AbilityOverTime, \
AbilityHeal
# Abilities for Ahri
ahri_q = AbilityRawDamage('Orb of Deception',
cooldown=0,
damage=10)
ahri_w = AbilityOverTime('Foxfire bite',
cooldown=3,
turns=3,
... | {
"repo_name": "JakeCowton/Pok-e-Lol",
"path": "environment/list_of_abilities.py",
"copies": "1",
"size": "1555",
"license": "mit",
"hash": 3593394670927041500,
"line_mean": 18.9487179487,
"line_max": 50,
"alpha_frac": 0.6167202572,
"autogenerated": false,
"ratio": 2.5617792421746293,
"config_te... |
""" All about Artificial star tests """
from __future__ import print_function
import argparse
import logging
import os
from astropy.io import fits
import re
import sys
import matplotlib.pylab as plt
import numpy as np
from scipy.interpolate import interp1d
from .. import astronomy_utils
logger = logging.getLogger(_... | {
"repo_name": "philrosenfield/ResolvedStellarPops",
"path": "galaxies/asts.py",
"copies": "1",
"size": "22715",
"license": "bsd-3-clause",
"hash": 3702728485513035000,
"line_mean": 35.4606741573,
"line_max": 99,
"alpha_frac": 0.5682588598,
"autogenerated": false,
"ratio": 3.646652753250923,
"co... |
#all about string
#create string
s1 = "" #empty string
s2 = "hello" #string hello
#create string using str
s1 = str() #same as ""
s2 = str("hello") #same as "hello"
'''
note
string are immutable
two or more string object having the same value are shares the same object
'''
#assign value to s1 ... | {
"repo_name": "yusufshakeel/Python-Project",
"path": "python3/string.py",
"copies": "1",
"size": "2513",
"license": "mit",
"hash": -8267142044450239000,
"line_mean": 24.13,
"line_max": 92,
"alpha_frac": 0.6358933546,
"autogenerated": false,
"ratio": 3.075887392900857,
"config_test": false,
"h... |
__all__ = ['AbstractCrudConf']
class AbstractCrudConf(object):
"""
This is the abstract crudconf your concrete CrudConf should inherit from.
A crudconf provides a common interface for the Crud views in order to provide
appropriate model instance url resolving in the template.
"""
model = None
... | {
"repo_name": "tonimichel/django-modelcrud",
"path": "modelcrud/abstract_crudconf.py",
"copies": "1",
"size": "3166",
"license": "mit",
"hash": 235525680066808450,
"line_mean": 29.4423076923,
"line_max": 81,
"alpha_frac": 0.5991787745,
"autogenerated": false,
"ratio": 4.465444287729196,
"config... |
__all__ = ["AbstractPointPen", "BasePointToSegmentPen", "PrintingPointPen",
"PrintingSegmentPen", "SegmentPrintingPointPen"]
class AbstractPointPen:
def beginPath(self):
"""Start a new sub path."""
raise NotImplementedError
def endPath(self):
"""End the current sub path."""
raise NotImplemented... | {
"repo_name": "anthrotype/robofab",
"path": "Lib/robofab/pens/pointPen.py",
"copies": "8",
"size": "5314",
"license": "bsd-3-clause",
"hash": 4199964024104252400,
"line_mean": 29.7167630058,
"line_max": 77,
"alpha_frac": 0.6989085435,
"autogenerated": false,
"ratio": 3.2461820403176542,
"config... |
__all__ = ['AbundanceFunction', 'add_scatter', 'rematch', 'LF_SCATTER_MULT']
import numpy as np
from scipy.optimize import curve_fit
try:
from fiducial_deconv_wrapper import fiducial_deconvolute
except (OSError, ImportError):
_has_fiducial_deconvolute = False
else:
_has_fiducial_deconvolute = True
LF_SCAT... | {
"repo_name": "manodeep/yymao-abundancematching",
"path": "AbundanceMatching/AbundanceFunction.py",
"copies": "1",
"size": "13873",
"license": "mit",
"hash": -7428556703561822000,
"line_mean": 33.2543209877,
"line_max": 86,
"alpha_frac": 0.548331291,
"autogenerated": false,
"ratio": 3.48743086978... |
__all__ = ['Account']
class Account(object):
"""The GoDaddyPy Account.
An account is used to provide authentication headers to the `godaddypy.Client`.
"""
_api_key = None
_api_secret = None
_SSO_KEY_TEMPLATE = 'sso-key {api_key}:{api_secret}'
def __init__(self, api_key, api_secret, dele... | {
"repo_name": "eXamadeus/godaddypy",
"path": "godaddypy/account.py",
"copies": "1",
"size": "1044",
"license": "bsd-3-clause",
"hash": -5470316910277671000,
"line_mean": 27.2162162162,
"line_max": 87,
"alpha_frac": 0.5632183908,
"autogenerated": false,
"ratio": 3.7689530685920576,
"config_test"... |
__all__ = ["acor", "function"]
import numpy as np
from . import _acor
def acor(data, maxlag=10):
"""
Estimate the autocorrelation time of a time series
Parameters
----------
data : numpy.ndarray (N,) or (M, N)
The time series.
maxlag : int, optional
N must be greater than m... | {
"repo_name": "dfm/acor",
"path": "acor/acor.py",
"copies": "1",
"size": "1288",
"license": "mit",
"hash": 986648358606522200,
"line_mean": 20.8305084746,
"line_max": 73,
"alpha_frac": 0.5900621118,
"autogenerated": false,
"ratio": 3.799410029498525,
"config_test": false,
"has_no_keywords": f... |
__all__ = ('Actions', 'LoggerInterface', 'RunCallback', 'FileCallback', 'Logger', 'DummyLoggerInterface')
#
# Interface: group of loggers which can attach multiple loggers.
#
class Actions(object):
Run = 'run'
Open = 'open'
Fork = 'fork'
class LoggerInterface(object):
"""
Base class for loggin... | {
"repo_name": "frjaraur/python-deployer",
"path": "deployer/loggers/__init__.py",
"copies": "2",
"size": "6064",
"license": "bsd-2-clause",
"hash": -7934930428111036,
"line_mean": 25.025751073,
"line_max": 123,
"alpha_frac": 0.517974934,
"autogenerated": false,
"ratio": 4.458823529411765,
"conf... |
__all__ = ["AdbImpl"]
import subprocess
import re
import time
from adb import Adb
from status import *
from base.thread_wrap import ExecuteGetResponse
from base.log import VLOG
class AdbImpl(Adb):
def GetDevices(self, devices):
devices[:] = []
p = subprocess.Popen(['adb', 'devices'], stdout=subprocess.... | {
"repo_name": "PeterWangIntel/crosswalk-webdriver-python",
"path": "browser/adb_impl.py",
"copies": "1",
"size": "4109",
"license": "bsd-3-clause",
"hash": 2553199780192740000,
"line_mean": 39.2843137255,
"line_max": 135,
"alpha_frac": 0.6383548309,
"autogenerated": false,
"ratio": 3.447147651006... |
__all__ = ['add_computed_fields']
from dynd._pydynd import as_py, as_numpy, w_type, \
w_array as array, make_cstruct, \
elwise_map, extract_dtype, type_of, \
dtype_of, ndim_of
class FieldExpr:
def __init__(self, dst_field_expr, src_field_names, fnname):
if f... | {
"repo_name": "aterrel/dynd-python",
"path": "dynd/nd/computed_fields.py",
"copies": "1",
"size": "7791",
"license": "bsd-2-clause",
"hash": 6055825227964152000,
"line_mean": 37.1911764706,
"line_max": 125,
"alpha_frac": 0.5603901938,
"autogenerated": false,
"ratio": 3.3888647237929534,
"config... |
__all__ = ['add', 'filter2d']
import numpy as N
import os
import ctypes
_path = os.path.dirname('__file__')
lib = N.ctypeslib.load_library('code', _path)
_typedict = {'zadd' : complex,
'sadd' : N.single,
'cadd' : N.csingle,
'dadd' : float}
for name in _typedict.keys():
val =... | {
"repo_name": "dagss/numpy_svn",
"path": "doc/numpybook/comparison/ctypes/interface.py",
"copies": "20",
"size": "1893",
"license": "bsd-3-clause",
"hash": 928509765542361700,
"line_mean": 32.2105263158,
"line_max": 78,
"alpha_frac": 0.5229793978,
"autogenerated": false,
"ratio": 3.47977941176470... |
__all__ = ["add_noise_to_image"]
from .. import utils
from ..core import ants_image as iio
def add_noise_to_image(image,
noise_model,
noise_parameters
):
"""
Add noise to an image using additive Guassian, salt-and-pepper,
shot, or speckle noise.
ANTsR fun... | {
"repo_name": "ANTsX/ANTsPy",
"path": "ants/utils/add_noise_to_image.py",
"copies": "1",
"size": "3211",
"license": "apache-2.0",
"hash": 7628047012011927000,
"line_mean": 35.908045977,
"line_max": 99,
"alpha_frac": 0.6206789162,
"autogenerated": false,
"ratio": 3.7555555555555555,
"config_test... |
__all__ = ['add_pressure_diffusion', 'cross1', 'cross2']
#runas import numpy as np; x = np.empty((3,2,5,7)); y = np.arange(210.).reshape(3,2,5,7); z = np.arange(210.).reshape(3,2,5,7) + 3; cross1(x,y,z)
#runas import numpy as np; x = np.empty((3,2,5,7), dtype=complex); y = np.arange(210.).reshape(3,2,5,7); z = np.aran... | {
"repo_name": "serge-sans-paille/pythran",
"path": "pythran/tests/cases/spectralDNS.py",
"copies": "1",
"size": "1762",
"license": "bsd-3-clause",
"hash": 7824285375542159000,
"line_mean": 55.8387096774,
"line_max": 331,
"alpha_frac": 0.5505107832,
"autogenerated": false,
"ratio": 2.2247474747474... |
__all__ = ['add_to']
import logging
import sys
from typing import Callable, Optional, Type, Union
from fastapi import APIRouter, FastAPI, __version__
from fastapi.routing import APIRoute
try:
from fastapi import Request, Response
except ImportError:
# Added in FastAPI v0.51.0
from starlette.requests impo... | {
"repo_name": "rollbar/pyrollbar",
"path": "rollbar/contrib/fastapi/routing.py",
"copies": "1",
"size": "3401",
"license": "mit",
"hash": 900334528420618600,
"line_mean": 29.6396396396,
"line_max": 90,
"alpha_frac": 0.6530432226,
"autogenerated": false,
"ratio": 4.073053892215569,
"config_test"... |
__all__ = ("AES",)
import os
import cryptography.hazmat.primitives.ciphers
import cryptography.hazmat.backends
_backend = cryptography.hazmat.backends.default_backend()
_aes = cryptography.hazmat.primitives.ciphers.algorithms.AES
_cipher = cryptography.hazmat.primitives.ciphers.Cipher
_ctrmode = cryptography.hazmat.p... | {
"repo_name": "ghackebeil/PyORAM",
"path": "src/pyoram/crypto/aes.py",
"copies": "1",
"size": "1732",
"license": "mit",
"hash": 7777166569445729000,
"line_mean": 35.0833333333,
"line_max": 84,
"alpha_frac": 0.6662817552,
"autogenerated": false,
"ratio": 3.6083333333333334,
"config_test": false,... |
__all__ = ['Agent', 'BoundCondition', 'MutCondition', 'ModCondition',
'ActivityCondition', 'default_ns_order']
import logging
from collections import OrderedDict as _o
from indra.statements.statements import modtype_conditions, modtype_to_modclass
from .concept import Concept
from .resources import get_val... | {
"repo_name": "johnbachman/indra",
"path": "indra/statements/agent.py",
"copies": "3",
"size": "27030",
"license": "bsd-2-clause",
"hash": -2287019643849780000,
"line_mean": 36.3858921162,
"line_max": 85,
"alpha_frac": 0.5722900481,
"autogenerated": false,
"ratio": 4.003258293838862,
"config_te... |
__all__ = ['AGENT', 'SUMMARY', 'CONTROLS', 'HELP', 'COMMENT_FILE',
'SUBMISSION_FILE', 'COMMENT_EDIT_FILE']
AGENT = """\
desktop:https://github.com/michael-lazar/rtv:{version}\
(by /u/civilization_phaze_3)\
"""
SUMMARY = """
Reddit Terminal Viewer is a lightweight browser for www.reddit.com built into a
ter... | {
"repo_name": "yskmt/rtv",
"path": "rtv/docs.py",
"copies": "1",
"size": "2401",
"license": "mit",
"hash": 8857363787128090000,
"line_mean": 31.0133333333,
"line_max": 79,
"alpha_frac": 0.6426488963,
"autogenerated": false,
"ratio": 3.67687595712098,
"config_test": false,
"has_no_keywords": f... |
__all__ = ("AggregateTestCaseSummarySchema", "TestCaseSummarySchema", "TestCaseSchema")
from collections import defaultdict
from marshmallow import Schema, fields, pre_dump
from sqlalchemy import and_
from sqlalchemy.orm import subqueryload_all
from typing import Dict, List, Optional
from uuid import UUID
from zeus.c... | {
"repo_name": "getsentry/zeus",
"path": "zeus/api/schemas/testcase.py",
"copies": "1",
"size": "8085",
"license": "apache-2.0",
"hash": 8716769067448475000,
"line_mean": 31.4698795181,
"line_max": 87,
"alpha_frac": 0.5573283859,
"autogenerated": false,
"ratio": 4.148281169830683,
"config_test":... |
ALL = 'all'
SHOW = 'show'
SHOW2 = '.show'
LEN = '_len'
def compute_allowed(table_dict):
master_list = set([])
for table in table_dict:
master_list = master_list.union(table.__table__.columns.keys())
for table in table_dict:
table_dict[table] = master_list.difference(table.__table__.columns... | {
"repo_name": "DataViva/dataviva-site",
"path": "dataviva/utils/table_helper.py",
"copies": "1",
"size": "1757",
"license": "mit",
"hash": -8428654086332442000,
"line_mean": 34.14,
"line_max": 82,
"alpha_frac": 0.6277746158,
"autogenerated": false,
"ratio": 3.878587196467991,
"config_test": fal... |
__all__ = ['all_warnings', 'expected_warnings']
from contextlib import contextmanager
import sys
import warnings
import inspect
import re
@contextmanager
def all_warnings():
"""
Context for use in testing to ensure that all warnings are raised.
Examples
--------
>>> import warnings
>>> def f... | {
"repo_name": "GaZ3ll3/scikit-image",
"path": "skimage/_shared/_warnings.py",
"copies": "23",
"size": "3850",
"license": "bsd-3-clause",
"hash": 2188224426416957700,
"line_mean": 32.4782608696,
"line_max": 84,
"alpha_frac": 0.6285714286,
"autogenerated": false,
"ratio": 4.4,
"config_test": fals... |
__all__ = ["AndroidDevice"]
from adb_impl import AdbImpl
from status import *
class AndroidDevice(object):
def __init__(self, device_serial="", adb=AdbImpl(), release_callback=None):
self.device_serial = device_serial
self.release_callback = release_callback
self.xdb = adb
self.active_package = ""
... | {
"repo_name": "PeterWangIntel/crosswalk-webdriver-python",
"path": "browser/android_device.py",
"copies": "1",
"size": "2164",
"license": "bsd-3-clause",
"hash": -1060172202398184200,
"line_mean": 33.3492063492,
"line_max": 95,
"alpha_frac": 0.6654343808,
"autogenerated": false,
"ratio": 3.809859... |
__all__ = ['AnonRef', 'InstRef', 'DefnRef', 'ArrayRef', 'TupleRef']
class Ref:
def __str__(self):
return self.qualifiedname()
class AnonRef(Ref):
def __init__(self, name=None):
self.name = name
def qualifiedname(self, sep='.'):
return str(self.name) if self.name else ""
def a... | {
"repo_name": "bjmnbraun/icestick_fastio",
"path": "thirdparty/magma/magma/ref.py",
"copies": "1",
"size": "1895",
"license": "mit",
"hash": -1925645271148641800,
"line_mean": 22.3950617284,
"line_max": 76,
"alpha_frac": 0.5488126649,
"autogenerated": false,
"ratio": 3.5822306238185253,
"config... |
__all__ = ['AnvLocalTransport']
import os
from stat import ST_MODE, S_ISDIR, ST_SIZE, S_IMODE
import sys
import errno
import shutil
import anvillib.acls
import anvillib.fs
from cStringIO import StringIO
from bzrlib import (
atomicfile,
osutils,
symbol_versioning,
config,
debug,
errors,
re... | {
"repo_name": "Etenil/anvil",
"path": "bzrplugins/anvserve/anvtransport.py",
"copies": "1",
"size": "21449",
"license": "mit",
"hash": 8216786460539486000,
"line_mean": 36.8289241623,
"line_max": 102,
"alpha_frac": 0.5628700639,
"autogenerated": false,
"ratio": 4.182722308892355,
"config_test":... |
__all__ = ['ApiFramework']
__API_LIST = {
'document':{
'get': 'Get document',
},
}
class ApiError(AttributeError):
def __init__(self, path):
self.message = "api has no attribute '%s'"%'.'.join(path)
self.args = (self.message,)
class ApiFramework(object):
def __init__... | {
"repo_name": "littlecodersh/EasierLife",
"path": "Plugins/ApiFramework/ApiFramework.py",
"copies": "1",
"size": "1128",
"license": "mit",
"hash": -7010296666285058000,
"line_mean": 31.1764705882,
"line_max": 75,
"alpha_frac": 0.5265957447,
"autogenerated": false,
"ratio": 3.6623376623376624,
"... |
__all__ = ['API']
from functools import wraps
import os
import flask
from flask import request, json
from . import predictors
from . import recommenders
models = (predictors, recommenders)
USERNAME = 'fickle'
def Response(data=None, status=200):
if data:
body = json.dumps(data)
else:
body... | {
"repo_name": "norbert/fickle",
"path": "fickle/api.py",
"copies": "1",
"size": "2866",
"license": "mit",
"hash": 4088026574043957000,
"line_mean": 24.8198198198,
"line_max": 75,
"alpha_frac": 0.5917655269,
"autogenerated": false,
"ratio": 4.094285714285714,
"config_test": false,
"has_no_keyw... |
"""All api routes regarding modules."""
from flask import g
from webargs.flaskparser import use_args
from server import user_bp
from server.extensions import db
from server.data.types import ModuleTypes
from server.responses import created, ok, bad_request
from server.schemas.module import ModuleSchema
from server.mo... | {
"repo_name": "Nukesor/spacesurvival",
"path": "server/api/module.py",
"copies": "1",
"size": "4764",
"license": "mit",
"hash": 1790522609631706000,
"line_mean": 31.6301369863,
"line_max": 82,
"alpha_frac": 0.6526028547,
"autogenerated": false,
"ratio": 3.6422018348623855,
"config_test": false,... |
__all__ = ('app', )
from flask import Flask
from web.config import config
from time import time, localtime, strftime
def delta_time(seconds):
seconds = int(seconds)
minutes = seconds // 60
hours = minutes // 60
minutes = minutes % 60
days = hours // 24
hours = hours % 24
seconds = seconds ... | {
"repo_name": "kivy/p4a-cloud",
"path": "master/web/__init__.py",
"copies": "1",
"size": "1057",
"license": "mit",
"hash": 706272996997654300,
"line_mean": 25.425,
"line_max": 67,
"alpha_frac": 0.5894039735,
"autogenerated": false,
"ratio": 3.3878205128205128,
"config_test": false,
"has_no_ke... |
__all__ = ('AppProgressBar', )
from kivy.properties import NumericProperty, AliasProperty
from kivy.uix.widget import Widget
from kivy.lang import Builder
Builder.load_string('''
<AppProgressBar>:
canvas:
Color:
rgb: 1, 1, 1
BorderImage:
border: (12, 12, 12, 12)
... | {
"repo_name": "Bakterija/mmplayer",
"path": "mmplayer/widgets/progressbar.py",
"copies": "1",
"size": "2536",
"license": "mit",
"hash": -3623676589573187000,
"line_mean": 27.8181818182,
"line_max": 102,
"alpha_frac": 0.5863564669,
"autogenerated": false,
"ratio": 3.8020989505247376,
"config_tes... |
__all__ = ["app", "version", "util", "module"]
from typing import Callable, List
class Wutu(object):
"""
an external API for Wutu Framework
"""
def __init__(self, index: str, ngmodules: List[str]=None, minify: bool=False) -> None:
from wutu import app
self.app = app.create(index=index... | {
"repo_name": "zaibacu/wutu",
"path": "wutu/__init__.py",
"copies": "1",
"size": "1769",
"license": "mit",
"hash": -913916092921930600,
"line_mean": 35.8541666667,
"line_max": 117,
"alpha_frac": 0.6088185415,
"autogenerated": false,
"ratio": 4.085450346420323,
"config_test": false,
"has_no_ke... |
__all__ = ('Argument', 'Integer', 'Bytes', 'Float', 'Boolean', 'String', )
# Parts of the following code are ported from the Twisted source:
# http://twistedmatrix.com/trac/browser/tags/releases/twisted-8.2.0/twisted/protocols/amp.py#L2042
class Argument:
"""
Base-class of all objects that take values from ... | {
"repo_name": "jonathanslenders/asyncio-amp",
"path": "asyncio_amp/arguments.py",
"copies": "1",
"size": "2085",
"license": "bsd-2-clause",
"hash": -7624163702071818000,
"line_mean": 23.8214285714,
"line_max": 98,
"alpha_frac": 0.6038369305,
"autogenerated": false,
"ratio": 4.072265625,
"config... |
__all__ = ["AskString"]
import objc
import Foundation
import AppKit
NSApp = AppKit.NSApp
# class defined in AskString.xib
class AskStringWindowController(AppKit.NSWindowController):
questionLabel = objc.IBOutlet()
textField = objc.IBOutlet()
def __new__(cls, question, resultCallback, default="", parentW... | {
"repo_name": "karstenw/nodebox-pyobjc",
"path": "nodebox/gui/mac/AskString.py",
"copies": "1",
"size": "1739",
"license": "mit",
"hash": -8494512516794226000,
"line_mean": 30.0535714286,
"line_max": 88,
"alpha_frac": 0.6515238643,
"autogenerated": false,
"ratio": 4.101415094339623,
"config_tes... |
__all__ = ['assert_nodes_equal', 'assert_edges_equal', 'assert_graphs_equal',
'almost_equal']
def almost_equal(x, y, places=7):
return round(abs(x - y), places) == 0
def assert_nodes_equal(nodes1, nodes2):
# Assumes iterables of nodes, or (node,datadict) tuples
nlist1 = list(nodes1)
nlist... | {
"repo_name": "sserrot/champion_relationships",
"path": "venv/Lib/site-packages/networkx/testing/utils.py",
"copies": "1",
"size": "1752",
"license": "mit",
"hash": -8667561843033779000,
"line_mean": 28.2,
"line_max": 77,
"alpha_frac": 0.5599315068,
"autogenerated": false,
"ratio": 3.095406360424... |
"""All assumptions are either loaded in this file or definied here
"""
from energy_demand.read_write import read_data
from energy_demand.technologies import tech_related
from energy_demand.basic import testing_functions, date_prop
from energy_demand.assumptions import fuel_shares
from energy_demand.initalisations impor... | {
"repo_name": "nismod/energy_demand",
"path": "energy_demand/assumptions/general_assumptions.py",
"copies": "1",
"size": "22215",
"license": "mit",
"hash": 1712889807449028600,
"line_mean": 39.6124314442,
"line_max": 194,
"alpha_frac": 0.5036236777,
"autogenerated": false,
"ratio": 4.091160220994... |
__all__ = ['AsyncPythonInterpreter']
try:
import fcntl
except:
fcntl = None
import os
import sys
import socket
from StringIO import StringIO
from netrepr import NetRepr, RemoteObjectPool, RemoteObjectReference
import objc
from Foundation import *
IMPORT_MODULES = ['netrepr', 'remote_console', 'remote_pipe', '... | {
"repo_name": "ariabuckles/pyobjc-core",
"path": "Examples/NonFunctional/RemotePyInterpreter/AsyncPythonInterpreter.py",
"copies": "2",
"size": "8660",
"license": "mit",
"hash": 3777736824029818400,
"line_mean": 36.4891774892,
"line_max": 161,
"alpha_frac": 0.6396073903,
"autogenerated": false,
"... |
__all__ = ['atleast_1d', 'atleast_2d', 'atleast_3d', 'block', 'hstack',
'stack', 'vstack']
import functools
import itertools
import operator
import warnings
from . import numeric as _nx
from . import overrides
from ._asarray import array, asanyarray
from .multiarray import normalize_axis_index
from . impor... | {
"repo_name": "mattip/numpy",
"path": "numpy/core/shape_base.py",
"copies": "2",
"size": "29014",
"license": "bsd-3-clause",
"hash": 2130534262759212000,
"line_mean": 31.2377777778,
"line_max": 81,
"alpha_frac": 0.5908526918,
"autogenerated": false,
"ratio": 3.7778645833333333,
"config_test": f... |
__all__ = ['atleast_1d','atleast_2d','atleast_3d','vstack','hstack',
'column_stack','row_stack', 'dstack','array_split','split','hsplit',
'vsplit','dsplit','apply_over_axes','expand_dims',
'apply_along_axis', 'kron', 'tile', 'get_array_wrap']
import numpy.core.numeric as _nx
from numpy... | {
"repo_name": "efiring/numpy-work",
"path": "numpy/lib/shape_base.py",
"copies": "2",
"size": "29979",
"license": "bsd-3-clause",
"hash": 5123676412467717000,
"line_mean": 26.7583333333,
"line_max": 80,
"alpha_frac": 0.5092564795,
"autogenerated": false,
"ratio": 3.3684269662921347,
"config_tes... |
__all__ = ['atleast_1d','atleast_2d','atleast_3d','vstack','hstack']
import numeric as _nx
from numeric import array, asanyarray, newaxis
def atleast_1d(*arys):
"""
Convert inputs to arrays with at least one dimension.
Scalar inputs are converted to 1-dimensional arrays, whilst
higher-dimensional inp... | {
"repo_name": "qsnake/numpy",
"path": "numpy/core/shape_base.py",
"copies": "1",
"size": "6306",
"license": "bsd-3-clause",
"hash": 1895051155962351900,
"line_mean": 23.3474903475,
"line_max": 77,
"alpha_frac": 0.5245797653,
"autogenerated": false,
"ratio": 3.4782129067843353,
"config_test": fa... |
__all__ = ['atleast_1d', 'atleast_2d', 'atleast_3d', 'vstack', 'hstack']
import numeric as _nx
from numeric import array, asanyarray, newaxis
def atleast_1d(*arys):
"""
Convert inputs to arrays with at least one dimension.
Scalar inputs are converted to 1-dimensional arrays, whilst
higher-dimensional... | {
"repo_name": "ArneBab/pypyjs",
"path": "website/demo/home/rfk/repos/pypy/lib_pypy/numpypy/core/shape_base.py",
"copies": "2",
"size": "6823",
"license": "mit",
"hash": 3433352907226032000,
"line_mean": 23.8109090909,
"line_max": 79,
"alpha_frac": 0.5205921149,
"autogenerated": false,
"ratio": 3.... |
__all__ = ['atleast_1d','atleast_2d','atleast_3d','vstack','hstack']
import numeric as _nx
from numeric import array, asarray, newaxis
def atleast_1d(*arys):
"""
Convert inputs to arrays with at least one dimension.
Scalar inputs are converted to 1-dimensional arrays, whilst
higher-dimensional inputs... | {
"repo_name": "chadnetzer/numpy-gaurdro",
"path": "numpy/core/shape_base.py",
"copies": "4",
"size": "6294",
"license": "bsd-3-clause",
"hash": -7742093100033969000,
"line_mean": 23.3011583012,
"line_max": 79,
"alpha_frac": 0.5241499841,
"autogenerated": false,
"ratio": 3.485049833887043,
"conf... |
import zipfile
import sys
import os
# Define the length of junk char (AAAAAAA...)
nm = "A"*7280
def shorten(sname, dname):
try:
source = zipfile.ZipFile(sname, 'r')
except:
print "[*] Can not file the source JAR file"
sys.exit(1)
target = zipfi... | {
"repo_name": "mertsarica/hack4career",
"path": "codes/allatori_zip_shortener.py",
"copies": "1",
"size": "1400",
"license": "apache-2.0",
"hash": 7461083032103459000,
"line_mean": 25.4150943396,
"line_max": 97,
"alpha_frac": 0.5342857143,
"autogenerated": false,
"ratio": 3.2634032634032635,
"c... |
__all__ = ['Attribute']
class Attribute:
def __init__(self,
name,
lookup_sequence,
*,
is_vector=False,
is_packed_array=False,
array_size=None):
"""
* name is the name of the input attribute in th... | {
"repo_name": "NeilGirdhar/glx",
"path": "glx/shader_program/attribute.py",
"copies": "1",
"size": "1985",
"license": "mit",
"hash": -1031232717883819100,
"line_mean": 42.152173913,
"line_max": 78,
"alpha_frac": 0.5853904282,
"autogenerated": false,
"ratio": 4.411111111111111,
"config_test": fa... |
__all__ = ['AttrWrapper']
from openmdao.units import PhysicalQuantity
class AttrWrapper(object):
"""A class that encapsulates a value and any metadata necessary
for validation of that value. For example, an AttrWrapper for
a Float object would include 'units' metadata to allow for unit
compatability... | {
"repo_name": "DailyActie/Surrogate-Model",
"path": "01-codes/OpenMDAO-Framework-dev/openmdao.main/src/openmdao/main/attrwrapper.py",
"copies": "1",
"size": "2692",
"license": "mit",
"hash": 6784085657674495000,
"line_mean": 29.9425287356,
"line_max": 113,
"alpha_frac": 0.6281575037,
"autogenerated... |
__all__ = ['auth']
__version__ = '0.1'
from flask_login import (LoginManager,
login_required,
login_user,
current_user,
login_fresh,
logout_user,
AnonymousUserMixin,
... | {
"repo_name": "matthewbaggett/Docker-Ubuntu-Desktop",
"path": "web/auth/__init__.py",
"copies": "12",
"size": "2939",
"license": "apache-2.0",
"hash": -3900741275679096300,
"line_mean": 23.6974789916,
"line_max": 62,
"alpha_frac": 0.5464443688,
"autogenerated": false,
"ratio": 4.204577968526467,
... |
"""Allauth overrides"""
from __future__ import absolute_import
import json
import logging
from allauth.account.adapter import DefaultAccountAdapter
from django.template.loader import render_to_string
from readthedocs.core.utils import send_email
try:
from django.utils.encoding import force_text
except ImportErr... | {
"repo_name": "pombredanne/readthedocs.org",
"path": "readthedocs/core/adapters.py",
"copies": "3",
"size": "1664",
"license": "mit",
"hash": 2204684073432813300,
"line_mean": 30.3962264151,
"line_max": 77,
"alpha_frac": 0.6334134615,
"autogenerated": false,
"ratio": 4.356020942408377,
"config_... |
"""Allauth overrides"""
import pickle
import logging
from allauth.account.adapter import DefaultAccountAdapter
from django.template.loader import render_to_string
from readthedocs.core.utils import send_email
try:
from django.utils.encoding import force_text
except ImportError:
from django.utils.encoding im... | {
"repo_name": "tddv/readthedocs.org",
"path": "readthedocs/core/adapters.py",
"copies": "1",
"size": "1609",
"license": "mit",
"hash": 1990845204553198800,
"line_mean": 29.9423076923,
"line_max": 77,
"alpha_frac": 0.6314481044,
"autogenerated": false,
"ratio": 4.384196185286103,
"config_test": ... |
__all__ = ('autoclass', 'ensureclass')
from jnius import (
JavaClass, MetaJavaClass, JavaMethod, JavaStaticMethod,
JavaField, JavaStaticField, JavaMultipleMethod, find_javaclass, cast
)
# Workaround for the new metaclass syntax in Python 3
ClassBase = MetaJavaClass('ClassBase', (JavaClass, ), {})
class Cla... | {
"repo_name": "physion/pyjnius",
"path": "jnius/reflect.py",
"copies": "1",
"size": "8896",
"license": "mit",
"hash": 2010027509502155000,
"line_mean": 35.6090534979,
"line_max": 102,
"alpha_frac": 0.6215152878,
"autogenerated": false,
"ratio": 3.739386296763346,
"config_test": false,
"has_no... |
__all__ = ('autoclass', 'ensureclass')
from jnius import (
JavaClass, MetaJavaClass, JavaMethod, JavaStaticMethod,
JavaField, JavaStaticField, JavaMultipleMethod, find_javaclass
)
class Class(JavaClass):
__metaclass__ = MetaJavaClass
__javaclass__ = 'java/lang/Class'
desiredAssertionStatus = Jav... | {
"repo_name": "aolihu/pyjnius",
"path": "jnius/reflect.py",
"copies": "5",
"size": "8262",
"license": "mit",
"hash": -5083033008726981000,
"line_mean": 36.2162162162,
"line_max": 102,
"alpha_frac": 0.6319293149,
"autogenerated": false,
"ratio": 3.708258527827648,
"config_test": false,
"has_no... |
# All available types:
# Body -> Body
# Decal -> Decal
# Wheel -> Wheels
# Boost -> Rocket Boost
# Antenna -> Antenna
# Topper -> Topper
# Trail -> Trail
# Goal Explosion -> Goal Explosion
# Paint Finish -> Paint Finish
# Engine Audio -> Engine Audio
# Unwanted:
# Crates
# Banner -> Player Banner
if __name__ == '__ma... | {
"repo_name": "drssoccer55/RLBot",
"path": "json_items_file_creator.py",
"copies": "1",
"size": "1431",
"license": "mit",
"hash": -7432100661885742000,
"line_mean": 29.4468085106,
"line_max": 107,
"alpha_frac": 0.464011181,
"autogenerated": false,
"ratio": 3.953038674033149,
"config_test": fals... |
__all__ = ['Backend']
from sklearn.cross_validation import train_test_split
from .storage import *
class Backend(object):
def __init__(self):
self._data = None
self._model = None
def load(self, dataset, write=False):
self._model = None
self._data = dataset['data']
s... | {
"repo_name": "norbert/fickle",
"path": "fickle/backend.py",
"copies": "1",
"size": "2100",
"license": "mit",
"hash": -5936361260683574000,
"line_mean": 25.25,
"line_max": 56,
"alpha_frac": 0.57,
"autogenerated": false,
"ratio": 4.030710172744722,
"config_test": false,
"has_no_keywords": fals... |
__all__ = ('backend', 'SearchableModel', 'SearchableManager')
from cgi import parse_qsl
from django.core import signals
from fts.backends.base import InvalidFtsBackendError
from fts.settings import *
# Name for use in settings file --> name of module in "backends" directory.
# Any backend scheme that is not... | {
"repo_name": "ryszard/django-fts",
"path": "fts/__init__.py",
"copies": "1",
"size": "1487",
"license": "bsd-3-clause",
"hash": 5837223137737742000,
"line_mean": 31.0444444444,
"line_max": 125,
"alpha_frac": 0.6065904506,
"autogenerated": false,
"ratio": 3.5831325301204817,
"config_test": fals... |
__all__ = ['BaseAgentSet', 'BaseAgent']
from pysb import Annotation
from indra.statements import *
from .common import _n
from .sites import states, get_binding_site_name, get_mod_site_name
class BaseAgentSet(object):
"""Container for a dict of BaseAgents with their names as keys."""
def __init__(self):
... | {
"repo_name": "sorgerlab/indra",
"path": "indra/assemblers/pysb/base_agents.py",
"copies": "6",
"size": "5540",
"license": "bsd-2-clause",
"hash": 6316065619784354000,
"line_mean": 36.1812080537,
"line_max": 79,
"alpha_frac": 0.5862815884,
"autogenerated": false,
"ratio": 4.1467065868263475,
"c... |
"""All Base Classes"""
import atexit
import logging
import os
import time
import sys
from signal import SIGTERM
LOG = logging.getLogger(__name__)
class BaseDaemon(object):
"""
A generic daemon class.
Usage: subclass the Daemon class and override the run() method
Refer: http://web.archive.org/web/20... | {
"repo_name": "KDBk/lan_sync_controller",
"path": "lan_sync_controller/base.py",
"copies": "2",
"size": "4295",
"license": "mit",
"hash": -3941883183801560600,
"line_mean": 26.1835443038,
"line_max": 75,
"alpha_frac": 0.5129220023,
"autogenerated": false,
"ratio": 4.094375595805529,
"config_tes... |
__all__ = ['BaseClassifier', 'load_classifier']
from io import BytesIO
from datetime import datetime
import logging
import pickle
import tarfile
import time
from uuid import uuid4
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.exceptions import NotFittedError
from ..utils import Timer
from ..ut... | {
"repo_name": "skylander86/ycml",
"path": "ycml/classifiers/base.py",
"copies": "1",
"size": "4155",
"license": "apache-2.0",
"hash": -6448527370637989000,
"line_mean": 30.0074626866,
"line_max": 174,
"alpha_frac": 0.6137184116,
"autogenerated": false,
"ratio": 3.8014638609332114,
"config_test"... |
__all__ = ['BaseConnector', 'TCPConnector', 'ProxyConnector', 'UnixConnector']
import asyncio
import aiohttp
import functools
import http.cookies
import time
import ssl
import socket
import weakref
from .client import ClientRequest
from .errors import ServerDisconnectedError
from .errors import HttpProxyError, ProxyC... | {
"repo_name": "saghul/aiohttp",
"path": "aiohttp/connector.py",
"copies": "1",
"size": "16267",
"license": "apache-2.0",
"hash": 4128179175477974500,
"line_mean": 33.9077253219,
"line_max": 79,
"alpha_frac": 0.554066515,
"autogenerated": false,
"ratio": 4.428804791723387,
"config_test": false,
... |
__all__ = ['BaseConnector', 'TCPConnector', 'UnixConnector',
'SocketConnector', 'UnixSocketConnector', 'ProxyConnector']
import asyncio
import aiohttp
import functools
import http.cookies
import time
import ssl
import socket
import weakref
from .errors import HttpProxyError
from .errors import ProxyConnect... | {
"repo_name": "jtackaberry/stagehand",
"path": "external/aiohttp/connector.py",
"copies": "1",
"size": "10888",
"license": "mit",
"hash": 6614208541410940000,
"line_mean": 32.9190031153,
"line_max": 79,
"alpha_frac": 0.537564291,
"autogenerated": false,
"ratio": 4.499173553719008,
"config_test"... |
__all__ = ['BaseConstructor', 'Constructor', 'ConstructorError']
from .error import MarkedError
from .nodes import * # NOQA
from .markedvalue import gen_marked_value
import collections
import types
from functools import wraps
try:
from __builtin__ import unicode
except ImportError:
unicode = str # NOQA
def m... | {
"repo_name": "keelerm84/powerline",
"path": "powerline/lint/markedjson/constructor.py",
"copies": "3",
"size": "7570",
"license": "mit",
"hash": 5039975007949271000,
"line_mean": 26.6277372263,
"line_max": 77,
"alpha_frac": 0.701321004,
"autogenerated": false,
"ratio": 3.2035548032162504,
"con... |
__all__ = ['BaseFeatClass', 'load_featclass']
from argparse import ArgumentParser
import logging
import numpy as np
from sklearn.base import BaseEstimator, ClassifierMixin
from ycsettings import Settings
from ..classifiers import load_classifier
from ..featurizers import load_featurizer
from uriutils import uri_o... | {
"repo_name": "skylander86/ycml",
"path": "ycml/featclass/base.py",
"copies": "1",
"size": "5494",
"license": "apache-2.0",
"hash": -1861338971105844500,
"line_mean": 35.6266666667,
"line_max": 151,
"alpha_frac": 0.6441572625,
"autogenerated": false,
"ratio": 3.6553559547571526,
"config_test": ... |
__all__ = ['BaseModel']
class BaseModel(object):
"""Subclasses of this class are fed into the :meth:`~cosmic.api.API.model`
decorator to attach models to an API. The API object doesn't care about
how you implement this class, it just copies the necessary properties and
leaves the class alone.
"""
... | {
"repo_name": "cosmic-api/cosmic.py",
"path": "cosmic/models.py",
"copies": "1",
"size": "3565",
"license": "mit",
"hash": 6862500211697329000,
"line_mean": 33.6116504854,
"line_max": 78,
"alpha_frac": 0.6084151473,
"autogenerated": false,
"ratio": 4.326456310679611,
"config_test": false,
"ha... |
# All basic usage of numpy
import numpy as np
# prints the version of numpy
print(np.__version__)
# Whether element is a numpy array
el = np.array(list())
# Below command resolves to true
if isinstance(el, np.ndarray):
print("Element is a numpy array.")
array1 = np.array([1, 2, 3, 4])
# It performs element wise o... | {
"repo_name": "pk-python/basics",
"path": "numpy/num_py.py",
"copies": "1",
"size": "3791",
"license": "mit",
"hash": -8492246197718143000,
"line_mean": 19.8351648352,
"line_max": 88,
"alpha_frac": 0.6027433395,
"autogenerated": false,
"ratio": 2.5614864864864866,
"config_test": false,
"has_n... |
""" All battle information in a turn.
"""
class BattleCard:
""" Information for a card in battle field.
"""
def __init__(self, card, free):
self._card = card
self._free = free
self.used = False
self.doubled = False
self.destroyed = False
def use(self, context):
... | {
"repo_name": "cwahbong/tgif-py",
"path": "tgif/battle_field.py",
"copies": "1",
"size": "2550",
"license": "mit",
"hash": 8338499693287279000,
"line_mean": 24.5,
"line_max": 81,
"alpha_frac": 0.5721568627,
"autogenerated": false,
"ratio": 3.8519637462235647,
"config_test": false,
"has_no_key... |
__all__ = ['BinaryLabelsClassifier', 'MultiLabelsClassifier', 'MulticlassLabelsClassifier', 'filter_labels']
import logging
import numpy as np
from sklearn.preprocessing import MultiLabelBinarizer
from .base import BaseClassifier
logger = logging.getLogger(__name__)
class LabelsClassifierMixin(BaseClassifier):
... | {
"repo_name": "skylander86/ycml",
"path": "ycml/classifiers/labels.py",
"copies": "1",
"size": "8486",
"license": "apache-2.0",
"hash": 2514642399568660500,
"line_mean": 37.0538116592,
"line_max": 148,
"alpha_frac": 0.6361065284,
"autogenerated": false,
"ratio": 3.4121431443506234,
"config_test... |
__all__ = ['binder', 'TOP', 'ANY_NAMESPACE', 'REMOVE_RULE',
'PY_REPLACE_PAT', 'RESERVED_NAMES']
import re
import sets
import keyword
import warnings
import cStringIO
import bisect
import xml.sax
from xml.dom import Node
from Ft.Xml import InputSource, Sax, SplitQName
from Ft.Xml import XML_NAMESPACE as XML_... | {
"repo_name": "AmericanResearchInstitute/poweru-server",
"path": "cmis_storage/amara/bindery.py",
"copies": "1",
"size": "46359",
"license": "bsd-3-clause",
"hash": -2548189449304707600,
"line_mean": 37.5682196339,
"line_max": 122,
"alpha_frac": 0.5741064303,
"autogenerated": false,
"ratio": 4.25... |
__all__ = ["Bind"]
from log import VLOG
from browser.status import *
""" Bind class accept 2 parameters: a callable function and a list where variable
parameters packed in.
there're 2 ways binding: you can use "Bind(func, [argument0, argument1, ...])"
as an early binding, also you can use "Bind(func)" as a dynamica... | {
"repo_name": "PeterWangIntel/crosswalk-webdriver-python",
"path": "base/bind.py",
"copies": "1",
"size": "1075",
"license": "bsd-3-clause",
"hash": 3209541880793187300,
"line_mean": 27.2894736842,
"line_max": 89,
"alpha_frac": 0.6855813953,
"autogenerated": false,
"ratio": 3.8392857142857144,
... |
__all__ = ['BioCCollection']
from meta import _MetaInfons, _MetaIter
from compat import _Py2Next
class BioCCollection(_Py2Next, _MetaInfons, _MetaIter):
def __init__(self, collection=None):
self.infons = dict()
self.source = ''
self.date = ''
self.key = ''
self.documents... | {
"repo_name": "SuLab/PyBioC",
"path": "src/bioc/bioc_collection.py",
"copies": "1",
"size": "1302",
"license": "bsd-2-clause",
"hash": -3348451241101115000,
"line_mean": 25.5714285714,
"line_max": 59,
"alpha_frac": 0.5637480799,
"autogenerated": false,
"ratio": 3.7413793103448274,
"config_test"... |
__all__ = ['BioCDocument']
from compat import _Py2Next
from meta import _MetaId, _MetaInfons, _MetaRelations, _MetaIter
class BioCDocument(_MetaId, _MetaInfons, _MetaRelations, _MetaIter,
_Py2Next):
def __init__(self, document=None):
self.id = ''
self.infons = dict()
s... | {
"repo_name": "telukir/PubMed2Go",
"path": "BioC_export/bioc/bioc_document.py",
"copies": "2",
"size": "1262",
"license": "isc",
"hash": 7176245181038424000,
"line_mean": 26.4347826087,
"line_max": 67,
"alpha_frac": 0.5649762282,
"autogenerated": false,
"ratio": 3.4575342465753423,
"config_test... |
__all__ = ['BioCDocument']
from compat import _Py2Next
from meta import _MetaId, _MetaInfons, _MetaRelations, _MetaIter
class BioCDocument(_MetaId, _MetaInfons, _MetaRelations, _MetaIter, _Py2Next):
def __init__(self, document=None):
self.id = ''
self.infons = dict()
self.relations = li... | {
"repo_name": "SuLab/PyBioC",
"path": "src/bioc/bioc_document.py",
"copies": "1",
"size": "1246",
"license": "bsd-2-clause",
"hash": 6741394778555290000,
"line_mean": 26.0869565217,
"line_max": 78,
"alpha_frac": 0.5722311396,
"autogenerated": false,
"ratio": 3.4043715846994536,
"config_test": f... |
__all__ = ['BioCPassage']
from meta import _MetaAnnotations, _MetaInfons, _MetaOffset, _MetaRelations, \
_MetaText
class BioCPassage(_MetaAnnotations, _MetaOffset, _MetaText, _MetaRelations,
_MetaInfons):
def __init__(self, passage=None):
self.offset = '-1'
self.text = ''
... | {
"repo_name": "SuLab/PyBioC",
"path": "src/bioc/bioc_passage.py",
"copies": "1",
"size": "1324",
"license": "bsd-2-clause",
"hash": 1403453558138028500,
"line_mean": 27.170212766,
"line_max": 78,
"alpha_frac": 0.5974320242,
"autogenerated": false,
"ratio": 4,
"config_test": false,
"has_no_key... |
__all__ = ['BioCPassage']
from meta import _MetaAnnotations, _MetaInfons, _MetaOffset, \
_MetaRelations, _MetaText
class BioCPassage(_MetaAnnotations, _MetaOffset, _MetaText,
_MetaRelations, _MetaInfons):
def __init__(self, passage=None):
self.offset = '-1'
... | {
"repo_name": "telukir/PubMedPortable",
"path": "BioC_export/bioc/bioc_passage.py",
"copies": "2",
"size": "1342",
"license": "isc",
"hash": 7842576895664286000,
"line_mean": 28.1739130435,
"line_max": 62,
"alpha_frac": 0.5894187779,
"autogenerated": false,
"ratio": 4.079027355623101,
"config_t... |
__all__ = ['BioCReader']
import StringIO
from lxml import etree
from bioc_annotation import BioCAnnotation
from bioc_collection import BioCCollection
from bioc_document import BioCDocument
from bioc_location import BioCLocation
from bioc_passage import BioCPassage
from bioc_sentence import BioCSentence
from bioc_nod... | {
"repo_name": "SuLab/PyBioC",
"path": "src/bioc/bioc_reader.py",
"copies": "1",
"size": "5830",
"license": "bsd-2-clause",
"hash": -1406121962696513500,
"line_mean": 38.6598639456,
"line_max": 79,
"alpha_frac": 0.6065180103,
"autogenerated": false,
"ratio": 4.042995839112344,
"config_test": fal... |
__all__ = ['BioCWriter']
from lxml.builder import E
from lxml.etree import tostring
class BioCWriter:
def __init__(self, filename=None, collection=None):
self.root_tree = None
self.collection = None
self.doctype = '''<?xml version='1.0' encoding='UTF-8'?>'''
self.doctype += '''... | {
"repo_name": "SuLab/PyBioC",
"path": "src/bioc/bioc_writer.py",
"copies": "1",
"size": "6551",
"license": "bsd-2-clause",
"hash": 1495877329484040700,
"line_mean": 38.4638554217,
"line_max": 77,
"alpha_frac": 0.5692260724,
"autogenerated": false,
"ratio": 4.107210031347963,
"config_test": fals... |
__all__ = ['Blackboard']
class Blackboard(object):
def __init__(self):
self._base_memory = {}
self._tree_memory = {}
def _get_tree_memory(self, tree_scope):
if (tree_scope not in self._tree_memory):
self._tree_memory[tree_scope] = {
'node_memory': {},
... | {
"repo_name": "renatopp/behavior3py",
"path": "b3/core/blackboard.py",
"copies": "2",
"size": "1231",
"license": "mit",
"hash": 6621854830400299000,
"line_mean": 28.3333333333,
"line_max": 66,
"alpha_frac": 0.5613322502,
"autogenerated": false,
"ratio": 3.6528189910979227,
"config_test": false,... |
"""All blast commands used by aTRAM."""
import glob
import json
import os
import re
import sys
from os.path import basename, dirname, join
from shutil import which
from . import util
def create_db(log, temp_dir, fasta_file, shard):
"""Create a blast database."""
cmd = 'makeblastdb -dbtype nucl -in {} -out {... | {
"repo_name": "juliema/aTRAM",
"path": "lib/blast.py",
"copies": "1",
"size": "8360",
"license": "bsd-3-clause",
"hash": 2570817105458704400,
"line_mean": 32.44,
"line_max": 80,
"alpha_frac": 0.5886363636,
"autogenerated": false,
"ratio": 3.5096557514693534,
"config_test": false,
"has_no_keyw... |
"""All blast commands used by aTRAM."""
import sys
import os
from os.path import basename, dirname, join
import re
import glob
import json
from shutil import which
from . import log
from . import util
def create_db(temp_dir, fasta_file, shard):
"""Create a blast database."""
cmd = 'makeblastdb -dbtype nucl -... | {
"repo_name": "AntonelliLab/seqcap_processor",
"path": "bin/aTRAM-master/lib/blast.py",
"copies": "1",
"size": "8019",
"license": "mit",
"hash": -9126472458638096000,
"line_mean": 31.5975609756,
"line_max": 78,
"alpha_frac": 0.5838633246,
"autogenerated": false,
"ratio": 3.554521276595745,
"con... |
__all__ = ['BlockingIOError', 'BrokenPipeError', 'ChildProcessError',
'ConnectionRefusedError', 'ConnectionResetError',
'InterruptedError', 'ConnectionAbortedError', 'PermissionError',
'FileNotFoundError',
]
import errno
import select
import socket
import sys
try:
import... | {
"repo_name": "overcastcloud/trollius",
"path": "trollius/py33_exceptions.py",
"copies": "1",
"size": "4083",
"license": "apache-2.0",
"hash": -1427602448648978000,
"line_mean": 27.3541666667,
"line_max": 82,
"alpha_frac": 0.6571148665,
"autogenerated": false,
"ratio": 4.046580773042616,
"confi... |
ALL = ['Block_Mapper']
class Block_Mapper:
"""
process data after receiving a block of records
"""
def __init__(self, blk_sz):
self.blk_sz = blk_sz
self.data = []
self.sz = 0
def __call__(self, records):
for row in records:
self.data.append(self.pars... | {
"repo_name": "chocjy/randomized-quantile-regression-solvers",
"path": "hadoop/src/utils.py",
"copies": "1",
"size": "1108",
"license": "apache-2.0",
"hash": -1643533356265847000,
"line_mean": 23.6222222222,
"line_max": 51,
"alpha_frac": 0.4864620939,
"autogenerated": false,
"ratio": 4.0586080586... |
__all__ = ('BlockStorageFile',)
import os
import struct
import logging
import errno
from multiprocessing.pool import ThreadPool
import pyoram
from pyoram.storage.block_storage import \
(BlockStorageInterface,
BlockStorageTypeFactory)
import tqdm
import six
from six.moves import xrange
log = logging.getLogg... | {
"repo_name": "ghackebeil/PyORAM",
"path": "src/pyoram/storage/block_storage_file.py",
"copies": "1",
"size": "12045",
"license": "mit",
"hash": 5361524853358815000,
"line_mean": 35.0628742515,
"line_max": 92,
"alpha_frac": 0.502864259,
"autogenerated": false,
"ratio": 4.43646408839779,
"config... |
__all__ = ('BlockStorageMMap',)
import logging
import mmap
from pyoram.storage.block_storage import \
BlockStorageTypeFactory
from pyoram.storage.block_storage_file import \
BlockStorageFile
log = logging.getLogger("pyoram")
class _BlockStorageMemoryImpl(object):
"""
This class implementents the Blo... | {
"repo_name": "ghackebeil/PyORAM",
"path": "src/pyoram/storage/block_storage_mmap.py",
"copies": "1",
"size": "4515",
"license": "mit",
"hash": 8462087366224320000,
"line_mean": 30.5734265734,
"line_max": 73,
"alpha_frac": 0.5530454042,
"autogenerated": false,
"ratio": 4.138405132905591,
"confi... |
__all__ = ('BlockStorageRAM',)
import os
import struct
import logging
import errno
from multiprocessing.pool import ThreadPool
import pyoram
from pyoram.storage.block_storage import \
(BlockStorageInterface,
BlockStorageTypeFactory)
from pyoram.storage.block_storage_mmap import \
(BlockStorageMMap,
... | {
"repo_name": "ghackebeil/PyORAM",
"path": "src/pyoram/storage/block_storage_ram.py",
"copies": "1",
"size": "11264",
"license": "mit",
"hash": 6271770415012598000,
"line_mean": 34.872611465,
"line_max": 80,
"alpha_frac": 0.5403941761,
"autogenerated": false,
"ratio": 4.484076433121019,
"config... |
__all__ = ('BlockStorageS3',)
import struct
import logging
from multiprocessing.pool import ThreadPool
import pyoram
from pyoram.storage.block_storage import \
(BlockStorageInterface,
BlockStorageTypeFactory)
from pyoram.storage.boto3_s3_wrapper import Boto3S3Wrapper
import tqdm
import six
from six.moves im... | {
"repo_name": "ghackebeil/PyORAM",
"path": "src/pyoram/storage/block_storage_s3.py",
"copies": "1",
"size": "15725",
"license": "mit",
"hash": -1852882947866466300,
"line_mean": 38.7095959596,
"line_max": 79,
"alpha_frac": 0.4992686804,
"autogenerated": false,
"ratio": 4.45846328324355,
"config... |
__all__ = ('BlockStorageSFTP',)
import logging
from pyoram.util.misc import chunkiter
from pyoram.storage.block_storage import \
BlockStorageTypeFactory
from pyoram.storage.block_storage_file import \
BlockStorageFile
log = logging.getLogger("pyoram")
class BlockStorageSFTP(BlockStorageFile):
"""
A... | {
"repo_name": "ghackebeil/PyORAM",
"path": "src/pyoram/storage/block_storage_sftp.py",
"copies": "1",
"size": "3598",
"license": "mit",
"hash": 5837934384441188000,
"line_mean": 27.5555555556,
"line_max": 70,
"alpha_frac": 0.5208449138,
"autogenerated": false,
"ratio": 4.531486146095718,
"confi... |
__all__ = ['BloomFilter']
class BitBloomFilter(object):
def __init__(self, m=1024, k=3):
self.m = m
self.k = k
self.items = [0] * m
def __repr__(self):
return '<BloomFilter {}>'.format(self.items)
def add(self, item):
h = hash(item)
for i in range(self.k):... | {
"repo_name": "mtasic85/bloomfilter",
"path": "bloomfilter.py",
"copies": "1",
"size": "1946",
"license": "mit",
"hash": 2475595161654776000,
"line_mean": 20.6222222222,
"line_max": 98,
"alpha_frac": 0.4398766701,
"autogenerated": false,
"ratio": 3.216528925619835,
"config_test": false,
"has_... |
ALL_BLUE_MOUNTAINS_SERVICES = range(9833, 9848)
INBOUND_BLUE_MOUNTAINS_SERVICES = (9833, 9835, 9838, 9840, 9841, 9843, 9844,
9847)
YELLOW_LINE_SERVICES = [9901, 9903, 9904, 9906, 9908, 9909, 9911, 9964, 9965,
9966, 9967, 9968, 9969, 9972, 9973, 9974]
# 9847 has... | {
"repo_name": "edwinsteele/visual-commute",
"path": "vcapp/transxchange_constants.py",
"copies": "1",
"size": "2327",
"license": "cc0-1.0",
"hash": -2825039874895789600,
"line_mean": 42.0925925926,
"line_max": 77,
"alpha_frac": 0.5376020627,
"autogenerated": false,
"ratio": 2.987163029525032,
"... |
__all__ = ['bootstrap']
def bootstrap():
"""
Define global blueprint tasks, load configured blueprints and apply role definitions.
"""
# Monkey patch fabric
from .patch import patch
patch('fabric.operations.run')
patch('fabric.operations.sudo', 'refabric.operations.run')
patch('fabric.... | {
"repo_name": "5monkeys/refabric",
"path": "refabric/bootstrap.py",
"copies": "1",
"size": "1667",
"license": "mit",
"hash": 6366768321733642000,
"line_mean": 31.6862745098,
"line_max": 96,
"alpha_frac": 0.6622675465,
"autogenerated": false,
"ratio": 3.8767441860465115,
"config_test": false,
... |
__all__ = ("Boto3S3Wrapper",
"MockBoto3S3Wrapper")
import os
import shutil
import pyoram
import tqdm
try:
import boto3
import botocore
boto3_available = True
except: # pragma: no cover
boto3_available = False # pragma... | {
"repo_name": "ghackebeil/PyORAM",
"path": "src/pyoram/storage/boto3_s3_wrapper.py",
"copies": "1",
"size": "5205",
"license": "mit",
"hash": -6646967624793897000,
"line_mean": 31.9430379747,
"line_max": 84,
"alpha_frac": 0.5266090298,
"autogenerated": false,
"ratio": 4.06640625,
"config_test":... |
__all__ = ('BottomBar')
from kivy.uix.boxlayout import BoxLayout
from kivy.core.window import Window
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.core.image import Image as CoreImage
from kivy.uix.image import Image
from kivy.graphics import *
from pocketthrone.managers.pipe import L
... | {
"repo_name": "herrschr/prey-game",
"path": "pocketthrone/widgets/bottombar.py",
"copies": "2",
"size": "2746",
"license": "bsd-2-clause",
"hash": -3761308482425136600,
"line_mean": 30.2045454545,
"line_max": 93,
"alpha_frac": 0.7479970867,
"autogenerated": false,
"ratio": 3.2154566744730677,
"... |
__all__ = ['BoxType', 'BoxDouble', 'BoxSingle']
class BoxType(object):
"""
A class containing the various line-drawing characters used in
drawing CP437 boxes.
"""
blank = ' '
horiz = ' '
vert = ' '
tl = ' '
bl = ' '
tr = ' '
br = ' '
scrollbar_top = ' '
scrollbar_bo... | {
"repo_name": "jtruscott/ld27",
"path": "pytality/boxtypes.py",
"copies": "1",
"size": "1119",
"license": "bsd-3-clause",
"hash": 4348662610289652000,
"line_mean": 20.1132075472,
"line_max": 66,
"alpha_frac": 0.5674709562,
"autogenerated": false,
"ratio": 2.8766066838046274,
"config_test": fals... |
__all__ = ['Buffer']
class Buffer:
'''
Buffer objects are OpenGL objects that store an array of unformatted memory
allocated by the OpenGL context, (data allocated on the GPU).
These can be used to store vertex data, pixel data retrieved from images
or the framebuffer, and a variet... | {
"repo_name": "cprogrammer1994/ModernGL",
"path": "moderngl/buffer.py",
"copies": "1",
"size": "8015",
"license": "mit",
"hash": 1761610567942753800,
"line_mean": 28.4669117647,
"line_max": 101,
"alpha_frac": 0.5312538989,
"autogenerated": false,
"ratio": 4.61162255466053,
"config_test": false,... |
__all__ = ['Bug']
from typing import List, Dict, Optional, Any, Tuple, Iterable
import os
import warnings
import logging
import attr
from .language import Language
from .test import TestSuite
from .coverage import CoverageInstructions
from ..compiler import Compiler
logger = logging.getLogger(__name__) # type: log... | {
"repo_name": "ChrisTimperley/AutomatedRepairBenchmarks.c",
"path": "bugzoo/core/bug.py",
"copies": "3",
"size": "3892",
"license": "mit",
"hash": -951123956188341600,
"line_mean": 35.7169811321,
"line_max": 105,
"alpha_frac": 0.576053443,
"autogenerated": false,
"ratio": 4.230434782608696,
"co... |
__all__ = ("BuildArtifactsResource",)
from sqlalchemy.orm import joinedload
from marshmallow import fields
from zeus.models import Artifact, Build, Job
from .base_build import BaseBuildResource
from ..schemas import ArtifactSchema, JobSchema
class _ArtifactWithJobSchema(ArtifactSchema):
job = fields.Nested(
... | {
"repo_name": "getsentry/zeus",
"path": "zeus/api/resources/build_artifacts.py",
"copies": "1",
"size": "1075",
"license": "apache-2.0",
"hash": -1080123855051662800,
"line_mean": 28.0540540541,
"line_max": 80,
"alpha_frac": 0.6334883721,
"autogenerated": false,
"ratio": 3.9814814814814814,
"co... |
__all__ = ('Buildign')
class Building:
# engine properties
_id = -1
name = ""
name_de = ""
size = "1x1"
# building type
_type = None
# possible building types & names
_types = ["wall", "tower", "blacksmith", "bordel", "stables", "harbor", "tunnels", "siege_workshop", "mansion", "market"]
_names = {
"wall"... | {
"repo_name": "herrschr/pocket-throne",
"path": "pocketthrone/entities/building.py",
"copies": "2",
"size": "2877",
"license": "bsd-2-clause",
"hash": -1064151283890396400,
"line_mean": 25.3944954128,
"line_max": 136,
"alpha_frac": 0.6548488008,
"autogenerated": false,
"ratio": 2.8626865671641792... |
__all__ = ['BuildInstructions']
from typing import Optional, Dict, Any
from pprint import pprint as pp
import warnings
import os
import shutil
import json
import attr
import docker
import yaml
def converter_args(args: Dict[str, Any]) -> Dict[str, str]:
return {k: str(v) for (k, v) in args.items()}
@attr.s(fro... | {
"repo_name": "ChrisTimperley/RepairBox",
"path": "bugzoo/core/build.py",
"copies": "2",
"size": "1888",
"license": "mit",
"hash": -727654362655577500,
"line_mean": 24.5135135135,
"line_max": 79,
"alpha_frac": 0.6525423729,
"autogenerated": false,
"ratio": 3.933333333333333,
"config_test": fals... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.