text stringlengths 0 1.05M | meta dict |
|---|---|
__all__ = ['process_file', 'process_files', 'process_from_web',
'process_sif_strs']
import requests
import logging
from .processor import SifProcessor
from .minerva_client import get_sif_filenames_to_ids, default_map_name
logger = logging.getLogger(__name__)
base_url = ('https://git-r3lab.uni.lu/covid/mode... | {
"repo_name": "bgyori/indra",
"path": "indra/sources/minerva/api.py",
"copies": "3",
"size": "3356",
"license": "bsd-2-clause",
"hash": 5369605590107938000,
"line_mean": 33.2448979592,
"line_max": 75,
"alpha_frac": 0.637067938,
"autogenerated": false,
"ratio": 3.5475687103594082,
"config_test":... |
__all__ = ['process_from_web', 'process_tsv', 'process_df']
import pandas
import logging
from .processor import VirhostnetProcessor
logger = logging.getLogger(__name__)
vhn_url = ('http://virhostnet.prabi.fr:9090/psicquic/webservices/current/'
'search/query/')
data_columns = [
'host_grounding', 'vi... | {
"repo_name": "bgyori/indra",
"path": "indra/sources/virhostnet/api.py",
"copies": "4",
"size": "2641",
"license": "bsd-2-clause",
"hash": 5441213230625490000,
"line_mean": 30.4404761905,
"line_max": 79,
"alpha_frac": 0.6535403256,
"autogenerated": false,
"ratio": 3.7836676217765044,
"config_te... |
__all__ = ['process_from_webservice']
import logging
import requests
from .processor import RlimspProcessor
logger = logging.getLogger(__name__)
RLIMSP_URL = 'https://research.bioinformatics.udel.edu/itextmine/api/data/rlims/'
class RLIMSP_Error(Exception):
pass
def process_from_webservice(id_val, id_type... | {
"repo_name": "sorgerlab/belpy",
"path": "indra/sources/rlimsp/api.py",
"copies": "1",
"size": "1639",
"license": "mit",
"hash": 7350573427751497000,
"line_mean": 27.7543859649,
"line_max": 81,
"alpha_frac": 0.6266015863,
"autogenerated": false,
"ratio": 3.4872340425531916,
"config_test": false... |
__all__ = ['process_from_webservice', 'process_from_json_file',
'process_from_jsonish_str']
import json
import logging
import requests
from .processor import RlimspProcessor
logger = logging.getLogger(__name__)
RLIMSP_URL = ('https://research.bioinformatics.udel.edu/itextmine/api/data/'
'... | {
"repo_name": "johnbachman/belpy",
"path": "indra/sources/rlimsp/api.py",
"copies": "4",
"size": "3956",
"license": "mit",
"hash": -247285457095936320,
"line_mean": 33.701754386,
"line_max": 94,
"alpha_frac": 0.6514155713,
"autogenerated": false,
"ratio": 3.5384615384615383,
"config_test": fals... |
__all__ = ['process_gene_gene', 'process_gene_gene_from_web',
'process_gene_disease', 'process_gene_disease_from_web',
'process_chemical_disease', 'process_chemical_disease_from_web',
'process_chemical_gene', 'process_chemical_gene_from_web',
'process_from_files', 'process_fr... | {
"repo_name": "sorgerlab/indra",
"path": "indra/sources/gnbr/api.py",
"copies": "1",
"size": "8167",
"license": "bsd-2-clause",
"hash": 3976432687185107000,
"line_mean": 31.64,
"line_max": 80,
"alpha_frac": 0.6254442946,
"autogenerated": false,
"ratio": 4.184102564102564,
"config_test": false,
... |
__all__ = ['process_jsonld_file', 'process_jsonld']
import json
import logging
from indra.sources.hume import processor
logger = logging.getLogger(__name__)
def process_jsonld_file(fname):
"""Process a JSON-LD file in the new format to extract Statements.
Parameters
----------
fname : str
T... | {
"repo_name": "johnbachman/belpy",
"path": "indra/sources/hume/api.py",
"copies": "1",
"size": "1161",
"license": "mit",
"hash": -4979411150592801000,
"line_mean": 24.2391304348,
"line_max": 75,
"alpha_frac": 0.6503014643,
"autogenerated": false,
"ratio": 3.935593220338983,
"config_test": false... |
__all__ = ['process_pc_neighborhood', 'process_pc_pathsbetween',
'process_pc_pathsfromto', 'process_owl', 'process_owl_str',
'process_model']
import itertools
from pybiopax import model_from_owl_file, model_from_owl_str, \
model_from_pc_query
from .processor import BiopaxProcessor
default_da... | {
"repo_name": "johnbachman/belpy",
"path": "indra/sources/biopax/api.py",
"copies": "1",
"size": "7641",
"license": "mit",
"hash": 8432073332287070000,
"line_mean": 35.5598086124,
"line_max": 79,
"alpha_frac": 0.6109148017,
"autogenerated": false,
"ratio": 4.02793885081708,
"config_test": false... |
__all__ = ['process_text', 'reground_texts']
import os
import tqdm
import math
import pickle
import logging
import requests
from indra.util import batch_iter
logger = logging.getLogger(__name__)
def process_text(text, webservice):
"""Process a given text with an Eidos webservice at the given address.
Note... | {
"repo_name": "johnbachman/belpy",
"path": "indra/sources/eidos/client.py",
"copies": "1",
"size": "4142",
"license": "mit",
"hash": -3191723436416305000,
"line_mean": 33.2314049587,
"line_max": 79,
"alpha_frac": 0.597054563,
"autogenerated": false,
"ratio": 4.005802707930368,
"config_test": fa... |
__all__ = ['prof4']
import pyfits as pf
import numpy as np
import matplotlib.pyplot as pl
import sys
import scipy.io
class prof4(object):
def __init__(self, fileIn):
self.currentFile = fileIn
self.readData()
self.currentPos = [0,0]
# Plot with integrated maps
self.figFixedMaps = pl.figure(num=1, figsize=(5... | {
"repo_name": "aasensio/pyAndres",
"path": "prof.py",
"copies": "2",
"size": "4198",
"license": "mit",
"hash": -8450813579192669000,
"line_mean": 30.328358209,
"line_max": 100,
"alpha_frac": 0.6669842782,
"autogenerated": false,
"ratio": 2.5473300970873787,
"config_test": false,
"has_no_keywo... |
__all__ = ["ProfilePlotter"]
from functools import reduce
import os
import pstats
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import numpy as np
class StatsCollection(object):
def __init__(self, directory, logger=None):
s... | {
"repo_name": "uc-cdis/cdis-python-utils",
"path": "cdispyutils/profiling/vis.py",
"copies": "1",
"size": "8290",
"license": "apache-2.0",
"hash": -849406242004646400,
"line_mean": 35.0434782609,
"line_max": 88,
"alpha_frac": 0.5394451146,
"autogenerated": false,
"ratio": 4.414270500532481,
"co... |
__all__ = ('Profile', 'ProfileNotFoundError')
import cbpos
from .driver import Driver
import os
class Profile(object):
def __init__(self, name, driver, host=None, port=None,
username=None, password=None, database=None,
query=None, drivername=None):
self.__config_name = No... | {
"repo_name": "coinbox/coinbox-core",
"path": "cbpos/database/profile.py",
"copies": "1",
"size": "4859",
"license": "mit",
"hash": -8748433789783561000,
"line_mean": 30.3483870968,
"line_max": 94,
"alpha_frac": 0.5392055979,
"autogenerated": false,
"ratio": 4.284832451499118,
"config_test": tr... |
__all__ = ['projected_correlation']
from itertools import izip
import math
import numpy as np
from scipy.integrate import quad
from fast3tree import fast3tree
def _yield_periodic_points(center, dcorner1, dcorner2, box_size):
cc = np.array(center)
flag = (cc+dcorner1 < 0).astype(int) - (cc+dcorner2 >= box_size)... | {
"repo_name": "manodeep/yymao-helpers",
"path": "helpers/CorrelationFunction.py",
"copies": "1",
"size": "6977",
"license": "mit",
"hash": 5775687129956282000,
"line_mean": 36.3101604278,
"line_max": 80,
"alpha_frac": 0.5599828006,
"autogenerated": false,
"ratio": 3.1329142343960483,
"config_te... |
__all__ = ['Project', 'Experiment', 'Result', 'Stat', 'Variation', 'Goal', 'Audience']
import json
import urllib
class ResourceGenerator(object):
def __init__(self, client=None, resource=None):
if client is None:
raise ValueError('Must specify client.')
if resource is None:
raise ValueError('Mu... | {
"repo_name": "experimentengine/optimizely-client-python",
"path": "optimizely_ee/resource.py",
"copies": "1",
"size": "7224",
"license": "mit",
"hash": 1953770068396645000,
"line_mean": 28.606557377,
"line_max": 100,
"alpha_frac": 0.5915005537,
"autogenerated": false,
"ratio": 4.035754189944134,... |
__all__ = ['Project', 'Experiment', 'Result', 'Variation', 'Goal', 'Audience']
import json
import urllib
class ResourceGenerator(object):
def __init__(self, client=None, resource=None):
if client is None:
raise ValueError('Must specify client.')
if resource is None:
raise... | {
"repo_name": "wlowry88/optimizely-client-python",
"path": "optimizely/resource.py",
"copies": "1",
"size": "7370",
"license": "mit",
"hash": -210580996431257100,
"line_mean": 29.0816326531,
"line_max": 104,
"alpha_frac": 0.5527815468,
"autogenerated": false,
"ratio": 4.332745443856555,
"config... |
__all__ = [ 'Property' ]
import numpy as np
import logging
import warnings
from .utilz import ut2s, s2ut, Ry, Rz, Ry_inv, Rz_inv
class Property( dict ):
"""
**An object representing properties as numpy.ndarray types mapped to by python dictionaries.**
**Supports up to quadrupoles, upper triangular polarizabili... | {
"repo_name": "fishstamp82/moltools",
"path": "moltools/property.py",
"copies": "1",
"size": "8912",
"license": "mit",
"hash": -1415738511435297300,
"line_mean": 31.2898550725,
"line_max": 116,
"alpha_frac": 0.4971947935,
"autogenerated": false,
"ratio": 3.182857142857143,
"config_test": false,... |
__all__ = ['ProtocolCommand']
class ProtocolCommand(object):
# protocol version 1.0
DEFAULT_PROTOCOL_VERSION_MAJOR = 1
DEFAULT_PROTOCOL_VERSION_MINOR = 0
# protocol message types
PROTOCOL_REQ = 0
PROTOCOL_RES = 1
def __init__(self, node, protocol_major_version, protocol_minor_version, pro... | {
"repo_name": "mtasic85/routingtable",
"path": "protocol_command.py",
"copies": "1",
"size": "1248",
"license": "mit",
"hash": -2311948075937197600,
"line_mean": 29.4390243902,
"line_max": 100,
"alpha_frac": 0.6642628205,
"autogenerated": false,
"ratio": 4.303448275862069,
"config_test": false,... |
__all__ = ["prox_rank1_box"]
from .prox_rank1_generic import prox_rank1_generic
import numpy as np
def prox_rank1_box(lwr, upr, *args, **kwargs):
"""
PROJ_RANK1_BOX returns the scaled proximity operator for box constraints
x = proj_rank1_box( lwr, upr, x0, D, u )
where
x = argmin_{x} h(x) + 1/2||x-x0||^2_{... | {
"repo_name": "aasensio/pyiacsun",
"path": "pyiacsun/sparse/proxes_rank1/prox_rank1_box.py",
"copies": "2",
"size": "1608",
"license": "mit",
"hash": -888966984019115600,
"line_mean": 33.2127659574,
"line_max": 81,
"alpha_frac": 0.6517412935,
"autogenerated": false,
"ratio": 2.5935483870967744,
... |
__all__ = ["prox_rank1_generic"]
import numpy as np
import sys
def prox_rank1_generic(prox, prox_brk_pts, x0, d, u = None, Lambda = None, linTerm = None, plusminus=1, invert = True, verbose = False):
"""
PROX_RANK1_GENERIC returns the scaled proximity operator for a generic function h
(provided the generic functio... | {
"repo_name": "aasensio/pyzeroSR1",
"path": "pyzeroSR1/proxes/prox_rank1_generic.py",
"copies": "1",
"size": "7494",
"license": "mit",
"hash": -8934869864429730000,
"line_mean": 29.7172131148,
"line_max": 139,
"alpha_frac": 0.5793968508,
"autogenerated": false,
"ratio": 2.4773553719008263,
"con... |
__all__ = ["prox_rank1_hinge"]
from .prox_rank1_generic import prox_rank1_generic
import numpy as np
def prox_rank1_hinge(*args, **kwargs):
"""
PROX_RANK1_HINGE returns the scaled proximity operator for the hinge loss
x = prox_rank1_hinge( x0, D, u )
where
x = argmin_{x} h(x) + 1/2||x-x0||^2_{V}
and
... | {
"repo_name": "aasensio/pyiacsun",
"path": "pyiacsun/sparse/proxes_rank1/prox_rank1_hinge.py",
"copies": "2",
"size": "1324",
"license": "mit",
"hash": 2633576023687026000,
"line_mean": 31.3170731707,
"line_max": 81,
"alpha_frac": 0.6344410876,
"autogenerated": false,
"ratio": 2.456400742115028,
... |
__all__ = ["prox_rank1_l0"]
from .prox_rank1_generic import prox_rank1_generic
import numpy as np
def hardThreshold(x,t):
xOut = x.copy()
xOut[x <= t] = 0.0
return xOut
def prox_rank1_l0(*args, **kwargs):
"""
PROX_RANK1_L0 returns the scaled proximity operator for the l0 norm
x = prox_rank1_l0( x0, D, u )
... | {
"repo_name": "aasensio/pyiacsun",
"path": "pyiacsun/sparse/proxes_rank1/prox_rank1_l0.py",
"copies": "2",
"size": "1147",
"license": "mit",
"hash": -5462837545350016000,
"line_mean": 27.7,
"line_max": 68,
"alpha_frac": 0.5902353967,
"autogenerated": false,
"ratio": 2.4249471458773786,
"config_... |
__all__ = ["prox_rank1_l1"]
from .prox_rank1_generic import prox_rank1_generic
import numpy as np
def prox_rank1_l1(*args, **kwargs):
"""
PROX_RANK1_L1 returns the scaled proximity operator for the l1 norm
x = prox_rank1_l1( x0, D, u )
where
x = argmin_{x} h(x) + 1/2||x-x0||^2_{V}
and
V^{-1} ... | {
"repo_name": "aasensio/pyiacsun",
"path": "pyiacsun/sparse/proxes_rank1/prox_rank1_l1.py",
"copies": "2",
"size": "1275",
"license": "mit",
"hash": 3621214863879252500,
"line_mean": 32.5789473684,
"line_max": 81,
"alpha_frac": 0.6109803922,
"autogenerated": false,
"ratio": 2.4661508704061896,
... |
__all__ = ["prox_rank1_l1pos"]
from .prox_rank1_generic import prox_rank1_generic
import numpy as np
def prox_rank1_l1pos(*args, **kwargs):
"""
PROX_RANK1_L1 returns the scaled proximity operator for the l1 norm
x = prox_rank1_l1pos( x0, D, u )
where
x = argmin_{x} h(x) + 1/2||x-x0||^2_{V}
and
... | {
"repo_name": "aasensio/pyzeroSR1",
"path": "pyzeroSR1/proxes/prox_rank1_l1pos.py",
"copies": "2",
"size": "1258",
"license": "mit",
"hash": 5389360363984818000,
"line_mean": 32.1315789474,
"line_max": 81,
"alpha_frac": 0.6160572337,
"autogenerated": false,
"ratio": 2.4812623274161734,
"config_... |
__all__ = ["prox_rank1_linf"]
from .prox_rank1_generic import prox_rank1_generic
import numpy as np
def prox_rank1_linf(*args, **kwargs):
"""
PROJ_RANK1_LINF returns the scaled proximity operator for l_infinity norm constraints
x = proj_rank1_linf( x0, D, u )
where
x = argmin_{x} h(x) + 1/2||x-x0||^2_{V}
... | {
"repo_name": "aasensio/pyzeroSR1",
"path": "pyzeroSR1/proxes/prox_rank1_linf.py",
"copies": "2",
"size": "1470",
"license": "mit",
"hash": -548712168179252860,
"line_mean": 33.2093023256,
"line_max": 86,
"alpha_frac": 0.6428571429,
"autogenerated": false,
"ratio": 2.5257731958762886,
"config_t... |
__all__ = ["prox_rank1_Rplus"]
from .prox_rank1_generic import prox_rank1_generic
import numpy as np
def prox_rank1_Rplus(*args, **kwargs):
"""
PROJ_RANK1_RPLUS returns the scaled proximity operator for non-negativity constraints
x = proj_rank1_Rplus( x0, D, u )
where
x = argmin_{x} h(x) + 1/2||x-x0||^2_{V... | {
"repo_name": "aasensio/pyiacsun",
"path": "pyiacsun/sparse/proxes_rank1/prox_rank1_Rplus.py",
"copies": "2",
"size": "1300",
"license": "mit",
"hash": -8607535249465865000,
"line_mean": 30.7317073171,
"line_max": 86,
"alpha_frac": 0.6407692308,
"autogenerated": false,
"ratio": 2.5390625,
"conf... |
__all__ = ['PublishSubscribeQueue']
import events
from util import priority
class PSPut(events.Operation):
__slots__ = ('queue', 'message', 'key')
def __init__(self, queue, message, key, **kws):
super(PSPut, self).__init__(**kws)
self.queue = queue
self.message = message
... | {
"repo_name": "pombredanne/cogen",
"path": "cogen/core/pubsub.py",
"copies": "4",
"size": "5046",
"license": "mit",
"hash": -5088642589033769000,
"line_mean": 33.7872340426,
"line_max": 78,
"alpha_frac": 0.5743162901,
"autogenerated": false,
"ratio": 4.09910641754671,
"config_test": false,
"h... |
__all__ = ['PureTransformer', 'identity']
import logging
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from ..utils import Timer
logger = logging.getLogger(__name__)
# Helper class. A transformer that only does transformation and does not need to fit any internal parameters.
class P... | {
"repo_name": "skylander86/ycml",
"path": "ycml/transformers/base.py",
"copies": "1",
"size": "1896",
"license": "apache-2.0",
"hash": -7926440608265588000,
"line_mean": 29.5806451613,
"line_max": 109,
"alpha_frac": 0.6265822785,
"autogenerated": false,
"ratio": 4.034042553191489,
"config_test"... |
"""All pykechain configuration constants will be listed here."""
#
# Configuration of async download of activity pdf exports
#
ASYNC_REFRESH_INTERVAL = 2 # seconds
ASYNC_TIMEOUT_LIMIT = 100 # seconds
#
# Configuration of the retry options for the client requests based on `urlib3.utils.Retry`.
#
# How many connectio... | {
"repo_name": "KE-works/pykechain",
"path": "pykechain/defaults.py",
"copies": "1",
"size": "11391",
"license": "apache-2.0",
"hash": -6533789744990129000,
"line_mean": 58.0103626943,
"line_max": 116,
"alpha_frac": 0.6396522961,
"autogenerated": false,
"ratio": 3.2577231121281462,
"config_test"... |
"""All pytest-django fixtures"""
from __future__ import with_statement
import os
import warnings
import pytest
from . import live_server_helper
from .db_reuse import (monkey_patch_creation_for_db_reuse,
monkey_patch_creation_for_db_suffix)
from .django_compat import is_django_unittest
from .l... | {
"repo_name": "tomviner/pytest-django",
"path": "pytest_django/fixtures.py",
"copies": "1",
"size": "12082",
"license": "bsd-3-clause",
"hash": 4425786446175451600,
"line_mean": 33.3238636364,
"line_max": 79,
"alpha_frac": 0.6482370468,
"autogenerated": false,
"ratio": 4.228911445572279,
"confi... |
"""All pytest-django fixtures"""
from __future__ import with_statement
import os
import pytest
from . import live_server_helper
from .django_compat import is_django_unittest
from .pytest_compat import getfixturevalue
from .lazy_django import get_django_version, skip_if_no_django
__all__ = ['django_db_setup', 'db... | {
"repo_name": "vicky2135/lucious",
"path": "oscar/lib/python2.7/site-packages/pytest_django/fixtures.py",
"copies": "1",
"size": "10509",
"license": "bsd-3-clause",
"hash": -1304098908836022500,
"line_mean": 29.8181818182,
"line_max": 85,
"alpha_frac": 0.6620039966,
"autogenerated": false,
"ratio... |
"""All pytest fixtures."""
import boto3
from collections import namedtuple
import os
import pytest
from shapely import wkt
import shutil
import uuid
import yaml
from mapchete.cli.default.serve import create_app
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
TESTDATA_DIR = os.path.join(SCRIPT_DIR, "testdata... | {
"repo_name": "ungarj/mapchete",
"path": "test/conftest.py",
"copies": "1",
"size": "14819",
"license": "mit",
"hash": 7750986273821854000,
"line_mean": 27.7189922481,
"line_max": 930,
"alpha_frac": 0.6940414333,
"autogenerated": false,
"ratio": 2.9834910408697404,
"config_test": true,
"has_n... |
__all__ = ['PythonCAPISubProgram']
import sys
from parser.api import TypeDecl, TypeStmt, Module
from wrapper_base import *
from py_wrap_type import *
class PythonCAPISubProgram(WrapperBase):
"""
Fortran subprogram hooks.
"""
header_template_f77 = '''\
#define %(name)s_f F_FUNC(%(name)s, %(NAME)s)
''... | {
"repo_name": "santisiri/popego",
"path": "envs/ALPHA-POPEGO/lib/python2.5/site-packages/numpy-1.0.4-py2.5-linux-x86_64.egg/numpy/f2py/lib/py_wrap_subprogram.py",
"copies": "1",
"size": "7933",
"license": "bsd-3-clause",
"hash": -5116902610030664000,
"line_mean": 36.7761904762,
"line_max": 114,
"alph... |
__all__ = ['PythonCAPIType', 'PyTypeInterface']
from wrapper_base import *
from parser.api import CHAR_BIT, Module, declaration_type_spec, \
TypeDecl, TypeStmt, Subroutine, Function, Integer, Real,\
DoublePrecision, Complex, DoubleComplex, Logical, Character, \
Byte
class PyTypeInterface:
def __in... | {
"repo_name": "santisiri/popego",
"path": "envs/ALPHA-POPEGO/lib/python2.5/site-packages/numpy-1.0.4-py2.5-linux-x86_64.egg/numpy/f2py/lib/py_wrap_type.py",
"copies": "1",
"size": "28411",
"license": "bsd-3-clause",
"hash": 3007326061185917400,
"line_mean": 36.7304116866,
"line_max": 157,
"alpha_frac... |
"""All Python code for Five Weird Python Tricks presentation."""
# 1
# Tuple Unpacking
tup = ('a', 'b', 'c')
a, b, c = tup
print(a)
print(b)
print(c)
# Should be called sequence unpacking
a, b, c = ['a', 'b', 'c']
print(a)
print(b)
print(c)
a, b, c = 'abc'
print(a)
print(b)
print(c)
# Useful in many situations... | {
"repo_name": "WillWeatherford/five-weird-python-tricks",
"path": "five_weird_python_tricks.py",
"copies": "1",
"size": "2995",
"license": "mit",
"hash": 2432657241896384500,
"line_mean": 15.3661202186,
"line_max": 64,
"alpha_frac": 0.6103505843,
"autogenerated": false,
"ratio": 2.690925426774483... |
__all__ = ['python_to_notebook', 'Notebook']
import json
import copy
import warnings
# Skeleton notebook in JSON format
skeleton_nb = """{
"metadata": {
"name":""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type":... | {
"repo_name": "bennlich/scikit-image",
"path": "doc/ext/notebook.py",
"copies": "44",
"size": "3042",
"license": "bsd-3-clause",
"hash": 8867192661948211000,
"line_mean": 23.1428571429,
"line_max": 76,
"alpha_frac": 0.4779750164,
"autogenerated": false,
"ratio": 3.945525291828794,
"config_test"... |
__all__ = ['PythonWrapperModule']
import re
import os
import sys
from parser.api import *
from wrapper_base import *
from py_wrap_type import *
from py_wrap_subprogram import *
class PythonWrapperModule(WrapperBase):
main_template = '''\
#ifdef __cplusplus
extern \"C\" {
#endif
#include "Python.h"
#define PY_A... | {
"repo_name": "santisiri/popego",
"path": "envs/ALPHA-POPEGO/lib/python2.5/site-packages/numpy-1.0.4-py2.5-linux-x86_64.egg/numpy/f2py/lib/py_wrap.py",
"copies": "1",
"size": "3347",
"license": "bsd-3-clause",
"hash": -8553142543168349000,
"line_mean": 25.1484375,
"line_max": 87,
"alpha_frac": 0.6038... |
__all__ = 'qkids_score'
from athlib import parse_hms, normalize_event_code, PAT_RUN
from typing import Union
def qkids_score(competition_type: str, event: str, perf: Union[str, int, float]) -> int:
competition_type = competition_type.replace(' ','').upper()
if competition_type in _compTypeMap:
competit... | {
"repo_name": "openath/athlib",
"path": "athlib/qkids_score.py",
"copies": "1",
"size": "2803",
"license": "apache-2.0",
"hash": 1763166600404240600,
"line_mean": 29.4673913043,
"line_max": 103,
"alpha_frac": 0.5073135926,
"autogenerated": false,
"ratio": 2.10119940029985,
"config_test": false,... |
__all__ = ['qList_to_pd_series', 'qtable_to_dataframe', 'qTempList_to_pd_tseries', 'get_q_status', 'convert_qdata']
from collections import OrderedDict
import pandas
import numpy
from qpython.qcollection import QTable, QKeyedTable, QDictionary, QList, QTemporalList
from qpython.qtype import qnull, QMONTH, QDATE, QDA... | {
"repo_name": "buckie/flask-kdb",
"path": "flask_kdb/utils.py",
"copies": "1",
"size": "6618",
"license": "mit",
"hash": -7368448609734003000,
"line_mean": 31.9303482587,
"line_max": 115,
"alpha_frac": 0.6287398005,
"autogenerated": false,
"ratio": 3.2173067574137093,
"config_test": false,
"h... |
__all__ = ("QueryFieldList",)
class QueryFieldList:
"""Object that handles combinations of .only() and .exclude() calls"""
ONLY = 1
EXCLUDE = 0
def __init__(
self, fields=None, value=ONLY, always_include=None, _only_called=False
):
"""The QueryFieldList builder
:param fi... | {
"repo_name": "MongoEngine/mongoengine",
"path": "mongoengine/queryset/field_list.py",
"copies": "1",
"size": "2964",
"license": "mit",
"hash": -4427907386710486500,
"line_mean": 32.6818181818,
"line_max": 82,
"alpha_frac": 0.5448717949,
"autogenerated": false,
"ratio": 3.9838709677419355,
"con... |
__all__ = ('QueryFieldList',)
class QueryFieldList(object):
"""Object that handles combinations of .only() and .exclude() calls"""
ONLY = 1
EXCLUDE = 0
def __init__(self, fields=None, value=ONLY, always_include=None, _only_called=False):
"""The QueryFieldList builder
:param fields: A... | {
"repo_name": "yarneo/mongoengine",
"path": "mongoengine/queryset/field_list.py",
"copies": "28",
"size": "2968",
"license": "mit",
"hash": 8796353404320243000,
"line_mean": 33.9176470588,
"line_max": 89,
"alpha_frac": 0.5485175202,
"autogenerated": false,
"ratio": 3.9785522788203753,
"config_t... |
__all__ = ['Query']
class Query:
'''
This class represents a Query object.
'''
__slots__ = ['mglo', 'crender', 'ctx', 'extra']
def __init__(self):
self.mglo = None #: Internal representation for debug purposes only.
self.crender = None #: ConditionalRender: Can be used in a... | {
"repo_name": "cprogrammer1994/ModernGL",
"path": "moderngl/query.py",
"copies": "1",
"size": "1152",
"license": "mit",
"hash": -4318670939890444000,
"line_mean": 22.04,
"line_max": 87,
"alpha_frac": 0.5373263889,
"autogenerated": false,
"ratio": 4.189090909090909,
"config_test": false,
"has_... |
__all__ = ['QueryResult', 'StatementQueryResult', 'AgentQueryResult']
from typing import Iterable as TypeIterable, Iterable, Union as TypeUnion
from indra.statements import stmts_from_json
class QueryResult(object):
"""The generic result of a query.
This class standardizes the results of queries to the rea... | {
"repo_name": "johnbachman/indra",
"path": "indra/sources/indra_db_rest/query_results.py",
"copies": "3",
"size": "9836",
"license": "bsd-2-clause",
"hash": 6001363268759823000,
"line_mean": 39.9833333333,
"line_max": 81,
"alpha_frac": 0.5905856039,
"autogenerated": false,
"ratio": 4.162505289885... |
__all__ = ['query']
from In.db.database_controller import *
#from In.db.database_model_wrapper import *
from In.db.db_engine_base import *
from In.db.query import *
@IN.register('sql', type = 'theme_format')
class SQL(In.themer.TEXT):
'''SQL Theme fotmat class
'''
@IN.register('DBException', ty... | {
"repo_name": "vinoth3v/In",
"path": "In/db/__init__.py",
"copies": "1",
"size": "2014",
"license": "apache-2.0",
"hash": -8627469080494509000,
"line_mean": 22.5609756098,
"line_max": 99,
"alpha_frac": 0.6569016882,
"autogenerated": false,
"ratio": 3.425170068027211,
"config_test": false,
"ha... |
__all__ = ['Query', 'Tag', 'And', 'Or', 'Not']
class Query(object):
"""
Taxon is queried by ``tuple`` objects that represent the syntax tree of the
query. These tuple queries can become unwieldy quickly, so the query DSL is
provided as the main way to query Taxon.
All subclasses of ``Query`` impl... | {
"repo_name": "jdp/taxon",
"path": "taxon/query.py",
"copies": "1",
"size": "1928",
"license": "mit",
"hash": 850787598349529200,
"line_mean": 25.4109589041,
"line_max": 85,
"alpha_frac": 0.5985477178,
"autogenerated": false,
"ratio": 3.9508196721311477,
"config_test": false,
"has_no_keywords... |
__all__ = ('Queue', 'PriorityQueue', 'LifoQueue', 'QueueFull', 'QueueEmpty')
import collections
import heapq
import warnings
from . import events
from . import locks
class QueueEmpty(Exception):
"""Raised when Queue.get_nowait() is called on an empty Queue."""
pass
class QueueFull(Exception):
"""Raise... | {
"repo_name": "batermj/algorithm-challenger",
"path": "code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Lib/asyncio/queues.py",
"copies": "10",
"size": "8223",
"license": "apache-2.0",
"hash": -3466556441225962000,
"line_mean": 32.0240963855,
"line_max": 79,
"alpha_frac"... |
__all__ = ('Queue', 'PriorityQueue', 'LifoQueue', 'QueueFull', 'QueueEmpty')
import collections
import heapq
from . import events
from . import locks
class QueueEmpty(Exception):
"""Raised when Queue.get_nowait() is called on an empty Queue."""
pass
class QueueFull(Exception):
"""Raised when the Queue... | {
"repo_name": "int19h/PTVS",
"path": "Python/Product/Miniconda/Miniconda3-x64/Lib/asyncio/queues.py",
"copies": "11",
"size": "8003",
"license": "apache-2.0",
"hash": -4651763129073597000,
"line_mean": 31.6653061224,
"line_max": 79,
"alpha_frac": 0.5730351118,
"autogenerated": false,
"ratio": 4.3... |
"""All queue-related views."""
from .forms import InquiryForm
from .forms import PromotionForm
from .logic import get_inquiry_for_asker
from .logic import maybe_promote_current_user
from .logic import update_context_with_queue_config
from flask import abort
from flask import Blueprint
from flask import g
from flask i... | {
"repo_name": "alvinwan/quuupod",
"path": "quupod/queue/views.py",
"copies": "2",
"size": "7189",
"license": "apache-2.0",
"hash": -3741760306865125400,
"line_mean": 33.0710900474,
"line_max": 79,
"alpha_frac": 0.6277646404,
"autogenerated": false,
"ratio": 3.6161971830985915,
"config_test": fa... |
"""All random generators for Terrain class."""
from terrain import Terrain
import random
import abc
import math
class TerrainGenerator(object):
"""Abstract noise generator that makes a Terrain with heights produced from noise."""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def __call__(self, *a... | {
"repo_name": "jackromo/RandTerrainPy",
"path": "randterrainpy/terraingen.py",
"copies": "1",
"size": "14157",
"license": "mit",
"hash": -2359723875979347500,
"line_mean": 38.9915254237,
"line_max": 119,
"alpha_frac": 0.6079677898,
"autogenerated": false,
"ratio": 3.8680327868852458,
"config_te... |
__all__ = ['ravel_multi_index',
'unravel_index',
'mgrid',
'ogrid',
'r_', 'c_', 's_',
'index_exp', 'ix_',
'ndenumerate','ndindex',
'fill_diagonal','diag_indices','diag_indices_from']
import sys
import numpy.core.numeric as _nx
from numpy.core.... | {
"repo_name": "dwf/numpy",
"path": "numpy/lib/index_tricks.py",
"copies": "2",
"size": "25566",
"license": "bsd-3-clause",
"hash": -593190225711470800,
"line_mean": 29.4719904648,
"line_max": 80,
"alpha_frac": 0.5335210827,
"autogenerated": false,
"ratio": 3.750880281690141,
"config_test": fals... |
__all__ = ['RawBot']
class RawBot(object):
'''Raw bot. This bot does not process the state.
Implement the following methods to use:
- start(state): called when the game starts.
- move(state): called when the game requests a move from this bot.
- end(): called after the game finishes.
Attribu... | {
"repo_name": "renatopp/vindinium-python",
"path": "vindinium/bots/raw_bot.py",
"copies": "1",
"size": "1071",
"license": "mit",
"hash": -5875034517699699000,
"line_mean": 23.3409090909,
"line_max": 70,
"alpha_frac": 0.5536881419,
"autogenerated": false,
"ratio": 4.25,
"config_test": false,
"... |
__all__ = ['read_array','write_array','read_header']
#from scipy.io import read_array,write_array
from scipy import shape,rank
import numpy
import scipy
import sys
class ArrayIOException(Exception):
def __init__(self,msg=''): self.msg = msg
def __str__(self): return self.msg
class FileFormatError(ArrayIOExc... | {
"repo_name": "wangregoon/pydec",
"path": "pydec/io/arrayio.py",
"copies": "6",
"size": "9348",
"license": "bsd-3-clause",
"hash": -3908098348429430000,
"line_mean": 31.1237113402,
"line_max": 136,
"alpha_frac": 0.5708172871,
"autogenerated": false,
"ratio": 3.937657961246841,
"config_test": fa... |
__all__ = ['readGadgetSnapshot', 'GadgetHeader']
import numpy as np
import struct
from collections import namedtuple
__GadgetHeader_fmt = '6I6dddii6Iiiddddii6Ii'
GadgetHeader = namedtuple('GadgetHeader', \
'npart mass time redshift flag_sfr flag_feedback npartTotal flag_cooling num_files BoxSize Omega0 Omega... | {
"repo_name": "drphilmarshall/Delaunay",
"path": "readGadgetSnapshot.py",
"copies": "1",
"size": "4211",
"license": "mit",
"hash": 2784907580651161000,
"line_mean": 35.6173913043,
"line_max": 173,
"alpha_frac": 0.5357397293,
"autogenerated": false,
"ratio": 3.6395851339671563,
"config_test": fa... |
__all__ = ('read_job', 'read_logs')
import subprocess
from os.path import dirname, join, realpath
from web.config import config, r
class QueryDict(dict):
# taken from kivy
def __getattr__(self, attr):
try:
return self.__getitem__(attr)
except KeyError:
try:
... | {
"repo_name": "kivy/p4a-cloud",
"path": "master/web/job.py",
"copies": "1",
"size": "2861",
"license": "mit",
"hash": 7344058314927456000,
"line_mean": 29.4361702128,
"line_max": 82,
"alpha_frac": 0.5354771059,
"autogenerated": false,
"ratio": 3.58072590738423,
"config_test": false,
"has_no_k... |
__all__ = ['read_mesh','write_mesh']
from pydec.mesh import simplicial_mesh
import pydec.io.arrayio
#from xml.dom.ext import PrettyPrint
from xml.dom import minidom
import os
class PyMeshException(Exception): pass
class PyMeshIOException(PyMeshException): pass
mesh_str_type_pairs = [('simplicial_mesh',simplicial... | {
"repo_name": "pkuwwt/pydec",
"path": "pydec/io/meshio.py",
"copies": "6",
"size": "2831",
"license": "bsd-3-clause",
"hash": -8700871506209128000,
"line_mean": 24.0530973451,
"line_max": 104,
"alpha_frac": 0.6287530908,
"autogenerated": false,
"ratio": 3.4356796116504853,
"config_test": false,... |
__all__ = [ "reconstruct" ]
import numpy as np
import _irtk
import image
from registration import RigidTransformation
def reconstruct( slice_list,
transformation_list,
stack_ids,
mask,
thickness,
iterations=1 ):
"""
No regis... | {
"repo_name": "BioMedIA/IRTK",
"path": "wrapping/cython/irtk/ext/reconstruction.py",
"copies": "5",
"size": "3174",
"license": "apache-2.0",
"hash": 6594072053911882000,
"line_mean": 35.4827586207,
"line_max": 90,
"alpha_frac": 0.470384373,
"autogenerated": false,
"ratio": 3.703617269544924,
"c... |
__all__ = ['ReferenceFrame', 'Vector', 'Dyadic', 'dynamicsymbols',
'MechanicsStrPrinter', 'MechanicsPrettyPrinter',
'MechanicsLatexPrinter']
from sympy import (Matrix, Symbol, sin, cos, eye, trigsimp, diff, sqrt, sympify,
expand, zeros, Derivative, Function, symbols, Add,
... | {
"repo_name": "ichuang/sympy",
"path": "sympy/physics/mechanics/essential.py",
"copies": "1",
"size": "68156",
"license": "bsd-3-clause",
"hash": -4581322892797499400,
"line_mean": 33.5093670886,
"line_max": 86,
"alpha_frac": 0.4827161218,
"autogenerated": false,
"ratio": 3.8412895226286423,
"c... |
__all__ = ['register', 'sharedPackages',
'reloadSharedPackage', 'reloadSharedPackages']
from panda3d.core import Filename, VirtualFileSystem, VirtualFileMountSystem, OFileStream, copyStream
from direct.stdpy.file import open
import sys
import marshal
import imp
import types
# The sharedPackages dictionary ... | {
"repo_name": "grimfang/panda3d",
"path": "direct/src/showbase/VFSImporter.py",
"copies": "10",
"size": "19654",
"license": "bsd-3-clause",
"hash": 5164668734121830000,
"line_mean": 35.8742964353,
"line_max": 121,
"alpha_frac": 0.5729113666,
"autogenerated": false,
"ratio": 4.270751847023034,
"... |
__all__ = ['register', 'sharedPackages',
'reloadSharedPackage', 'reloadSharedPackages']
from panda3d._core import Filename, VirtualFileSystem, VirtualFileMountSystem, OFileStream, copyStream
import sys
import marshal
import imp
import types
import __builtin__
# The sharedPackages dictionary lists all of th... | {
"repo_name": "Wilee999/panda3d",
"path": "direct/src/showbase/VFSImporter.py",
"copies": "1",
"size": "19746",
"license": "bsd-3-clause",
"hash": -5230235690328038000,
"line_mean": 35.8395522388,
"line_max": 121,
"alpha_frac": 0.5723184442,
"autogenerated": false,
"ratio": 4.27125243348475,
"c... |
__all__ = ['register', 'sharedPackages',
'reloadSharedPackage', 'reloadSharedPackages']
from panda3d.core import Filename, VirtualFileSystem, VirtualFileMountSystem, OFileStream, copyStream
import sys
import marshal
import imp
import types
import __builtin__
# The sharedPackages dictionary lists all of the... | {
"repo_name": "sctigercat1/panda3d",
"path": "direct/src/showbase/VFSImporter.py",
"copies": "3",
"size": "19101",
"license": "bsd-3-clause",
"hash": 2246397522527933000,
"line_mean": 35.3828571429,
"line_max": 121,
"alpha_frac": 0.5791843359,
"autogenerated": false,
"ratio": 4.308820212046019,
... |
__all__ = ["RegistMixin"]
import peewee
class RegistMixin:
"""将module注册到类内部,以便统一初始化
"""
_regist_classes = {}
@classmethod
def regist(clz, target):
"""注册module的装饰器,也可以当作方法注册多对多关系表,如
NoteUserThrough = User.roles.get_through_model()
AioOrm.regist(NoteUserThrough)
"""
... | {
"repo_name": "Sanic-Extensions/sanic-aioorm",
"path": "sanic_aioorm/regist_mixin.py",
"copies": "1",
"size": "1983",
"license": "mit",
"hash": -2546417015517599000,
"line_mean": 35.66,
"line_max": 81,
"alpha_frac": 0.4637206765,
"autogenerated": false,
"ratio": 3.875264270613108,
"config_test"... |
__all__ = ['registry_status']
import gevent.monkey
gevent.monkey.patch_all()
import cache
import config
import gevent
import socket
import storage
import sys
import toolkit
from .app import app
_config = config.load()
def redis_status():
message = ''
if not cache.redis_conn:
cache.init()
if no... | {
"repo_name": "alephcloud/docker-registry",
"path": "registry/status.py",
"copies": "9",
"size": "1910",
"license": "apache-2.0",
"hash": 1936035347766647000,
"line_mean": 26.6811594203,
"line_max": 72,
"alpha_frac": 0.6041884817,
"autogenerated": false,
"ratio": 3.7896825396825395,
"config_tes... |
__all__ = ['regular_cube_complex']
from scipy import rank,ones
import scipy
from pydec.mesh import regular_cube_mesh
from cube_array import cube_array_boundary
class regular_cube_complex(list):
"""
Represents the complex for a regular_cube_mesh
"""
class complex_data:
pass
def __init__(s... | {
"repo_name": "ryanbressler/pydec",
"path": "pydec/dec/regular_cube_complex.py",
"copies": "6",
"size": "2018",
"license": "bsd-3-clause",
"hash": 5863661431437727000,
"line_mean": 29.5757575758,
"line_max": 96,
"alpha_frac": 0.5887016848,
"autogenerated": false,
"ratio": 3.6035714285714286,
"c... |
__all__ = ['regular_cube_mesh']
from numpy import array,asarray,hstack,vstack,arange,zeros,rank
class regular_cube_mesh:
"""
A regular grid of hypercubes.
Examples:
# create a 2x2 cube mesh
bitmap = ones((2,2),dtype='bool')
c_mesh = regular_cube_mesh(bitmap)
# creates ... | {
"repo_name": "ryanbressler/pydec",
"path": "pydec/mesh/regular_cube.py",
"copies": "6",
"size": "1141",
"license": "bsd-3-clause",
"hash": 8556890794243786000,
"line_mean": 27.525,
"line_max": 137,
"alpha_frac": 0.6029798422,
"autogenerated": false,
"ratio": 3.5,
"config_test": false,
"has_n... |
__all__ = ['relative_parity','permutation_parity']
def relative_parity(A,B):
"""Relative parity between two lists
Parameters
----------
A,B : lists of elements
Lists A and B must contain permutations of the same elements.
Returns
-------
parity : integer
... | {
"repo_name": "alejospina/pydec",
"path": "pydec/math/parity.py",
"copies": "6",
"size": "2696",
"license": "bsd-3-clause",
"hash": 68631156158771000,
"line_mean": 23.2882882883,
"line_max": 82,
"alpha_frac": 0.5278189911,
"autogenerated": false,
"ratio": 3.6830601092896176,
"config_test": fals... |
__all__ = ['remove_file', 'remove_files', 'zip_files']
import os
import glob
import zipfile
try:
import zlib
except:
DEFAULT_ZIP_MODE = zipfile.ZIP_STORED
else:
DEFAULT_ZIP_MODE = zipfile.ZIP_DEFLATED
def merge_files(dst, src_glob, nbytes=1 << 30):
"""Merge src files to dst. Only works on Linux.
... | {
"repo_name": "hans-t/autos",
"path": "autos/utils/file.py",
"copies": "1",
"size": "1522",
"license": "mit",
"hash": 7451298041347843000,
"line_mean": 23.9508196721,
"line_max": 87,
"alpha_frac": 0.6195795007,
"autogenerated": false,
"ratio": 3.412556053811659,
"config_test": false,
"has_no_... |
__all__ = ['Renderbuffer']
class Renderbuffer:
'''
Renderbuffer objects are OpenGL objects that contain images.
They are created and used specifically with :py:class:`Framebuffer` objects.
They are optimized for use as render targets, while :py:class:`Texture` objects
may not be, a... | {
"repo_name": "cprogrammer1994/ModernGL",
"path": "moderngl/renderbuffer.py",
"copies": "1",
"size": "2797",
"license": "mit",
"hash": 1671528627484556000,
"line_mean": 24.8981481481,
"line_max": 104,
"alpha_frac": 0.5563103325,
"autogenerated": false,
"ratio": 4.43968253968254,
"config_test": ... |
__all__ = [ "render" ]
import vtk
import numpy as np
import sys
from scipy.stats.mstats import mquantiles
import scipy.interpolate
from vtk.util.vtkConstants import *
import matplotlib.pyplot as plt
def numpy2VTK(img,spacing=[1.0,1.0,1.0]):
# evolved from code from Stou S.,
# on http://www.siafoo.net/snipp... | {
"repo_name": "ghisvail/irtk-legacy",
"path": "wrapping/cython/irtk/ext/Show3D.py",
"copies": "5",
"size": "3940",
"license": "bsd-3-clause",
"hash": -7232199457749203000,
"line_mean": 28.6240601504,
"line_max": 79,
"alpha_frac": 0.5898477157,
"autogenerated": false,
"ratio": 3.2669983416252073,
... |
__all__ = ["render_surface_function"]
import os
import warnings
import skimage.measure
import webcolors as wc
from ..registration import resample_image
try:
import chart_studio.plotly as py
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
from plotly.graph_objs import *
fr... | {
"repo_name": "ANTsX/ANTsPy",
"path": "ants/viz/render_surface_function.py",
"copies": "1",
"size": "5503",
"license": "apache-2.0",
"hash": -1962030499097000400,
"line_mean": 28.5860215054,
"line_max": 139,
"alpha_frac": 0.5971288388,
"autogenerated": false,
"ratio": 3.654050464807437,
"config... |
__all__ = ["RequestHandler"]
class RequestHandler(object):
"""an abstract request handler.
provide a handle() method and a handle_error() method.
handle() accepts a request object (as returned by
YourTCPConnectionSubclass.get_request). handle_error() accepts the standard
3 exception arguments (t... | {
"repo_name": "teepark/feather",
"path": "feather/requests.py",
"copies": "1",
"size": "1632",
"license": "bsd-3-clause",
"hash": 956622090750295900,
"line_mean": 39.8,
"line_max": 79,
"alpha_frac": 0.7218137255,
"autogenerated": false,
"ratio": 4.771929824561403,
"config_test": false,
"has_n... |
__all__ = ('Request', 'StreamResponse', 'Response')
import asyncio
import binascii
import cgi
import collections
import http.cookies
import io
import json
import warnings
from urllib.parse import urlsplit, parse_qsl, unquote
from types import MappingProxyType
from . import hdrs
from .helpers import reify
from .multid... | {
"repo_name": "lfblogs/aio2py",
"path": "aio2py/required/aiohttp/web_reqrep.py",
"copies": "1",
"size": "20802",
"license": "apache-2.0",
"hash": -6710569348961647000,
"line_mean": 29.7267355982,
"line_max": 84,
"alpha_frac": 0.5543697721,
"autogenerated": false,
"ratio": 4.427841634738186,
"co... |
__all__ = ['require']
import subprocess, os, codecs, glob
from .evaljs import translate_js
import six
DID_INIT = False
DIRNAME = os.path.dirname(os.path.abspath(__file__))
PY_NODE_MODULES_PATH = os.path.join(DIRNAME, 'py_node_modules')
def _init():
global DID_INIT
if DID_INIT:
return
assert subpro... | {
"repo_name": "pannal/Subliminal.bundle",
"path": "Contents/Libraries/Shared/js2py/node_import.py",
"copies": "4",
"size": "4163",
"license": "mit",
"hash": -9025132002234256000,
"line_mean": 35.8407079646,
"line_max": 206,
"alpha_frac": 0.5851549363,
"autogenerated": false,
"ratio": 3.3900651465... |
__all__ = ["require"]
import os
import sys
import subprocess
import time
import json
import traceback
###
version_info = sys.version_info[:2]
PYTHON_VERSION = version_info[0] + float("." + str(version_info[1])) # TODO: make this nice
if PYTHON_VERSION >= 3:
from urllib.request import urlopen
decode_if_py3 ... | {
"repo_name": "martastain/liver",
"path": "rex.py",
"copies": "1",
"size": "6749",
"license": "mit",
"hash": 6419277168069939000,
"line_mean": 29.1294642857,
"line_max": 94,
"alpha_frac": 0.5291154245,
"autogenerated": false,
"ratio": 3.6560130010834238,
"config_test": false,
"has_no_keywords... |
__all__ = ['require']
import subprocess, os, codecs, glob
from .evaljs import translate_js, DEFAULT_HEADER
from .translators.friendly_nodes import is_valid_py_name
import six
import tempfile
import hashlib
import random
DID_INIT = False
DIRNAME = tempfile.mkdtemp()
PY_NODE_MODULES_PATH = os.path.join(os.path.dirname(... | {
"repo_name": "PiotrDabkowski/Js2Py",
"path": "js2py/node_import.py",
"copies": "1",
"size": "7224",
"license": "mit",
"hash": -2466098650793958000,
"line_mean": 42.2574850299,
"line_max": 256,
"alpha_frac": 0.6290143965,
"autogenerated": false,
"ratio": 3.6083916083916083,
"config_test": false... |
__all__ = ['resample']
import itertools
import logging
try:
from tqdm import tqdm
except ImportError:
def tqdm(x):
"""Dummy replacement for progress bar."""
x
from miles import (Database, Distribution, Matrices, TransitionKernel, bold, save_distributions) # noqa: E501
def resample(simulati... | {
"repo_name": "clsb/miles",
"path": "miles/resample.py",
"copies": "1",
"size": "2650",
"license": "mit",
"hash": 7721327671290658000,
"line_mean": 33.4155844156,
"line_max": 110,
"alpha_frac": 0.64,
"autogenerated": false,
"ratio": 4.260450160771704,
"config_test": false,
"has_no_keywords": ... |
"""All response related utility functions."""
import logging
try:
from http import client as httplib
except ImportError: # pragma: no cover
import httplib
import json
import uuid
import six
import halogen
from flask import request, abort, current_app, make_response
try:
from collections import OrderedDi... | {
"repo_name": "paylogic/atilla",
"path": "atilla/response.py",
"copies": "1",
"size": "5917",
"license": "mit",
"hash": -961126353736459800,
"line_mean": 31.6906077348,
"line_max": 109,
"alpha_frac": 0.6782153118,
"autogenerated": false,
"ratio": 4.033401499659169,
"config_test": false,
"has_... |
__all__ = ['restoredata', 'storedata']
import pickle
import warnings
from IPython.core.getipython import get_ipython
def storedata(filename=None):
"""Store the state of the current credolib workspace in a pickle file."""
if filename is None:
filename = 'credolib_state.pickle'
ns = get_ipython().u... | {
"repo_name": "awacha/credolib",
"path": "credolib/persistence.py",
"copies": "1",
"size": "1246",
"license": "bsd-3-clause",
"hash": -3314040563476166000,
"line_mean": 34.6,
"line_max": 111,
"alpha_frac": 0.5754414125,
"autogenerated": false,
"ratio": 3.63265306122449,
"config_test": false,
... |
__all__ = ['retricon']
import codecs
import hashlib
import math
import struct
from PIL import Image, ImageDraw
from six import string_types
def brightness(r, g, b):
return math.sqrt(.241 * r * r + .691 * g * g + .068 * b * b)
def key_brightness(a):
return brightness(a[0], a[1], a[2])
def fixed_length_hash... | {
"repo_name": "rphlo/py-retricon",
"path": "retricon/retricon.py",
"copies": "1",
"size": "10011",
"license": "mit",
"hash": -5737924980381664000,
"line_mean": 33.1672354949,
"line_max": 78,
"alpha_frac": 0.5213265408,
"autogenerated": false,
"ratio": 3.4966818023052744,
"config_test": false,
... |
__all__ = ["RiakClient", "ThreadedRiakClient"]
import json
import Queue
import threading
from riakcached import exceptions
from riakcached.pools import Urllib3Pool
class RiakClient(object):
"""A Memcache like client to the Riak HTTP Interface
"""
__slots__ = [
"_serializers",
"_deseriali... | {
"repo_name": "brettlangdon/riakcached",
"path": "riakcached/clients.py",
"copies": "1",
"size": "14758",
"license": "mit",
"hash": 4379898732396169000,
"line_mean": 35.6203473945,
"line_max": 98,
"alpha_frac": 0.6029272259,
"autogenerated": false,
"ratio": 4.232291367938056,
"config_test": fal... |
# All Rights Reserved 2018
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | {
"repo_name": "openstack/networking-l2gw",
"path": "networking_l2gw/tests/unit/l2gatewayclient/osc/fakes.py",
"copies": "1",
"size": "3137",
"license": "apache-2.0",
"hash": 8493240963814560000,
"line_mean": 33.4725274725,
"line_max": 78,
"alpha_frac": 0.5941982786,
"autogenerated": false,
"ratio... |
"""All rights reserved. ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, VPSI, 2017
jahia2wp: an amazing tool !
Usage:
jahia2wp.py download <site> [--debug | --quiet]
[--username=<USERNAME> --host=<HOST> --zip-path=<ZIP_PATH> --force]
jahia2wp.py download-many ... | {
"repo_name": "epfl-idevelop/jahia2wp",
"path": "src/jahia2wp.py",
"copies": "1",
"size": "54219",
"license": "mit",
"hash": 86451569473090190,
"line_mean": 38.1472924188,
"line_max": 122,
"alpha_frac": 0.5952156993,
"autogenerated": false,
"ratio": 3.835255004597864,
"config_test": true,
"ha... |
""" All rights reserved. ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, VPSI, 2017 """
from django.core.validators import URLValidator, ValidationError
from utils import Utils
from .validators import validate_string, validate_yes_or_no, validate_integer, \
validate_openshift_env, validate_site_type, valid... | {
"repo_name": "epfl-idevelop/jahia2wp",
"path": "src/veritas/veritas.py",
"copies": "1",
"size": "6035",
"license": "mit",
"hash": 1192338015618148400,
"line_mean": 30.7631578947,
"line_max": 109,
"alpha_frac": 0.6096106048,
"autogenerated": false,
"ratio": 4.036789297658863,
"config_test": fal... |
""" All rights reserved. ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, VPSI, 2017
Validators are extended from Django ones :
https://docs.djangoproject.com/fr/1.11/ref/validators
- RegexValidator
- EmailValidator
- URLValidator
- DecimalValidator
- validate_email
- validate_sl... | {
"repo_name": "epfl-idevelop/jahia2wp",
"path": "src/veritas/validators.py",
"copies": "1",
"size": "2622",
"license": "mit",
"hash": 8659910185403022000,
"line_mean": 25.4848484848,
"line_max": 90,
"alpha_frac": 0.6800152555,
"autogenerated": false,
"ratio": 3.5053475935828877,
"config_test": ... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | {
"repo_name": "ge0rgi/cinder",
"path": "cinder/volume/drivers/solidfire.py",
"copies": "1",
"size": "91315",
"license": "apache-2.0",
"hash": -3983878327612395000,
"line_mean": 41.9111842105,
"line_max": 79,
"alpha_frac": 0.5356951213,
"autogenerated": false,
"ratio": 4.35808714742519,
"config_... |
import json
import math
import random
import re
import socket
import string
import time
import warnings
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import timeutils
from oslo_utils import units
import requests
from requests.packages.urllib3 import exceptions
import six
from cinder... | {
"repo_name": "dims/cinder",
"path": "cinder/volume/drivers/solidfire.py",
"copies": "1",
"size": "72265",
"license": "apache-2.0",
"hash": -2706140054334626000,
"line_mean": 41.0389761489,
"line_max": 79,
"alpha_frac": 0.539099149,
"autogenerated": false,
"ratio": 4.36014239169784,
"config_tes... |
import json
import math
import random
import socket
import string
import time
import warnings
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import importutils
from oslo_utils import timeutils
from oslo_utils import units
import requests
from requests.packages.urllib3 import exception... | {
"repo_name": "duhzecca/cinder",
"path": "cinder/volume/drivers/solidfire.py",
"copies": "1",
"size": "51454",
"license": "apache-2.0",
"hash": 5054135275388927000,
"line_mean": 39.4194815397,
"line_max": 79,
"alpha_frac": 0.547226649,
"autogenerated": false,
"ratio": 4.32277577081408,
"config_... |
import json
import math
import random
import socket
import string
import time
import warnings
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import timeutils
from oslo_utils import units
import requests
from requests.packages.urllib3 import exceptions
import six
from cinder import co... | {
"repo_name": "tobegit3hub/cinder_docker",
"path": "cinder/volume/drivers/solidfire.py",
"copies": "1",
"size": "54639",
"license": "apache-2.0",
"hash": 2467060496773283000,
"line_mean": 39.9587706147,
"line_max": 79,
"alpha_frac": 0.5363385128,
"autogenerated": false,
"ratio": 4.359262805169938... |
# All rights reserved.
from os.path import join
from setuptools import setup, find_packages
info = {}
execfile(join('mapping', '__init__.py'), info)
setup(
name = 'mapping',
version = info['__version__'],
author = 'Enthought, Inc.',
author_email = 'info@enthought.com',
maintainer = 'ETS Develope... | {
"repo_name": "nmichaud/enable-mapping",
"path": "setup.py",
"copies": "1",
"size": "1581",
"license": "bsd-3-clause",
"hash": 1586245213786174700,
"line_mean": 33.3695652174,
"line_max": 83,
"alpha_frac": 0.6072106262,
"autogenerated": false,
"ratio": 4.043478260869565,
"config_test": false,
... |
# All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | {
"repo_name": "redixin/clis",
"path": "clis/clis.py",
"copies": "1",
"size": "5903",
"license": "apache-2.0",
"hash": -1871241283596994800,
"line_mean": 32.3502824859,
"line_max": 79,
"alpha_frac": 0.5712349653,
"autogenerated": false,
"ratio": 3.833116883116883,
"config_test": true,
"has_no_... |
# All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | {
"repo_name": "larsbutler/simpl",
"path": "tests/test_threadlocal.py",
"copies": "4",
"size": "3688",
"license": "apache-2.0",
"hash": 4771722350548773000,
"line_mean": 32.8348623853,
"line_max": 78,
"alpha_frac": 0.6480477223,
"autogenerated": false,
"ratio": 3.9655913978494626,
"config_test":... |
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | {
"repo_name": "MaximNevrov/neutron",
"path": "neutron/tests/unit/agent/linux/test_ip_conntrack.py",
"copies": "7",
"size": "1381",
"license": "apache-2.0",
"hash": -8875293384320000000,
"line_mean": 36.3243243243,
"line_max": 77,
"alpha_frac": 0.6618392469,
"autogenerated": false,
"ratio": 3.7425... |
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | {
"repo_name": "cloudevents/sdk-python",
"path": "cloudevents/tests/test_v03_event.py",
"copies": "1",
"size": "1804",
"license": "apache-2.0",
"hash": -7771867772360658000,
"line_mean": 28.0967741935,
"line_max": 78,
"alpha_frac": 0.7045454545,
"autogenerated": false,
"ratio": 3.6152304609218437,... |
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | {
"repo_name": "openstack/neutron-lib",
"path": "neutron_lib/api/definitions/_dummy.py",
"copies": "1",
"size": "4228",
"license": "apache-2.0",
"hash": -1190290167132132000,
"line_mean": 33.0967741935,
"line_max": 78,
"alpha_frac": 0.6960737938,
"autogenerated": false,
"ratio": 3.861187214611872,... |
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | {
"repo_name": "openstack/smaug",
"path": "karbor/manager.py",
"copies": "1",
"size": "3771",
"license": "apache-2.0",
"hash": 573795395200449800,
"line_mean": 31.2307692308,
"line_max": 79,
"alpha_frac": 0.6950411032,
"autogenerated": false,
"ratio": 4.299885974914481,
"config_test": false,
"... |
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | {
"repo_name": "chitr/neutron",
"path": "neutron/extensions/flavors.py",
"copies": "1",
"size": "9315",
"license": "apache-2.0",
"hash": 3693083552446385000,
"line_mean": 38.6382978723,
"line_max": 78,
"alpha_frac": 0.5405260333,
"autogenerated": false,
"ratio": 4.423076923076923,
"config_test":... |
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | {
"repo_name": "nash-x/hws",
"path": "neutron/api/rpc/handlers/securitygroups_rpc.py",
"copies": "5",
"size": "2631",
"license": "apache-2.0",
"hash": -7872055193864543000,
"line_mean": 36.0563380282,
"line_max": 78,
"alpha_frac": 0.6647662486,
"autogenerated": false,
"ratio": 4.04147465437788,
... |
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | {
"repo_name": "dims/neutron",
"path": "neutron/extensions/flavors.py",
"copies": "5",
"size": "9343",
"license": "apache-2.0",
"hash": 7898715286617979000,
"line_mean": 38.5889830508,
"line_max": 78,
"alpha_frac": 0.541153805,
"autogenerated": false,
"ratio": 4.417494089834515,
"config_test": f... |
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | {
"repo_name": "sebrandon1/neutron",
"path": "neutron/services/l3_router/service_providers/base.py",
"copies": "4",
"size": "2191",
"license": "apache-2.0",
"hash": -6780426277668985000,
"line_mean": 35.5166666667,
"line_max": 78,
"alpha_frac": 0.6932907348,
"autogenerated": false,
"ratio": 4.2792... |
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | {
"repo_name": "openstack/neutron-lib",
"path": "neutron_lib/api/definitions/dns_domain_keywords.py",
"copies": "1",
"size": "2672",
"license": "apache-2.0",
"hash": 3802518491030245400,
"line_mean": 38.2941176471,
"line_max": 78,
"alpha_frac": 0.7481287425,
"autogenerated": false,
"ratio": 4.0120... |
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | {
"repo_name": "noironetworks/neutron",
"path": "neutron/db/l3_fip_pools_db.py",
"copies": "3",
"size": "3154",
"license": "apache-2.0",
"hash": 3611935847788735000,
"line_mean": 39.961038961,
"line_max": 78,
"alpha_frac": 0.634115409,
"autogenerated": false,
"ratio": 4.326474622770919,
"config_... |
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | {
"repo_name": "mahak/neutron",
"path": "neutron/extensions/flavors.py",
"copies": "5",
"size": "2373",
"license": "apache-2.0",
"hash": -7204958039180643000,
"line_mean": 38.55,
"line_max": 78,
"alpha_frac": 0.6342182891,
"autogenerated": false,
"ratio": 4.5899419729206965,
"config_test": false... |
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | {
"repo_name": "eayunstack/neutron",
"path": "neutron/services/trunk/rules.py",
"copies": "1",
"size": "12625",
"license": "apache-2.0",
"hash": -4665204423603559000,
"line_mean": 42.8368055556,
"line_max": 79,
"alpha_frac": 0.6228910891,
"autogenerated": false,
"ratio": 4.062097812097812,
"conf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.