text stringlengths 0 1.05M | meta dict |
|---|---|
from .error import AMFError
from .packet import Packet
from .types import AMF0String, AMF0Value, U8, U16BE, U32BE
class AMFHeader(Packet):
def __init__(self, name, value, must_understand=False):
self.name = name
self.value = value
self.must_understand = must_understand
@property
d... | {
"repo_name": "chrisnicholls/livestreamer",
"path": "src/livestreamer/packages/flashmedia/amf.py",
"copies": "5",
"size": "3237",
"license": "bsd-2-clause",
"hash": 5429845618490107000,
"line_mean": 25.1048387097,
"line_max": 61,
"alpha_frac": 0.5878900216,
"autogenerated": false,
"ratio": 3.6784... |
from .error import AMFError
from .packet import Packet
from .types import AMF0String, AMF0Value, U8, U16BE, U32BE
class AMFHeader(Packet):
exception = AMFError
def __init__(self, name, value, must_understand=False):
self.name = name
self.value = value
self.must_understand = must_under... | {
"repo_name": "Dobatymo/livestreamer",
"path": "src/livestreamer/packages/flashmedia/amf.py",
"copies": "37",
"size": "3315",
"license": "bsd-2-clause",
"hash": -6214990430218789000,
"line_mean": 24.5,
"line_max": 61,
"alpha_frac": 0.5894419306,
"autogenerated": false,
"ratio": 3.6915367483296215... |
from .error import BetTooLargeError, BetTooSmallError
class Players(object):
""" deals with the player holdings and results
all results are returned as (betting amount, is_all_in)
"""
def __init__(self, holdings):
self.cards = None
self.holdings = holdings
self.alive = True
... | {
"repo_name": "tychung84/poker_tester",
"path": "poker_player/player.py",
"copies": "1",
"size": "1453",
"license": "mit",
"hash": -1962530618515347000,
"line_mean": 27.4901960784,
"line_max": 80,
"alpha_frac": 0.5554026153,
"autogenerated": false,
"ratio": 3.9059139784946235,
"config_test": fa... |
from error import BookingServiceError
from service import booking_service, email_service
class User:
""" Represents a single user of the system, with a Raven login, booking
preferences and friends.
"""
def __init__(self, crsid, password, friends, booking_preferences):
""" Construct a new User... | {
"repo_name": "JackMorris/CaiusHallHelper",
"path": "model/user.py",
"copies": "1",
"size": "5110",
"license": "mit",
"hash": 5113372245550505000,
"line_mean": 39.5634920635,
"line_max": 79,
"alpha_frac": 0.5892367906,
"autogenerated": false,
"ratio": 4.2161716171617165,
"config_test": false,
... |
from ..error import ClientError
from .response_handler import ResponseHandler
class ErrorHandler(object):
"""ErrorHandler takes care of getting the error message from response body"""
@staticmethod
def check_error(response, *args, **kwargs):
code = response.status_code
typ = response.hea... | {
"repo_name": "pksunkara/alpaca",
"path": "templates/python/lib/http_client/error_handler.py",
"copies": "1",
"size": "1289",
"license": "mpl-2.0",
"hash": 427091955464589800,
"line_mean": 36.9117647059,
"line_max": 119,
"alpha_frac": 0.5903801396,
"autogenerated": false,
"ratio": 4.7216117216117... |
from ..error import DataConsistencyError
from ..objects.order_line import OrderLine
from .base import Base
class OrderLines(Base):
order_id = None
def get_resource_name(self):
return f"orders/{self.order_id}/lines"
def get_resource_object(self, result):
return OrderLine(result, self.clie... | {
"repo_name": "mollie/mollie-api-python",
"path": "mollie/api/resources/order_lines.py",
"copies": "1",
"size": "1685",
"license": "bsd-2-clause",
"hash": -1428236662963392800,
"line_mean": 34.1041666667,
"line_max": 116,
"alpha_frac": 0.6486646884,
"autogenerated": false,
"ratio": 4.040767386091... |
from ..error import EmbedNotFound
from ..resources.order_lines import OrderLines
from ..resources.order_payments import OrderPayments
from ..resources.order_refunds import OrderRefunds
from ..resources.shipments import Shipments
from .base import Base
from .list import List
from .order_line import OrderLine
from .payme... | {
"repo_name": "mollie/mollie-api-python",
"path": "mollie/api/objects/order.py",
"copies": "1",
"size": "6847",
"license": "bsd-2-clause",
"hash": 8359282589033317000,
"line_mean": 26.7206477733,
"line_max": 115,
"alpha_frac": 0.6193953556,
"autogenerated": false,
"ratio": 4.080452920143028,
"c... |
from .error import ErrorCode, IndyError
from ctypes import *
import asyncio
import sys
import itertools
import logging
_futures = {}
_futures_counter = itertools.count()
def do_call(name: str, *args):
logger = logging.getLogger(__name__)
logger.debug("do_call: >>> name: %s, args: %s", name, args)
even... | {
"repo_name": "MRJCrunch/indy-sdk",
"path": "wrappers/python/indy/libindy.py",
"copies": "1",
"size": "3375",
"license": "apache-2.0",
"hash": -1454576843849264000,
"line_mean": 28.8672566372,
"line_max": 108,
"alpha_frac": 0.6097777778,
"autogenerated": false,
"ratio": 3.226577437858509,
"conf... |
from .error import ErrorContainer, UnitError
from .field import Field
class ModelMeta(type):
""" A Model Meta Class.
"""
def __new__(cls, classname, bases, namespace, **kwargs):
fields = {}
result = type.__new__(cls, classname, bases, namespace, **kwargs)
for key, field in namespac... | {
"repo_name": "pysigma/core",
"path": "sigma/core/model.py",
"copies": "2",
"size": "1853",
"license": "mit",
"hash": 1546634560768279800,
"line_mean": 28.4126984127,
"line_max": 73,
"alpha_frac": 0.4711279007,
"autogenerated": false,
"ratio": 4.655778894472362,
"config_test": false,
"has_no_... |
from ..error import Error
from .location import get_location
__all__ = ['LanguageError']
class LanguageError(Error):
def __init__(self, source, position, description):
self.source = source
self.position = position
self.description = description
def __str__(self):
# FIXME
... | {
"repo_name": "rawls238/graphql-py",
"path": "graphql/core/language/error.py",
"copies": "1",
"size": "1196",
"license": "mit",
"hash": 5045734550376348000,
"line_mean": 28.9,
"line_max": 64,
"alpha_frac": 0.5735785953,
"autogenerated": false,
"ratio": 3.8089171974522293,
"config_test": false,
... |
from .Error import EventNotFound, EventListenerNotFound, EventManagerNotReady
class Cancel( Exception ): pass
class Manager( object ):
_events = []
def __init__( self ):
self.name = None
self._ready = False
def init( self, name ):
self.name = name
self.clear()
... | {
"repo_name": "MarkLark/dstore",
"path": "dstore/Event.py",
"copies": "1",
"size": "3063",
"license": "mit",
"hash": 4095272448720120000,
"line_mean": 26.1061946903,
"line_max": 81,
"alpha_frac": 0.4890630101,
"autogenerated": false,
"ratio": 4.4520348837209305,
"config_test": false,
"has_no_... |
from ..error import GraphQLError
from ..language.ast import FragmentDefinition, FragmentSpread
from ..language.visitor import Visitor, visit
from ..utils import TypeInfo
from ..type import GraphQLSchema
from . import rules as Rules
specified_rules = [
Rules.UniqueOperationNames,
Rules.LoneAnonymousOperation,
... | {
"repo_name": "rawls238/graphql-py",
"path": "graphql/core/validation/__init__.py",
"copies": "1",
"size": "4168",
"license": "mit",
"hash": 2737713228055297000,
"line_mean": 28.3521126761,
"line_max": 116,
"alpha_frac": 0.6614683301,
"autogenerated": false,
"ratio": 4.054474708171206,
"config_... |
from ..error import GraphQLError
from .location import get_location
__all__ = ['LanguageError']
class LanguageError(GraphQLError):
def __init__(self, source, position, description):
location = get_location(source, position)
super(LanguageError, self).__init__(
message=u'Syntax Error {... | {
"repo_name": "gabriel-laet/graphql-py",
"path": "graphql/core/language/error.py",
"copies": "2",
"size": "1108",
"license": "mit",
"hash": -4781976979164762000,
"line_mean": 30.6571428571,
"line_max": 63,
"alpha_frac": 0.5496389892,
"autogenerated": false,
"ratio": 3.9014084507042255,
"config_... |
from .error import HasNoState
class PysmEvent(object):
def __init__(self, to_state):
if to_state == 'WhateverState':
raise ValueError('cannot use WhateverState as to_state')
self.to_state = to_state
class Event(PysmEvent):
def __get__(self, instance, owner):
if not inst... | {
"repo_name": "Catstyle/pysm",
"path": "pysm/event.py",
"copies": "1",
"size": "1304",
"license": "mit",
"hash": -4602277112603339300,
"line_mean": 26.1666666667,
"line_max": 68,
"alpha_frac": 0.5797546012,
"autogenerated": false,
"ratio": 3.6022099447513813,
"config_test": false,
"has_no_key... |
from ..error import IdentifierError
from ..objects.order import Order
from .base import Base
class Orders(Base):
RESOURCE_ID_PREFIX = "ord_"
def get_resource_object(self, result):
return Order(result, self.client)
def get(self, order_id, **params):
if not order_id or not order_id.startsw... | {
"repo_name": "mollie/mollie-api-python",
"path": "mollie/api/resources/orders.py",
"copies": "1",
"size": "1300",
"license": "bsd-2-clause",
"hash": 7648411815643586000,
"line_mean": 34.1351351351,
"line_max": 109,
"alpha_frac": 0.6307692308,
"autogenerated": false,
"ratio": 4.100946372239748,
... |
from ..error import IdentifierError
from ..objects.subscription import Subscription
from .base import Base
class CustomerSubscriptions(Base):
RESOURCE_ID_PREFIX = "sub_"
customer_id = None
def get_resource_object(self, result):
return Subscription(result, self.client)
def get(self, subscript... | {
"repo_name": "mollie/mollie-api-python",
"path": "mollie/api/resources/customer_subscriptions.py",
"copies": "1",
"size": "1624",
"license": "bsd-2-clause",
"hash": 3981262896010686500,
"line_mean": 36.7674418605,
"line_max": 90,
"alpha_frac": 0.6545566502,
"autogenerated": false,
"ratio": 4.461... |
from .Error import IncompatibleSource, VariableNotFound
from . import Event
class ModelEvents( Event.Manager ):
_events = [
"before_add", "after_add",
"before_delete", "after_delete",
"before_update", "after_update",
"before_validate", "after_validate",
"before_all", "after... | {
"repo_name": "MarkLark/dstore",
"path": "dstore/Model.py",
"copies": "1",
"size": "6107",
"license": "mit",
"hash": 1886997809206319600,
"line_mean": 31.4840425532,
"line_max": 108,
"alpha_frac": 0.5451121664,
"autogenerated": false,
"ratio": 3.9578742709008425,
"config_test": false,
"has_no... |
from .error import LanguageError
__all__ = ['Token', 'Lexer', 'TokenKind',
'get_token_desc', 'get_token_kind_desc']
class Token(object):
def __init__(self, kind, start, end, value=None):
self.kind = kind
self.start = start
self.end = end
self.value = value
def __re... | {
"repo_name": "rawls238/graphql-py",
"path": "graphql/core/language/lexer.py",
"copies": "1",
"size": "10328",
"license": "mit",
"hash": -6533584442423122000,
"line_mean": 27.6888888889,
"line_max": 75,
"alpha_frac": 0.5307900852,
"autogenerated": false,
"ratio": 3.675444839857651,
"config_test... |
from ..Error import MolQueryError
from rdkit import Chem
from collections import defaultdict
import operator as op
"""
Written by Geun Ho Gu 8/4/2016
MolQuery class is equipped with enhanced query comparison over
RDkit query comparison.
This module uses a graph description language called R.I.N.G.
Rangarajan, S., Kamin... | {
"repo_name": "VlachosGroup/VlachosGroupAdditivity",
"path": "pgradd/RDkitWrapper/MolQuery.py",
"copies": "1",
"size": "24302",
"license": "mit",
"hash": -2865954202042548000,
"line_mean": 35.7655068079,
"line_max": 79,
"alpha_frac": 0.5426302362,
"autogenerated": false,
"ratio": 4.06320013375689... |
from .error import ParseError
def checksum(cmd):
'''
Compute checksum by XORing each byte of the
input `cmd`.
Returns int between 0-255.
'''
return reduce(lambda x, y: x ^ y, map(ord, cmd))
def parse(line):
'''
Parse g-code `line`
Returns tuple consisting of
(gcode_command... | {
"repo_name": "hackerspace/hacked_cnc",
"path": "hc/gcode.py",
"copies": "2",
"size": "1082",
"license": "bsd-3-clause",
"hash": 7718546000101243000,
"line_mean": 20.64,
"line_max": 76,
"alpha_frac": 0.4990757856,
"autogenerated": false,
"ratio": 3.8098591549295775,
"config_test": false,
"has... |
from .error import PrintableError
SCOPE_SEPARATOR = '.'
RULE_SEPARATOR = '|'
class Scope:
'''A Scope holds the elements that are parsed out of a single peru.yaml
file. This is kept separate from a Runtime, because recursive modules need
to work with a Scope that makes sense to them, rather than a single ... | {
"repo_name": "buildinspace/peru",
"path": "peru/scope.py",
"copies": "1",
"size": "4032",
"license": "mit",
"hash": 4034081656000715300,
"line_mean": 41,
"line_max": 79,
"alpha_frac": 0.578125,
"autogenerated": false,
"ratio": 4.271186440677966,
"config_test": false,
"has_no_keywords": false... |
from ..Error import ReactionQueryError
from rdkit import Chem
from . MolQuery import MolQuery
from collections import defaultdict
from itertools import product as itpd
from rdkit.Chem import rdqueries
from operator import add
"""
Written by Geun Ho Gu 8/4/2016
ReactionQuery class is equipped with enhanced query compari... | {
"repo_name": "VlachosGroup/VlachosGroupAdditivity",
"path": "pgradd/RDkitWrapper/ReactionQuery.py",
"copies": "1",
"size": "14498",
"license": "mit",
"hash": 3677694094604758500,
"line_mean": 40.4228571429,
"line_max": 79,
"alpha_frac": 0.5563526004,
"autogenerated": false,
"ratio": 3.9568777292... |
from ..error import RequestError
from .methods import Methods
class ProfileMethods(Methods):
RESOURCE_REQUIRED_METHODS = ["giftcard", "voucher"]
profile_id = None
method_id = None
resource_id = None
def get_resource_name(self):
path = f"profiles/{self.profile_id}/methods/{self.method_id}... | {
"repo_name": "mollie/mollie-api-python",
"path": "mollie/api/resources/profile_methods.py",
"copies": "1",
"size": "1630",
"license": "bsd-2-clause",
"hash": 4506243763601515000,
"line_mean": 37.8095238095,
"line_max": 92,
"alpha_frac": 0.663190184,
"autogenerated": false,
"ratio": 3.70454545454... |
from ..error import ResponseError, ResponseHandlingError
from ..objects.list import List
class Base(object):
REST_CREATE = "POST"
REST_UPDATE = "PATCH"
REST_READ = "GET"
REST_LIST = "GET"
REST_DELETE = "DELETE"
DEFAULT_LIMIT = 10
def __init__(self, client):
self.client = client
... | {
"repo_name": "mollie/mollie-api-python",
"path": "mollie/api/resources/base.py",
"copies": "1",
"size": "2961",
"license": "bsd-2-clause",
"hash": -1400944026167297500,
"line_mean": 39.5616438356,
"line_max": 105,
"alpha_frac": 0.6095913543,
"autogenerated": false,
"ratio": 3.963855421686747,
... |
from .. Error import RINGReaderError
from .. RDkitWrapper.MolQuery import AtomRing, AtomConnectivityAtom,\
ConstraintNumber, MolCharge, MolAromatic, MolOlefinic, MolParaffinic,\
MolCyclic, MolLinear, MolQuery, AtomRadical, BondQuery, BondConstraint, \
AtomConnectivityGroup, AtomIsInRing, AtomIsAromatic, Ato... | {
"repo_name": "VlachosGroup/VlachosGroupAdditivity",
"path": "pgradd/RINGParser/MolQueryRead.py",
"copies": "1",
"size": "20615",
"license": "mit",
"hash": -8457428391492610000,
"line_mean": 39.8217821782,
"line_max": 79,
"alpha_frac": 0.5401406743,
"autogenerated": false,
"ratio": 3.886689291101... |
from .. Error import RINGReaderError
from .. RDkitWrapper.ReactionQuery import ReactionQuery, BondForm, \
BondIncrease, BondDecrease, BondModify, AtomTypeModify, BondBreak,\
RadicalIncrease, RadicalDecrease, ChargeIncrease, ChargeDecrease
from .MolQueryRead import MolQueryReader
from rdkit import Chem
class R... | {
"repo_name": "VlachosGroup/VlachosGroupAdditivity",
"path": "pgradd/RINGParser/ReactionQueryRead.py",
"copies": "1",
"size": "21211",
"license": "mit",
"hash": -2902051358780542000,
"line_mean": 42.6440329218,
"line_max": 79,
"alpha_frac": 0.5417000613,
"autogenerated": false,
"ratio": 3.8755709... |
from ..Error import RINGSyntaxError
from operator import eq
"""
Parses the RING input string into abstract syntax tree as defined by
Grammar.py.
Example:
>>>from pgradd.RINGParser.parser import parse
>>>parse('\
>>>fragment C3Chain{\
>>> C labeled c1\
>>> C labeled c2 single bond to c1\
>>> C labeled c3 single ... | {
"repo_name": "VlachosGroup/VlachosGroupAdditivity",
"path": "pgradd/RINGParser/Parser.py",
"copies": "1",
"size": "13511",
"license": "mit",
"hash": -5272863409827649000,
"line_mean": 28.825607064,
"line_max": 79,
"alpha_frac": 0.5300865961,
"autogenerated": false,
"ratio": 3.990253987005316,
... |
from .. Error import UnitsParseError
__all__ = ['units_db']
class UnitsDB(object):
prefixes = {
'Y': 1e24,
'Z': 1e21,
'E': 1e18,
'P': 1e15,
'T': 1e12,
'G': 1e9,
'M': 1e6,
'k': 1e3,
'h': 1e2,
'da': 1e1,
'd': 1e-1,
'c'... | {
"repo_name": "VlachosGroup/VlachosGroupAdditivity",
"path": "pgradd/Units/db.py",
"copies": "1",
"size": "1198",
"license": "mit",
"hash": 4180657213107355000,
"line_mean": 21.6037735849,
"line_max": 61,
"alpha_frac": 0.4641068447,
"autogenerated": false,
"ratio": 2.9800995024875623,
"config_t... |
from .Error import ValidationError
class Mod( object ):
"""
The base class used for creating a Modifier.
A Modifier is a way to validate Model instance Variables upon add and/or update.
"""
type = ""
def validate( self, instance, var, val ):
"""
:param instance: The Model in... | {
"repo_name": "MarkLark/dstore",
"path": "dstore/mod.py",
"copies": "1",
"size": "4885",
"license": "mit",
"hash": -8642705118701766000,
"line_mean": 24.1804123711,
"line_max": 106,
"alpha_frac": 0.5588536336,
"autogenerated": false,
"ratio": 4.4734432234432235,
"config_test": false,
"has_no_... |
from error_matrix_from_brute_force import ErrorMatrixBruteForce
import numpy as np
def main(model1_filename,model2_filename,model1_dataset,model2_dataset,
number_of_processes=1,chunck_size=10,number_of_evaluations=10,
order_spline_interpolation=3,cropping_model=None,mask=None,
radius_radial... | {
"repo_name": "FXIhub/nutcracker",
"path": "nutcracker/utils/run_error_matrix.py",
"copies": "1",
"size": "2409",
"license": "bsd-2-clause",
"hash": -3092715997264333300,
"line_mean": 53.75,
"line_max": 137,
"alpha_frac": 0.5271897053,
"autogenerated": false,
"ratio": 4.6686046511627906,
"confi... |
from error_matrix import ErrorMatrix
from ensemble import Ensemble
from model import Model
import multiprocessing as mp
import numpy as np
import os
class AutoLearner:
def __init__(self, selected_algorithms='all', selected_hyperparameters='default', ensemble_size=3,
ensemble_method='Logit', ... | {
"repo_name": "yujiakimoto/lowrankautoml",
"path": "automl/auto_learner.py",
"copies": "1",
"size": "2271",
"license": "mit",
"hash": 5421409278009793000,
"line_mean": 45.3469387755,
"line_max": 140,
"alpha_frac": 0.6719506825,
"autogenerated": false,
"ratio": 4.077199281867146,
"config_test": ... |
from error_message import ErrorMessages
from error_message import showErrorPage
from db_utils import getAllHosts
from db_utils import getAllLinks
from models import LinkStat
import webapp2
import logging
from time import time
from time import gmtime
from time import strftime
import hashlib
import urllib2
from google.a... | {
"repo_name": "cloud-io/CloudUp",
"path": "src/cron_views.py",
"copies": "1",
"size": "2355",
"license": "mit",
"hash": 8737719009656147000,
"line_mean": 32.1690140845,
"line_max": 100,
"alpha_frac": 0.6666666667,
"autogenerated": false,
"ratio": 3.623076923076923,
"config_test": false,
"has_... |
from error_middleware.exceptions import (Renderable500, Renderable400,
Renderable403, Renderable404)
from django.conf import settings
class NoValidCredentials(Exception): pass
UNAUTHORIZED_ACCESS = Renderable403("Sorry, you do not have access to this course. If you feel that this is an error, please contact a mem... | {
"repo_name": "penzance/ab-testing-tool",
"path": "ab_tool/exceptions.py",
"copies": "1",
"size": "3987",
"license": "mit",
"hash": 5788407170145191000,
"line_mean": 60.3384615385,
"line_max": 187,
"alpha_frac": 0.7913217958,
"autogenerated": false,
"ratio": 3.695088044485635,
"config_test": fa... |
from errorpro.dimensions.dimensions import Dimension
from errorpro.units import BaseUnit,DerivedUnit
# seven SI dimensions
length=Dimension(length=1)
time=Dimension(time=1)
mass=Dimension(mass=1)
current=Dimension(current=1)
temperature=Dimension(temperature=1)
amount=Dimension(amount=1)
luminosity=Dimension(luminosit... | {
"repo_name": "benti/Error-Pypagation",
"path": "errorpro/si.py",
"copies": "3",
"size": "2702",
"license": "bsd-3-clause",
"hash": 8039276589632860000,
"line_mean": 38.1594202899,
"line_max": 155,
"alpha_frac": 0.6713545522,
"autogenerated": false,
"ratio": 2.568441064638783,
"config_test": fa... |
from errorpro.parsing.generated import DatParser
from grako.buffering import Buffer
import re
import os.path as path
import os
IMPORT_RE = '^\s*import\s*\(\s*"(.*)"\s*\)\s*$'
EOL_COMMENTS_RE = "#.*$"
def get_code(filename, from_dir):
f = open(path.join(from_dir, filename))
code = f.read()
code = re.sub(I... | {
"repo_name": "benti/Error-Pypagation",
"path": "errorpro/parsing/parsing.py",
"copies": "3",
"size": "1217",
"license": "bsd-3-clause",
"hash": 2215305723848717800,
"line_mean": 23.34,
"line_max": 129,
"alpha_frac": 0.5784716516,
"autogenerated": false,
"ratio": 3.418539325842697,
"config_test... |
from errorpro.quantities import get_value, get_error, adjust_to_unit, get_dimension, Quantity
from errorpro.units import convert_to_unit
from sympy import S
from importlib import import_module
def plot(expr_pairs, config, save=None, xunit=None, yunit=None, xrange=None, yrange=None, ignore_dim=False):
# TODO it sh... | {
"repo_name": "benti/Error-Pypagation",
"path": "errorpro/plotting.py",
"copies": "1",
"size": "5317",
"license": "bsd-3-clause",
"hash": -1254449645130610200,
"line_mean": 36.7092198582,
"line_max": 133,
"alpha_frac": 0.5102501411,
"autogenerated": false,
"ratio": 3.684684684684685,
"config_te... |
from ..errors import AngrExitError
from . import ExplorationTechnique
import logging
l = logging.getLogger(name=__name__)
class Slicecutor(ExplorationTechnique):
"""
The Slicecutor is an exploration that executes provided code slices.
"""
def __init__(self, annotated_cfg, force_taking_exit=False, fo... | {
"repo_name": "angr/angr",
"path": "angr/exploration_techniques/slicecutor.py",
"copies": "1",
"size": "5141",
"license": "bsd-2-clause",
"hash": -113647619534945800,
"line_mean": 43.7043478261,
"line_max": 119,
"alpha_frac": 0.5794592492,
"autogenerated": false,
"ratio": 4.262852404643449,
"co... |
from ..errors import AngrMemoryError, AngrTranslationError
from ..analysis import Analysis, register_analysis
from collections import deque
import logging
import math
import networkx
import types
# todo include an explanation of the algorithm
# todo include a method that detects any change other than constants
# todo... | {
"repo_name": "haylesr/angr",
"path": "angr/analyses/bindiff.py",
"copies": "1",
"size": "50918",
"license": "bsd-2-clause",
"hash": 8035425770676712000,
"line_mean": 41.5380116959,
"line_max": 120,
"alpha_frac": 0.5855100357,
"autogenerated": false,
"ratio": 4.011818468326505,
"config_test": f... |
from ..errors import AngrMemoryError
from ..analysis import Analysis
from collections import deque
import logging
import math
import networkx
import types
# todo include an explanation of the algorithm
# todo include a method that detects any change other than constants
l = logging.getLogger(name="angr.analyses.bind... | {
"repo_name": "lowks/angr",
"path": "angr/analyses/bindiff.py",
"copies": "9",
"size": "37386",
"license": "bsd-2-clause",
"hash": 1381616075113857800,
"line_mean": 42.8288393904,
"line_max": 124,
"alpha_frac": 0.598887284,
"autogenerated": false,
"ratio": 3.9587039390088945,
"config_test": fal... |
from .errors import ArgumentError
def check_values(value, arg, arg_value):
if type(value) == type:
if type(arg_value) != value:
raise ArgumentError(u"Type of argument {} is invalid. It should be {}".format(arg, value))
elif arg_value not in value:
raise ArgumentError(u"Value of arg... | {
"repo_name": "alfakini/python-mercadobitcoin",
"path": "mercadobitcoin/validation.py",
"copies": "1",
"size": "1108",
"license": "mit",
"hash": 8026003639954780000,
"line_mean": 40.037037037,
"line_max": 106,
"alpha_frac": 0.6597472924,
"autogenerated": false,
"ratio": 3.8472222222222223,
"con... |
from .errors import AuthenticationError, APIError, ConnectionError
from .headers_builder import HeadersBuilder
from .params_builder import ParamsBuilder
from .path_builder import PathBuilder
from .requester import Requester
import requests
class APIMethod(object):
api_key = None
api_base = None
method = N... | {
"repo_name": "synapsepayments/synapse_pay-python",
"path": "synapsepay/apibits/api_method.py",
"copies": "1",
"size": "2479",
"license": "mit",
"hash": 6372092704245457000,
"line_mean": 37.1384615385,
"line_max": 93,
"alpha_frac": 0.6401774909,
"autogenerated": false,
"ratio": 4.4586330935251794... |
from .errors import AuthenticationError, ApiError, ConnectionError
from .headers_builder import HeadersBuilder
from .params_builder import ParamsBuilder
from .path_builder import PathBuilder
from .requester import Requester
import requests
class ApiMethod(object):
api_key = None
api_base = None
method = N... | {
"repo_name": "rainforestapp/rainforest-python",
"path": "rainforest/apibits/api_method.py",
"copies": "2",
"size": "2508",
"license": "mit",
"hash": -3775535039188843000,
"line_mean": 37.5846153846,
"line_max": 93,
"alpha_frac": 0.6419457735,
"autogenerated": false,
"ratio": 4.446808510638298,
... |
from .errors import AuthenticationError
import base64
import json
import platform
class HeadersBuilder(object):
@classmethod
def default_headers(cls):
user_agent = {
'bindings_version': '0.0.6',
'lang': 'python',
'publisher': 'paid',
'httplib': 'requests... | {
"repo_name": "synapsepayments/synapse_pay-python",
"path": "synapsepay/apibits/headers_builder.py",
"copies": "1",
"size": "1118",
"license": "mit",
"hash": -737021361045421200,
"line_mean": 26.2682926829,
"line_max": 73,
"alpha_frac": 0.511627907,
"autogenerated": false,
"ratio": 4.156133828996... |
from .errors import CardSourceError
__all__ = ['Card']
class Card(object):
"""
Represents a single playing card
A ``Card`` object supports a number of operations.
When compared to another card, a card is greater than another card
if the rank (A, 7, 2) is higher than the other card's rank. Suit... | {
"repo_name": "niklele/CardGameAI",
"path": "cardgames/cardsource/cards.py",
"copies": "1",
"size": "2678",
"license": "mit",
"hash": -4892216014332784000,
"line_mean": 29.7816091954,
"line_max": 74,
"alpha_frac": 0.5657206871,
"autogenerated": false,
"ratio": 3.798581560283688,
"config_test": ... |
from ..errors import CLEOperationError
from . import Relocation
import logging
l = logging.getLogger('cle.relocations.generic')
class GenericAbsoluteReloc(Relocation):
@property
def value(self):
return self.resolvedby.rebased_addr
class GenericAbsoluteAddendReloc(Relocation):
@property
def va... | {
"repo_name": "pewpewsecure/cle",
"path": "cle/relocations/generic.py",
"copies": "1",
"size": "3248",
"license": "bsd-2-clause",
"hash": 825787606605404300,
"line_mean": 33.9247311828,
"line_max": 135,
"alpha_frac": 0.6422413793,
"autogenerated": false,
"ratio": 3.67420814479638,
"config_test"... |
from ..errors import ClientError
class Model(object):
attr_names = ['id', 'url']
def __init__(self, attrs={}, url=None, client=None, collection=None):
self.url = url
self.client = client
self.collection = collection
self.set(attrs)
def __eq__(self, other):
return ... | {
"repo_name": "orchardup/python-orchard",
"path": "orchard/models/resource.py",
"copies": "1",
"size": "2689",
"license": "apache-2.0",
"hash": -4461686318665866000,
"line_mean": 26.7216494845,
"line_max": 96,
"alpha_frac": 0.5637783563,
"autogenerated": false,
"ratio": 3.942815249266862,
"conf... |
from Errors import CompileError, error
import ExprNodes
from ExprNodes import IntNode, NameNode, AttributeNode
import Options
from Code import UtilityCode, TempitaUtilityCode
from UtilityCode import CythonUtilityCode
import Buffer
import PyrexTypes
import ModuleNode
START_ERR = "Start must not be given."
STOP_ERR = "A... | {
"repo_name": "Teamxrtc/webrtc-streaming-node",
"path": "third_party/webrtc/src/chromium/src/third_party/cython/src/Cython/Compiler/MemoryView.py",
"copies": "95",
"size": "33761",
"license": "mit",
"hash": -6662779057392083000,
"line_mean": 34.3528795812,
"line_max": 108,
"alpha_frac": 0.5722875507,... |
from Errors import CompileError, error
import ExprNodes
from ExprNodes import IntNode, NoneNode, IntBinopNode, NameNode, AttributeNode
from Visitor import CythonTransform
import Options
from Code import UtilityCode
from UtilityCode import CythonUtilityCode
from PyrexTypes import py_object_type, cython_memoryview_ptr_ty... | {
"repo_name": "hpfem/cython",
"path": "Cython/Compiler/MemoryView.py",
"copies": "1",
"size": "34917",
"license": "apache-2.0",
"hash": -137204176201476480,
"line_mean": 34.5942915392,
"line_max": 176,
"alpha_frac": 0.561932583,
"autogenerated": false,
"ratio": 3.4262584633500146,
"config_test"... |
from .errors import CompilerError
class SyntaxTree(object):
def __init__(self, tokens):
self.tokens = tokens
self.index = 0
def is_token(self, type):
try:
token = self.tokens[self.index]
return token[0] == type
except IndexError:
return False... | {
"repo_name": "thomasleese/barebones",
"path": "barebones/ast.py",
"copies": "2",
"size": "5901",
"license": "mit",
"hash": -2133199096393005300,
"line_mean": 29.8952879581,
"line_max": 106,
"alpha_frac": 0.5587188612,
"autogenerated": false,
"ratio": 3.9471571906354517,
"config_test": false,
... |
from ..errors import ConfigError
class AbstractNode(object):
"""Configuration Base Class
All nodes in the configuration inherit from this base class
to define types of nodes and groups of nodes; it is not intended
to be used directly, but rather to be subclassed.
"""
def __init__(self, value... | {
"repo_name": "dropseedlabs/configyaml",
"path": "configyaml/config/base.py",
"copies": "1",
"size": "7084",
"license": "mit",
"hash": 4432779923037347300,
"line_mean": 31.495412844,
"line_max": 120,
"alpha_frac": 0.555053642,
"autogenerated": false,
"ratio": 4.314250913520097,
"config_test": t... |
from .errors import ConnectionError
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
try:
from urllib import quote
except ImportError:
from urllib.parse import quote
import json
import requests
requests.packages.urllib3.disable_warnings()
class Requester(... | {
"repo_name": "rainforestapp/rainforest-python",
"path": "rainforest/apibits/requester.py",
"copies": "3",
"size": "2533",
"license": "mit",
"hash": -720790824789177900,
"line_mean": 28.1149425287,
"line_max": 117,
"alpha_frac": 0.5779707856,
"autogenerated": false,
"ratio": 4.138888888888889,
... |
from .errors import DataFormatError
import pandas as pd
import numpy as np
import warnings
import math
class ParticleDistribution(object):
"""Generic Particle Distribution
- Histogram should be a pd.DataFrame
- bins should be a 3d array (in microns)
"""
def __init__(self, histogram, bins, **kwar... | {
"repo_name": "dhhagan/atmospy",
"path": "atmospy/aerosols.py",
"copies": "1",
"size": "6829",
"license": "mit",
"hash": -6552843015217804000,
"line_mean": 39.4082840237,
"line_max": 129,
"alpha_frac": 0.4953873188,
"autogenerated": false,
"ratio": 2.8960983884648006,
"config_test": false,
"h... |
from ..errors import DataSizeError
from ..tools import Data
import statistics
class Averages:
"""
Attempting not to re-invent the wheel.
The methods below already exist under
the statistics module in 3.5, So i just called them.
Would eventually have to rewrite them though.
"""
def __init_... | {
"repo_name": "pyung/statistics",
"path": "core/exploration/summary.py",
"copies": "1",
"size": "1779",
"license": "mit",
"hash": 2816525795592928000,
"line_mean": 25.552238806,
"line_max": 122,
"alpha_frac": 0.6216975829,
"autogenerated": false,
"ratio": 3.9621380846325165,
"config_test": fals... |
from .errors import DBError
class DBAPIQueryHelper(object):
"""Helper to simplify binding DBAPI parameters"""
__paramstyle_positional = {
'qmark': True,
'numeric': True,
'named': False,
'format': True,
'pyformat': False,
}
__paramstyle_format_args = {
... | {
"repo_name": "nkrishnaswami/uscensus",
"path": "uscensus/util/dbapiqueryhelper.py",
"copies": "1",
"size": "2282",
"license": "apache-2.0",
"hash": -7613689830519030000,
"line_mean": 32.5588235294,
"line_max": 76,
"alpha_frac": 0.5652936021,
"autogenerated": false,
"ratio": 4.210332103321033,
... |
from Errors import error, message
import ExprNodes
import Nodes
import Builtin
import PyrexTypes
from Cython import Utils
from PyrexTypes import py_object_type, unspecified_type
from Visitor import CythonTransform, EnvTransform
class TypedExprNode(ExprNodes.ExprNode):
# Used for declaring assignments of a specifi... | {
"repo_name": "genome-vendor/cython",
"path": "debian/cython/usr/share/pyshared/Cython/Compiler/TypeInference.py",
"copies": "7",
"size": "19931",
"license": "apache-2.0",
"hash": 8992862867579990000,
"line_mean": 38.3893280632,
"line_max": 110,
"alpha_frac": 0.5636445738,
"autogenerated": false,
... |
from errors import Error
from ConfigParser import SafeConfigParser
from datetime import datetime
import argparse
import pickle
class DDLGen(object):
def __init__(self, name):
try:
self.name = name
f = open('%s.pkl' % self.name, 'r')
self.idx = pickle.load(f)
... | {
"repo_name": "tomplace/nosql2sql",
"path": "ddlgen.py",
"copies": "1",
"size": "2082",
"license": "mit",
"hash": 5056721196583663000,
"line_mean": 32.5967741935,
"line_max": 115,
"alpha_frac": 0.5422670509,
"autogenerated": false,
"ratio": 3.6083188908145583,
"config_test": false,
"has_no_ke... |
from ..errors import ErrorNonExistentMailbox, AutoDiscoverFailed
from ..fields import TextField, EmailAddressField, ChoiceField, Choice, EWSElementField, OnOffField, BooleanField, \
IntegerField, BuildField, ProtocolListField
from ..properties import EWSElement
from ..transport import DEFAULT_ENCODING, NOAUTH, NTLM... | {
"repo_name": "ecederstrand/exchangelib",
"path": "exchangelib/autodiscover/properties.py",
"copies": "1",
"size": "14574",
"license": "bsd-2-clause",
"hash": 8727676851993575000,
"line_mean": 43.7055214724,
"line_max": 127,
"alpha_frac": 0.6927404968,
"autogenerated": false,
"ratio": 3.530523255... |
from ..errors import Errors
from ..password_scheme import PasswordScheme
from ..token_builder import BuildToken
from flask import current_app as app
from kao_flask import JSONController
from kao_flask.ext.sqlalchemy import db
def GetLoginController(User, usernameField):
""" Return the LoginController in ... | {
"repo_name": "cloew/KaoFlaskAuth",
"path": "kao_flask_auth/Controllers/login_controller.py",
"copies": "1",
"size": "1987",
"license": "mit",
"hash": 2237781213304387600,
"line_mean": 40.3191489362,
"line_max": 106,
"alpha_frac": 0.5671867136,
"autogenerated": false,
"ratio": 4.9551122194513715,... |
from ..errors import Errors
from ..password_scheme import PasswordScheme
from kao_flask.ext.sqlalchemy import CreateController
from sqlalchemy.exc import IntegrityError
def GetRegisterController(User, LoginController):
""" Return the RegisterController in the proper scope """
class RegisterController(... | {
"repo_name": "cloew/KaoFlaskAuth",
"path": "kao_flask_auth/Controllers/register_controller.py",
"copies": "1",
"size": "1303",
"license": "mit",
"hash": -1439322968862924300,
"line_mean": 46.3333333333,
"line_max": 96,
"alpha_frac": 0.6531082118,
"autogenerated": false,
"ratio": 5.01153846153846... |
from Errors import error, warning, message, warn_once, InternalError
import ExprNodes
import Nodes
import Builtin
import PyrexTypes
from Cython import Utils
from PyrexTypes import py_object_type, unspecified_type
from Visitor import CythonTransform
class TypedExprNode(ExprNodes.ExprNode):
# Used for declaring ass... | {
"repo_name": "hpfem/cython",
"path": "Cython/Compiler/TypeInference.py",
"copies": "1",
"size": "17661",
"license": "apache-2.0",
"hash": 3704316886457408500,
"line_mean": 36.7371794872,
"line_max": 121,
"alpha_frac": 0.5757884604,
"autogenerated": false,
"ratio": 4.3393120393120395,
"config_t... |
from .errors import IllegalAccessError, IllegalSpecError, ValidationError
from .values_and_valuetypes import AnyValueType, LazyValueType
__all__ = [ "Field", "FieldAlias" ]
class Field:
"""Field instances are attached to FieldContainer classes as class attributes.
Field is a data descriptor, i.e. it implem... | {
"repo_name": "lars-tiede/aiorethink",
"path": "aiorethink/field.py",
"copies": "1",
"size": "6645",
"license": "mit",
"hash": 7209671378386372000,
"line_mean": 33.0769230769,
"line_max": 82,
"alpha_frac": 0.5301730625,
"autogenerated": false,
"ratio": 4.624217118997913,
"config_test": false,
... |
from .errors import InvalidOperationError
from operator import add
import itertools
def _multi_itemgetter(items):
"""Like operator.itemgetter, but the callable always returns
a sequence of lookup values (regardless of items' length)
see https://docs.python.org/2/library/operator.html#operator.itemgetter
... | {
"repo_name": "alphagov/backdrop",
"path": "backdrop/core/nested_merge.py",
"copies": "1",
"size": "6176",
"license": "mit",
"hash": 8465387271745081000,
"line_mean": 25.9694323144,
"line_max": 79,
"alpha_frac": 0.623380829,
"autogenerated": false,
"ratio": 3.7475728155339807,
"config_test": fa... |
from .errors import maybe_throw
def add_json_headers(kw):
if 'headers' not in kw:
kw['headers'] = {}
headers = {'Content-type': 'application/json', 'Accept': 'application/json'}
for header, value in headers.items():
kw['headers'][header] = value
return kw
class ResourceBase(object... | {
"repo_name": "robinson96/GRAPE",
"path": "stashy/stashy/helpers.py",
"copies": "1",
"size": "2986",
"license": "bsd-3-clause",
"hash": -4368691419311598000,
"line_mean": 24.9652173913,
"line_max": 82,
"alpha_frac": 0.5261219022,
"autogenerated": false,
"ratio": 4.378299120234604,
"config_test"... |
from .errors import *
from .forums import Forum, IdFactory
from .actors import Actor
class ClientForum(Forum):
def __init__(self, pipe):
super().__init__()
self.pipe = pipe
self.pipe.lock()
from collections import OrderedDict
self.actor_id_factory = None
self.resp... | {
"repo_name": "kxgames/kxg",
"path": "kxg/multiplayer.py",
"copies": "1",
"size": "15540",
"license": "mit",
"hash": 3705370629995579000,
"line_mean": 38.4416243655,
"line_max": 114,
"alpha_frac": 0.6077220077,
"autogenerated": false,
"ratio": 4.769797421731123,
"config_test": false,
"has_no_... |
from ..errors import *
from . import numbers, colas, pilas
from ..logger import ppLogger
logger = ppLogger(__name__)
_varsTable = dict()
reserved = numbers.reserved + colas.reserved + pilas.reserved
classmap = numbers.classmap
classmap.update(colas.classmap)
classmap.update(pilas.classmap)
def _getVarClass(typ):
... | {
"repo_name": "jrmsgit/pseudoParser",
"path": "lib/pseudoParser/vartypes/__init__.py",
"copies": "1",
"size": "1482",
"license": "bsd-3-clause",
"hash": -3775979719775244300,
"line_mean": 19.301369863,
"line_max": 61,
"alpha_frac": 0.6484480432,
"autogenerated": false,
"ratio": 3.139830508474576,... |
from errors import *
from . import VERSION
from decorators import PublicMethod
from serializers import DefaultJSONEncoder
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import classonlymethod
from django.utils import simplejson
from django.http import HttpResponse
from django.views.g... | {
"repo_name": "anaoum/django-json-rpc",
"path": "djangojsonrpc/views.py",
"copies": "1",
"size": "3275",
"license": "mit",
"hash": -244455711907752640,
"line_mean": 27.4782608696,
"line_max": 114,
"alpha_frac": 0.6882442748,
"autogenerated": false,
"ratio": 3.4329140461215935,
"config_test": fa... |
from ..errors import *
from ..logger import ppLogger
logger = ppLogger(__name__)
class baseVar(object):
_typ = None
_val = None
_ID = None
def __init__(self, typ, ID):
self._typ = typ
self._ID = ID
def __str__(self):
return str(self._val)
def __repr__(self):
... | {
"repo_name": "jrmsgit/pseudoParser",
"path": "lib/pseudoParser/vartypes/base.py",
"copies": "1",
"size": "1282",
"license": "bsd-3-clause",
"hash": 2063956572098377200,
"line_mean": 25.1632653061,
"line_max": 72,
"alpha_frac": 0.5600624025,
"autogenerated": false,
"ratio": 3.631728045325779,
"... |
from ...errors import *
from ...metadata import Field, FieldList
__all__ = (
"prepare_key",
"zip_condition",
"join_on_clause"
)
def prepare_key(key):
"""Returns a list of columns for `key`. Key might be a list of fields or
just one field represented by `Field` objec... | {
"repo_name": "bijoyabraham/bubbles",
"path": "bubbles/backends/sql/utils.py",
"copies": "4",
"size": "1247",
"license": "mit",
"hash": 4810352211913796000,
"line_mean": 24.4489795918,
"line_max": 76,
"alpha_frac": 0.5966319166,
"autogenerated": false,
"ratio": 3.483240223463687,
"config_test":... |
from errors import *
from parse import *
from nodes import *
from func import *
from loop import *
from ifelse import *
class FlatNode(object):
pass
class Code(FlatNode):
def __init__(self, words):
self.words = words
class GoTo(FlatNode):
def __init__(self, index):
self.index = index
class Branch(FlatNode):... | {
"repo_name": "gvx/deja",
"path": "flatten.py",
"copies": "1",
"size": "5365",
"license": "isc",
"hash": 6663773289697025000,
"line_mean": 28.8055555556,
"line_max": 67,
"alpha_frac": 0.6745573159,
"autogenerated": false,
"ratio": 3.088658606793322,
"config_test": false,
"has_no_keywords": fa... |
from errors import *
import importlib
from notification import *
import numpy
server = sys.modules['__main__']
__commands__ = {}
def execute_command(*info):
info = list(info)
if info[0] not in __commands__.keys():
raise NoSuchCommand(info[0])
current_command = __commands__[info[0]]
for i in... | {
"repo_name": "barak-obama/Game-Of-Life",
"path": "backend/commander.py",
"copies": "1",
"size": "1831",
"license": "mit",
"hash": 4816142551904688000,
"line_mean": 17.6836734694,
"line_max": 87,
"alpha_frac": 0.6105953031,
"autogenerated": false,
"ratio": 3.234982332155477,
"config_test": fals... |
from errors import *
import json
import requests
import re
class BaseCriteria(object):
def __init__(self, resource):
self.resource = resource
def __iter__(self):
return self.all()
def all(self):
resp = self.request()
return [self.resource.get_from(o) for o in ... | {
"repo_name": "satrails/brokerest",
"path": "brokerest/base.py",
"copies": "1",
"size": "6224",
"license": "mit",
"hash": 2957156239575782000,
"line_mean": 28.9230769231,
"line_max": 126,
"alpha_frac": 0.518155527,
"autogenerated": false,
"ratio": 4.052083333333333,
"config_test": false,
"has... |
from errors import *
import sys
sys.path.append("core/include")
sys.path.append("core/include/simplejson")
sys.path.append("include")
import time
import gui
import os
import pygame
pygame.font.init()
import random
import pickle
import re
import textutil
import registry
import zipfile
import simplejson as json
ImgFont =... | {
"repo_name": "crxtrdude/pywright",
"path": "core/core.py",
"copies": "1",
"size": "165103",
"license": "bsd-3-clause",
"hash": 8810661290406811000,
"line_mean": 36.9983889528,
"line_max": 158,
"alpha_frac": 0.5189184933,
"autogenerated": false,
"ratio": 3.583664344164442,
"config_test": false,... |
from errors import *
class GenericParser(object):
def __init__(self, start='root'):
"""
Create the parse, so that its top level grammar element is given
by the start parameter. This defaults to 'root'.
"""
self.rules = {}
self.rule2func = {}
self.rule2name = ... | {
"repo_name": "idmillington/sparkle",
"path": "sparkle/parser.py",
"copies": "1",
"size": "12698",
"license": "mit",
"hash": -7606568724081236000,
"line_mean": 34.568627451,
"line_max": 78,
"alpha_frac": 0.4749566861,
"autogenerated": false,
"ratio": 4.338230269900922,
"config_test": false,
"... |
from errors import *
commands = {}
class MetaCommand(type):
def __new__(cls, name, bases, klassDict):
stepsd = {}
for name, x in klassDict.items():
try:
stepsd[x._step_idx] = x
except AttributeError:
pass
steps = []
for step ... | {
"repo_name": "bozaro/git-svnserver",
"path": "GitSvnServer/cmd_base.py",
"copies": "3",
"size": "3878",
"license": "bsd-3-clause",
"hash": -7231638884693799000,
"line_mean": 23.858974359,
"line_max": 79,
"alpha_frac": 0.6044352759,
"autogenerated": false,
"ratio": 4.082105263157895,
"config_te... |
from ..errors import *
from .core import Context, Object, BoundObject, Type
from .links import BoundLink, ContextLink
#
# Constant
#
class Constant(BoundLink):
assigned = False
def __init__(self, value:Object, tokens = None):
BoundLink.__init__(self, value, tokens)
def verifyAssignment(self, va... | {
"repo_name": "pektin/jam",
"path": "compiler/lekvar/modifiers.py",
"copies": "2",
"size": "1727",
"license": "mit",
"hash": 7083911121975499000,
"line_mean": 24.3970588235,
"line_max": 81,
"alpha_frac": 0.6548928778,
"autogenerated": false,
"ratio": 4.1119047619047615,
"config_test": false,
... |
from ..errors import *
from .core import Context, Object, BoundObject, Type
from .util import resolveAttribute
class Link(Type):
value = None
def __init__(self, value:Object, tokens = None):
Type.__init__(self, tokens)
self.value = value
def __eq__(self, other):
return self.value... | {
"repo_name": "CameronLonsdale/jam",
"path": "compiler/lekvar/links.py",
"copies": "2",
"size": "3636",
"license": "mit",
"hash": 2588472746828659700,
"line_mean": 24.075862069,
"line_max": 82,
"alpha_frac": 0.6207370737,
"autogenerated": false,
"ratio": 4.062569832402235,
"config_test": false,... |
from errors import *
from nodes import *
from ifelse import *
from loop import *
from func import *
from trycatch import *
from strquot import unquote
STATEMENTS = set('func labda local if elseif else while for try catch repeat'.split())
STATEMENT_CLASS = {'func': FuncStatement, 'labda': LabdaStatement,
'local': Lo... | {
"repo_name": "gvx/deja",
"path": "context.py",
"copies": "1",
"size": "6663",
"license": "isc",
"hash": 6209363050473851000,
"line_mean": 33.8848167539,
"line_max": 149,
"alpha_frac": 0.6908299565,
"autogenerated": false,
"ratio": 3.250243902439024,
"config_test": false,
"has_no_keywords": f... |
from ..errors import *
from .state import State
from .core import Context, Object, BoundObject, Type
#
# Assignment
#
# Assignment instructions allow for saving values inside of variables.
class Assignment(Object):
assigned = None
value = None
scope = None
def __init__(self, assigned:Object, value:O... | {
"repo_name": "CameronLonsdale/jam",
"path": "compiler/lekvar/assignment.py",
"copies": "2",
"size": "1155",
"license": "mit",
"hash": -3001488658189265000,
"line_mean": 25.25,
"line_max": 70,
"alpha_frac": 0.6372294372,
"autogenerated": false,
"ratio": 4.230769230769231,
"config_test": false,
... |
from ..errors import *
from .state import State
from .links import BoundLink
from .variable import Variable
from .assignment import InferVariable
class Identifier(BoundLink):
name = None
def __init__(self, name:str, tokens = None):
BoundLink.__init__(self, None, tokens)
self.name = name
... | {
"repo_name": "pektin/jam",
"path": "compiler/lekvar/identifier.py",
"copies": "2",
"size": "1951",
"license": "mit",
"hash": -1015609773705437000,
"line_mean": 30.4677419355,
"line_max": 130,
"alpha_frac": 0.6217324449,
"autogenerated": false,
"ratio": 4.3452115812917596,
"config_test": false,... |
from ..errors import *
from .state import State
from .stats import ScopeStats
from .core import Context, Object, BoundObject, Scope, Type
from .closure import Closure
from .function import Function, FunctionType, Return
from .method import Method, MethodType
from .variable import Variable
class Class(Type, Closure):
... | {
"repo_name": "pektin/jam",
"path": "compiler/lekvar/class_.py",
"copies": "2",
"size": "4617",
"license": "mit",
"hash": -1476003471744222500,
"line_mean": 35.0703125,
"line_max": 115,
"alpha_frac": 0.6426250812,
"autogenerated": false,
"ratio": 4.443695861405197,
"config_test": false,
"has_... |
from ..errors import *
from .state import State
from .stats import ScopeStats
from .core import Context, Object, BoundObject, Scope, Type
from .function import Function
class Module(Type, Scope):
verified = False
context = None
type = None
def __init__(self, name:str, children:[BoundObject], main:[Ob... | {
"repo_name": "CameronLonsdale/jam",
"path": "compiler/lekvar/module.py",
"copies": "2",
"size": "1117",
"license": "mit",
"hash": -6787175906773710000,
"line_mean": 24.3863636364,
"line_max": 92,
"alpha_frac": 0.6168307968,
"autogenerated": false,
"ratio": 4.263358778625954,
"config_test": fal... |
from ..errors import *
from .state import State
from .stats import Stats, ScopeStats
from .core import Context, Object, BoundObject, SoftScope, Scope, Type
from .util import checkCompatibility
from .function import Function, FunctionType
from .forward import ForwardObject, ForwardTarget
# Python Predefines
Method = N... | {
"repo_name": "pektin/jam",
"path": "compiler/lekvar/method.py",
"copies": "2",
"size": "6469",
"license": "mit",
"hash": 6924451227752887000,
"line_mean": 32.1743589744,
"line_max": 119,
"alpha_frac": 0.5962281651,
"autogenerated": false,
"ratio": 4.327090301003344,
"config_test": false,
"ha... |
from ..errors import *
from .util import *
from .state import State
from .stats import Stats, ScopeStats
from .core import Context, Object, BoundObject, SoftScope, Scope, Type
from .util import checkCompatibility
from .links import BoundLink
from .closure import Closure
from .variable import Variable
from .forward imp... | {
"repo_name": "pektin/jam",
"path": "compiler/lekvar/function.py",
"copies": "2",
"size": "7750",
"license": "mit",
"hash": -3612515125300395500,
"line_mean": 32.1196581197,
"line_max": 142,
"alpha_frac": 0.6282580645,
"autogenerated": false,
"ratio": 4.332029066517608,
"config_test": false,
... |
from .errors import NoDataError, NoDifferenceError
from .models import *
from .authentication import AuthorizationError
import time
import json
try:
from json.decoder import JSONDecodeError
except ImportError:
JSONDecodeError = ValueError
class Schoology:
key = ''
secret = ''
limit = 20
start... | {
"repo_name": "ErikBoesen/schoolopy",
"path": "schoolopy/main.py",
"copies": "1",
"size": "87523",
"license": "mit",
"hash": -904486912939929000,
"line_mean": 39.9368568756,
"line_max": 217,
"alpha_frac": 0.6286461844,
"autogenerated": false,
"ratio": 3.6553207484129637,
"config_test": false,
... |
from ..errors import NotLoadedError
from .base_types import TypedValueType, AnyValueType
__all__ = ["LazyValue", "LazyValueType"]
class LazyValue:
"""Unlike "regular" (not lazy) values such as strings or ints or generally
objects that can be constructed from the DB with a non-blocking
non-coroutine func... | {
"repo_name": "lars-tiede/aiorethink",
"path": "aiorethink/values_and_valuetypes/lazy.py",
"copies": "1",
"size": "5371",
"license": "mit",
"hash": -4821362642369781000,
"line_mean": 30.226744186,
"line_max": 79,
"alpha_frac": 0.6212995718,
"autogenerated": false,
"ratio": 4.017202692595363,
"c... |
from .errors import NotRegistered
# Delete rules
DO_NOTHING = 0
NULLIFY = 1
CASCADE = 2
DENY = 3
PULL = 4
ALLOW_INHERITANCE = False
_document_registry = {}
def get_document(name):
doc = _document_registry.get(name, None)
if not doc:
# Possible old style name
single_end = name.split('.')[-1]
... | {
"repo_name": "NamPNQ/rethinkengine",
"path": "rethinkengine/common.py",
"copies": "1",
"size": "1956",
"license": "mit",
"hash": 8479410007508849000,
"line_mean": 31.6,
"line_max": 77,
"alpha_frac": 0.6160531697,
"autogenerated": false,
"ratio": 4.032989690721649,
"config_test": false,
"has_... |
from errors import OperatorNotSupported, ConditionNotSupported
class Primitive(object):
def __init__(self):
self.value = None
class PredicateExpression(object):
def __init__(self):
self.left_operand = None
self.operand = None
self.right_operand = None
def __str__(self):
... | {
"repo_name": "crs4/pyEHR",
"path": "pyehr/aql/model.py",
"copies": "2",
"size": "9435",
"license": "mit",
"hash": 3824181751333341700,
"line_mean": 26.4302325581,
"line_max": 114,
"alpha_frac": 0.5562268151,
"autogenerated": false,
"ratio": 3.698549588396707,
"config_test": false,
"has_no_ke... |
from ..errors import ParameterMissing
from ._base import Field
from .playlist import PlaylistModel, AudioField
class AdItem(PlaylistModel):
title = Field("title")
company_name = Field("companyName")
tracking_tokens = Field("adTrackingTokens")
audio_url = AudioField("audioUrl")
image_url = Field("... | {
"repo_name": "mcrute/pydora",
"path": "pandora/models/ad.py",
"copies": "1",
"size": "1280",
"license": "mit",
"hash": -2049590590559352000,
"line_mean": 23.6153846154,
"line_max": 74,
"alpha_frac": 0.60703125,
"autogenerated": false,
"ratio": 4.224422442244224,
"config_test": false,
"has_no... |
from ..errors import PardotAPIArgumentError
class EmailTemplates(object):
"""
A class to query and use Pardot email templates.
"""
def __init__(self, client):
self.client = client
def read(self, emailTemplateID=None, **kwargs):
"""
Returns the data for the email template ... | {
"repo_name": "mneedham91/PyPardot4",
"path": "pypardot/objects/emailtemplates.py",
"copies": "1",
"size": "1519",
"license": "mit",
"hash": 5560410809974720000,
"line_mean": 36.975,
"line_max": 122,
"alpha_frac": 0.6392363397,
"autogenerated": false,
"ratio": 4.290960451977401,
"config_test": ... |
from ..errors import PardotAPIArgumentError
class ListMemberships(object):
"""
A class to query and use Pardot list memberships.
Prospect field reference: http://developer.pardot.com/kb/object-field-references#list-membership
"""
def __init__(self, client):
self.client = client
def q... | {
"repo_name": "mneedham91/PyPardot4",
"path": "pypardot/objects/listmemberships.py",
"copies": "1",
"size": "6130",
"license": "mit",
"hash": -1649822447617071400,
"line_mean": 47.6507936508,
"line_max": 155,
"alpha_frac": 0.6445350734,
"autogenerated": false,
"ratio": 3.9960886571056062,
"conf... |
from ..errors import PardotAPIArgumentError
class Prospects(object):
"""
A class to query and use Pardot prospects.
Prospect field reference: http://developer.pardot.com/kb/api-version-3/object-field-references/#prospect
"""
def __init__(self, client):
self.client = client
def query(... | {
"repo_name": "joshgeller/PyPardot",
"path": "pypardot/objects/prospects.py",
"copies": "1",
"size": "9085",
"license": "mit",
"hash": 1567759353371426800,
"line_mean": 47.5828877005,
"line_max": 122,
"alpha_frac": 0.6470005504,
"autogenerated": false,
"ratio": 4.0978800180423995,
"config_test"... |
from ..errors import PardotAPIArgumentError
class Prospects(object):
"""
A class to query and use Pardot prospects.
Prospect field reference: http://developer.pardot.com/kb/object-field-references#prospect
"""
def __init__(self, client):
self.client = client
def query(self, **kwargs)... | {
"repo_name": "mneedham91/PyPardot4",
"path": "pypardot/objects/prospects.py",
"copies": "1",
"size": "11212",
"license": "mit",
"hash": -1332630243782037800,
"line_mean": 47.752173913,
"line_max": 149,
"alpha_frac": 0.6454691402,
"autogenerated": false,
"ratio": 4.08749544294568,
"config_test"... |
from .errors import ParserGeneratorError
def rightmost_terminal(symbols, terminals):
for sym in reversed(symbols):
if sym in terminals:
return sym
return None
class Grammar(object):
def __init__(self, terminals):
# A list of all the productions.
self.productions = [No... | {
"repo_name": "eddiejessup/nex",
"path": "nex/rply/grammar.py",
"copies": "1",
"size": "7154",
"license": "mit",
"hash": -5060369271360994000,
"line_mean": 30.7955555556,
"line_max": 78,
"alpha_frac": 0.4765166341,
"autogenerated": false,
"ratio": 4.273596176821983,
"config_test": false,
"has... |
from .errors import PluginException
from .logging import logger
from .helpers import formatting as f
from .transaction import Transaction
from .decorators.validator import COMMAND_VALIDATORS_ATTR
from time import time
from inspect import getmembers, isfunction
from functools import partial
from traceback import format... | {
"repo_name": "best-coloc-ever/globibot",
"path": "bot/src/globibot/lib/plugin.py",
"copies": "1",
"size": "6539",
"license": "mit",
"hash": 6298623515179827000,
"line_mean": 27.3073593074,
"line_max": 81,
"alpha_frac": 0.5867869705,
"autogenerated": false,
"ratio": 4.251625487646294,
"config_t... |
from ..errors import PluginException
from time import time
from collections import defaultdict
class NotMasterError(PluginException):
def error(self, message):
return (
'{} You\'re not the boss of me'
.format(message.author.mention)
)
def master_only(bot, message):
... | {
"repo_name": "best-coloc-ever/globibot",
"path": "bot/src/globibot/lib/helpers/hooks.py",
"copies": "1",
"size": "1675",
"license": "mit",
"hash": 3222378686149201400,
"line_mean": 24,
"line_max": 70,
"alpha_frac": 0.5934328358,
"autogenerated": false,
"ratio": 3.9504716981132075,
"config_test... |
from .errors import ProtocolError, ReplyError
__all__ = [
'Reader', 'PyReader',
]
class PyReader:
"""Pure-Python Redis protocol parser that follows hiredis.Reader
interface (except setmaxbuf/getmaxbuf).
"""
def __init__(self, protocolError=ProtocolError, replyError=ReplyError,
en... | {
"repo_name": "ymap/aioredis",
"path": "aioredis/parser.py",
"copies": "1",
"size": "4907",
"license": "mit",
"hash": -3306539640030872600,
"line_mean": 28.9207317073,
"line_max": 76,
"alpha_frac": 0.5155899735,
"autogenerated": false,
"ratio": 4.263249348392702,
"config_test": false,
"has_no... |
from errors import *
try: import cPickle as pickle
except: import pickle as pickle
import zlib
def EncodeData(data,compress):
data = pickle.dumps(data,-1)
if compress != False:
data = zlib.compress(data,compress)
length = str(len(data))
#if len(data) > 100:
#print "LENGTH!! " + ... | {
"repo_name": "remremrem/EV-Tribute",
"path": "world/Net/communicate.py",
"copies": "1",
"size": "1502",
"license": "mit",
"hash": -2022375150352176600,
"line_mean": 30,
"line_max": 78,
"alpha_frac": 0.620505992,
"autogenerated": false,
"ratio": 3.8414322250639388,
"config_test": false,
"has_... |
from errors import *
try: import cPickle as pickle
except: import pickle as pickle
import zlib
def EncodeData(data,compress):
data = pickle.dumps(data)
if compress != False:
data = zlib.compress(data,compress)
length = str(len(data))
length = ("0"*(8-len(length)))+length
retur... | {
"repo_name": "remremrem/EV-Tribute",
"path": "server/Net/communicate.py",
"copies": "1",
"size": "1754",
"license": "mit",
"hash": 7536927537501144000,
"line_mean": 29.3214285714,
"line_max": 78,
"alpha_frac": 0.5935005701,
"autogenerated": false,
"ratio": 3.8719646799116996,
"config_test": fa... |
from .errors import RuntimeError
from .lexer import LexicalAnalyser
from .ast import SyntaxTree
class Interpreter(object):
def __init__(self, filename):
self.filename = filename
self.variables = { }
self.subroutines = { }
def get_variable(self, identifier):
try:
ret... | {
"repo_name": "thomasleese/barebones",
"path": "barebones/interpreter.py",
"copies": "2",
"size": "4058",
"license": "mit",
"hash": 1545202239099413800,
"line_mean": 31.9918699187,
"line_max": 67,
"alpha_frac": 0.5749137506,
"autogenerated": false,
"ratio": 4.04183266932271,
"config_test": fals... |
from errors import script_error
import pickle
import zlib
import os,sys
sys.path.append("core/include")
sys.path.append("include")
if sys.platform=="win32":
os.environ['SDL_VIDEODRIVER']='windib'
import random
from core import *
import gui
import save
from pwvlib import *
import settings
import tools_menu
try:
... | {
"repo_name": "crxtrdude/pywright",
"path": "core/libengine.py",
"copies": "1",
"size": "28215",
"license": "bsd-3-clause",
"hash": -7884754714530457000,
"line_mean": 40.4926470588,
"line_max": 140,
"alpha_frac": 0.5200779727,
"autogenerated": false,
"ratio": 3.7539914848323575,
"config_test": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.