text
stringlengths
0
1.05M
meta
dict
# Base Classes from datetime import datetime class BaseExtractor: """ Basic scrapy extraction class. """ @classmethod def _xt(cls, response): """ Extract based on the classes XPATH expression """ value = response.xpath(cls.XPATH).extract() return value cl...
{ "repo_name": "laszlokiraly/OffenesParlament", "path": "offenesparlament/op_scraper/scraper/parlament/resources/extractors/__init__.py", "copies": "2", "size": "1493", "license": "bsd-2-clause", "hash": 869788124269075600, "line_mean": 21.9692307692, "line_max": 70, "alpha_frac": 0.5445411922, "aut...
""" base classes """ from __future__ import unicode_literals try: import urlparse except ImportError: from urllib import parse as urlparse from dandelion.cache.base import NoCache from dandelion.utils import AttributeDict from model import tweets_chunk class DandelionConfig(dict): """ class for storing t...
{ "repo_name": "DataSciencePolimi/social-knowledge-extractor", "path": "utils/dandelion_interface.py", "copies": "2", "size": "4543", "license": "apache-2.0", "hash": 3658701007848627700, "line_mean": 31.9202898551, "line_max": 76, "alpha_frac": 0.5989434295, "autogenerated": false, "ratio": 3.729...
"""Base classes """ import datetime class transaction: """Base transaction class @author ykk @date Dec 2010 """ def __init__(self, date=None,amount=None, description=None,type=None): """Initialize """ ##Date of transaction self.date = date ...
{ "repo_name": "yapkke/PyFinance", "path": "pyfinance/pyf.py", "copies": "1", "size": "4726", "license": "apache-2.0", "hash": -8672647976651367000, "line_mean": 28.1728395062, "line_max": 84, "alpha_frac": 0.5247566653, "autogenerated": false, "ratio": 4.3799814643188135, "config_test": false, ...
"""Base classes.""" import os import sys from .. import database from .. import package from .. import system from .. import utils class Installer(object): """Simple installer for one application.""" appname = None no_daemon = False daemon_name = None packages = {} with_user = False wit...
{ "repo_name": "modoboa/modoboa-installer", "path": "modoboa_installer/scripts/base.py", "copies": "1", "size": "5458", "license": "mit", "hash": -185339976076385950, "line_mean": 32.0787878788, "line_max": 79, "alpha_frac": 0.5721876145, "autogenerated": false, "ratio": 4.073134328358209, "conf...
# Base classes class _ScandinavianStemmer(object): """ This subclass encapsulates a method for defining the string region R1. It is used by the Danish, Norwegian, and Swedish stemmer. """ def _r1_scandinavian(self, word, vowels): """ Return the region R1 that is used by the Scan...
{ "repo_name": "wuga214/Django-Wuga", "path": "env/lib/python2.7/site-packages/whoosh/lang/snowball/bases.py", "copies": "96", "size": "4874", "license": "apache-2.0", "hash": -9069660661931592000, "line_mean": 35.6466165414, "line_max": 77, "alpha_frac": 0.5644234715, "autogenerated": false, "rat...
"""Base classes that are extended by low level AMQP frames and higher level AMQP classes and methods. """ class AMQPObject(object): """Base object that is extended by AMQP low level frames and AMQP classes and methods. """ NAME = 'AMQPObject' INDEX = None def __repr__(self): items = ...
{ "repo_name": "bitemyapp/Suns", "path": "src/pika/amqp_object.py", "copies": "3", "size": "1654", "license": "bsd-3-clause", "hash": 2912106474789778400, "line_mean": 24.4461538462, "line_max": 77, "alpha_frac": 0.6015719468, "autogenerated": false, "ratio": 4.073891625615763, "config_test": fa...
"""Base classes that are extended by low level AMQP frames and higher level AMQP classes and methods. """ class AMQPObject(object): """Base object that is extended by AMQP low level frames and AMQP classes and methods. """ NAME = 'AMQPObject' INDEX = None def __repr__(self): items =...
{ "repo_name": "pika/pika", "path": "pika/amqp_object.py", "copies": "1", "size": "1830", "license": "bsd-3-clause", "hash": -2238251188755044000, "line_mean": 24.7746478873, "line_max": 77, "alpha_frac": 0.593442623, "autogenerated": false, "ratio": 4.048672566371682, "config_test": false, "h...
"""Base classes to benchmark timing of base class methods. The idea is to use these classes to compare timing with the current classes to see if adding features has slowed any methods. The classes are named TimingGraph, TimingDiGraph, TimingMultiGraph and TimingMultiDiGraph """ # Copyright (C) 2004-2015 by # A...
{ "repo_name": "ionanrozenfeld/networkx", "path": "networkx/classes/tests/timingclasses.py", "copies": "12", "size": "151849", "license": "bsd-3-clause", "hash": -5768631120326140000, "line_mean": 30.3737603306, "line_max": 90, "alpha_frac": 0.5213666208, "autogenerated": false, "ratio": 4.0782349...
"""Base classes to manage a Client's interaction with a running kernel""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import absolute_import import atexit import errno from threading import Thread import time import zmq # import ZMQError in to...
{ "repo_name": "mattvonrocketstein/smash", "path": "smashlib/ipy3x/kernel/channels.py", "copies": "1", "size": "22741", "license": "mit", "hash": 7386994611373711000, "line_mean": 33.7190839695, "line_max": 95, "alpha_frac": 0.579394046, "autogenerated": false, "ratio": 4.57105527638191, "config...
"""Base classes to manage a Client's interaction with a running kernel""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import absolute_import import atexit import errno from threading import Thread import time import zmq # import ZMQError in to...
{ "repo_name": "unnikrishnankgs/va", "path": "venv/lib/python3.5/site-packages/jupyter_client/channels.py", "copies": "2", "size": "6726", "license": "bsd-2-clause", "hash": 8043502995752517000, "line_mean": 31.6504854369, "line_max": 88, "alpha_frac": 0.5617008623, "autogenerated": false, "ratio"...
"""Base classes to manage a Client's interaction with a running kernel""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import atexit import errno from threading import Thread, Event import time import asyncio import zmq # import ZMQError in top-level namespace,...
{ "repo_name": "sserrot/champion_relationships", "path": "venv/Lib/site-packages/jupyter_client/channels.py", "copies": "1", "size": "7016", "license": "mit", "hash": 3265878017555179000, "line_mean": 31.9389671362, "line_max": 88, "alpha_frac": 0.5634264538, "autogenerated": false, "ratio": 4.618...
"""Base classes to manage a Client's interaction with a running kernel """ #----------------------------------------------------------------------------- # Copyright (C) 2013 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as ...
{ "repo_name": "omni5cience/django-inlineformfield", "path": ".tox/py27/lib/python2.7/site-packages/IPython/kernel/channels.py", "copies": "7", "size": "22504", "license": "mit", "hash": 3871568766558558700, "line_mean": 34.4952681388, "line_max": 148, "alpha_frac": 0.5709651617, "autogenerated": fa...
"""Base classes used by the template engine.""" import re from moody.errors import TemplateRenderError class Context: """The state of a template during render time.""" __slots__ = ("params", "meta", "buffer") def __init__(self, params, meta, buffer): """Initializes the Context.""" ...
{ "repo_name": "etianen/moody-templates", "path": "src/moody/base.py", "copies": "1", "size": "4339", "license": "bsd-3-clause", "hash": 7400587353994846000, "line_mean": 29.780141844, "line_max": 129, "alpha_frac": 0.5722516709, "autogenerated": false, "ratio": 4.3828282828282825, "config_test"...
"""Base classes used throughout the library.""" import abc import logging import requests import six from objectrocket import errors from objectrocket import util from stevedore.extension import ExtensionManager log = logging.getLogger(__name__) @six.add_metaclass(abc.ABCMeta) class BaseOperationsLayer(object): ...
{ "repo_name": "objectrocket/python-client", "path": "objectrocket/bases.py", "copies": "1", "size": "11283", "license": "mit", "hash": -5534784098778643000, "line_mean": 30.5167597765, "line_max": 99, "alpha_frac": 0.5946113622, "autogenerated": false, "ratio": 4.495219123505976, "config_test":...
"""Base class extended by connection adapters. This extends the connection.Connection class to encapsulate connection behavior but still isolate socket and low level communication. """ import errno import logging import socket import ssl from pika import connection from pika import exceptions LOGGER = logging.getLog...
{ "repo_name": "kevenli/Flowy", "path": "runtime/pika/adapters/base_connection.py", "copies": "3", "size": "14004", "license": "apache-2.0", "hash": 128431362926691970, "line_mean": 36.1458885942, "line_max": 80, "alpha_frac": 0.5885461297, "autogenerated": false, "ratio": 4.426042983565107, "co...
import abc class Device(object): """Base class for a BLE device.""" __metaclass__ = abc.ABCMeta @abc.abstractmethod def connect(self, timeout_sec): """Connect to the BLE device.""" raise NotImplementedError @abc.abstractmethod def disconnect(self, timeout_sec): """Dis...
{ "repo_name": "adafruit/Adafruit_Python_BluefruitLE", "path": "Adafruit_BluefruitLE/interfaces/device.py", "copies": "2", "size": "3958", "license": "mit", "hash": 269794419584721900, "line_mean": 35.6481481481, "line_max": 81, "alpha_frac": 0.6803941385, "autogenerated": false, "ratio": 4.751500...
# Base class for a BLE provider. Each OS supported by the library should # inherit from this class and implement the abstract methods, then update the # platform.py code to detect when the platform is present and use the # implementation of this provider base class. # Author: Tony DiCola # # Note that platform.py will...
{ "repo_name": "adafruit/Adafruit_Python_BluefruitLE", "path": "Adafruit_BluefruitLE/interfaces/provider.py", "copies": "1", "size": "6104", "license": "mit", "hash": -820709287421487500, "line_mean": 41.6853146853, "line_max": 82, "alpha_frac": 0.6679226737, "autogenerated": false, "ratio": 4.720...
"""Base class for Acmeda Roller Blinds.""" import aiopulse from homeassistant.core import callback from homeassistant.helpers import entity from homeassistant.helpers.device_registry import async_get_registry as get_dev_reg from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helper...
{ "repo_name": "partofthething/home-assistant", "path": "homeassistant/components/acmeda/base.py", "copies": "5", "size": "2901", "license": "mit", "hash": -3763396979030670300, "line_mean": 32.3448275862, "line_max": 89, "alpha_frac": 0.6335746294, "autogenerated": false, "ratio": 3.9958677685950...
"""Base class for a Comm""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import threading import uuid from zmq.eventloop.ioloop import IOLoop from IPython.config import LoggingConfigurable from IPython.kernel.zmq.kernelbase import Kernel from IPython.utils.js...
{ "repo_name": "martydill/url_shortener", "path": "code/venv/lib/python2.7/site-packages/IPython/kernel/comm/comm.py", "copies": "4", "size": "5942", "license": "mit", "hash": -6715598189418174000, "line_mean": 34.1597633136, "line_max": 113, "alpha_frac": 0.5890272635, "autogenerated": false, "ra...
"""Base class for a Comm""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import uuid from IPython.config import LoggingConfigurable from IPython.kernel.zmq.kernelbase import Kernel from IPython.utils.jsonutil import json_clean from IPython.utils.traitlets impo...
{ "repo_name": "mattvonrocketstein/smash", "path": "smashlib/ipy3x/kernel/comm/comm.py", "copies": "1", "size": "5568", "license": "mit", "hash": -950136650026092900, "line_mean": 32.3413173653, "line_max": 85, "alpha_frac": 0.5761494253, "autogenerated": false, "ratio": 4.202264150943396, "conf...
"""Base class for a Comm""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import uuid from traitlets.config import LoggingConfigurable from ipykernel.kernelbase import Kernel from ipykernel.jsonutil import json_clean from traitlets import Instance, Unicode, Byt...
{ "repo_name": "Edu-Glez/Bank_sentiment_analysis", "path": "env/lib/python3.6/site-packages/ipykernel/comm/comm.py", "copies": "8", "size": "5366", "license": "apache-2.0", "hash": 7894301540276033000, "line_mean": 31.7195121951, "line_max": 89, "alpha_frac": 0.5874021618, "autogenerated": false, ...
"""Base class for a device entity integrated in devolo Home Control.""" import logging from homeassistant.helpers.entity import Entity from .const import DOMAIN from .subscriber import Subscriber _LOGGER = logging.getLogger(__name__) class DevoloDeviceEntity(Entity): """Abstract representation of a device with...
{ "repo_name": "kennedyshead/home-assistant", "path": "homeassistant/components/devolo_home_control/devolo_device.py", "copies": "6", "size": "3445", "license": "apache-2.0", "hash": -5811184140688823000, "line_mean": 32.7745098039, "line_max": 93, "alpha_frac": 0.6124818578, "autogenerated": false,...
"""Base class for a front page source, as well as a handful of specific implementations. """ from collections import namedtuple import datetime import re import subprocess from subprocess import PIPE from urllib2 import URLError import feedparser import lxml.html from pylons import cache from spline.lib import help...
{ "repo_name": "veekun/spline", "path": "splinext/frontpage/sources.py", "copies": "1", "size": "13245", "license": "mit", "hash": -5397109554335537000, "line_mean": 33.1365979381, "line_max": 83, "alpha_frac": 0.5675349188, "autogenerated": false, "ratio": 4.415, "config_test": false, "has_no...
"""Base class for a job.""" import logging import os import socket from ndscheduler import constants from ndscheduler import utils from ndscheduler.core import scheduler_manager from ndscheduler import url_request from ndscheduler.server.handlers import jobs logger = logging.getLogger(__name__) class JobBase: ...
{ "repo_name": "DurgaChowdary/ndscheduler", "path": "ndscheduler/job.py", "copies": "1", "size": "4947", "license": "bsd-2-clause", "hash": 7002838275833952000, "line_mean": 33.838028169, "line_max": 115, "alpha_frac": 0.5577117445, "autogenerated": false, "ratio": 4.370141342756184, "config_tes...
"""Base class for a kernel that talks to frontends over 0MQ.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import print_function from datetime import datetime from functools import partial import itertools import logging from signal import sig...
{ "repo_name": "sserrot/champion_relationships", "path": "venv/Lib/site-packages/ipykernel/kernelbase.py", "copies": "1", "size": "33132", "license": "mit", "hash": 8519328673792852000, "line_mean": 34.8571428571, "line_max": 113, "alpha_frac": 0.5690269226, "autogenerated": false, "ratio": 4.3854...
"""Base class for all bcp clients.""" import abc from mpf.core.mpf_controller import MpfController class BaseBcpClient(MpfController, metaclass=abc.ABCMeta): """Base class for bcp clients.""" __slots__ = ["name", "bcp", "exit_on_close"] def __init__(self, machine, name, bcp): """Initialise cli...
{ "repo_name": "missionpinball/mpf", "path": "mpf/core/bcp/bcp_client.py", "copies": "1", "size": "1085", "license": "mit", "hash": 2360275980760212500, "line_mean": 27.5526315789, "line_max": 60, "alpha_frac": 0.6267281106, "autogenerated": false, "ratio": 4.520833333333333, "config_test": fals...
""" Base class for all cache implementations """ from datetime import datetime import logging from pkg_resources import parse_version from pyramid.settings import asbool import posixpath from pypicloud.models import Package from pypicloud.storage import get_storage_impl from pypicloud.util import create_matcher, pars...
{ "repo_name": "rubikloud/pypicloud", "path": "pypicloud/cache/base.py", "copies": "1", "size": "8852", "license": "mit", "hash": -1100131498766620900, "line_mean": 29.006779661, "line_max": 103, "alpha_frac": 0.5437189336, "autogenerated": false, "ratio": 4.93422519509476, "config_test": true, ...
"""Base class for all cartpole domains""" from __future__ import division from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import from builtins import super from future import standard_library standard_library.install_aliases() from builtins import range fro...
{ "repo_name": "rlpy/rlpy", "path": "rlpy/Domains/CartPoleBase.py", "copies": "1", "size": "23950", "license": "bsd-3-clause", "hash": 8776983309372865000, "line_mean": 37.1977671451, "line_max": 141, "alpha_frac": 0.5567014614, "autogenerated": false, "ratio": 3.873524179201035, "config_test": ...
"""Base class for all cartpole domains""" from .Domain import Domain import numpy as np import scipy.integrate from rlpy.Tools import pl, mpatches, mpath, fromAtoB, lines, rk4, wrap, bound, colors from abc import ABCMeta, abstractproperty __copyright__ = "Copyright 2013, RLPy http://acl.mit.edu/RLPy" __credits__ = ["...
{ "repo_name": "MDPvis/rlpy", "path": "rlpy/Domains/CartPoleBase.py", "copies": "4", "size": "23343", "license": "bsd-3-clause", "hash": 2166011104336802300, "line_mean": 36.8330632091, "line_max": 140, "alpha_frac": 0.5505719059, "autogenerated": false, "ratio": 3.902206619859579, "config_test"...
""" Base class for all Cloudstack resources -Virtual machine, Volume, Snapshot etc """ from marvin.cloudstackAPI import * from marvin.cloudstackException import ( printException, CloudstackAPIException ) from marvin.codes import (FAILED, FAIL, PASS, RUNNING, STOPPED, STARTING, DES...
{ "repo_name": "MissionCriticalCloud/marvin", "path": "marvin/lib/base.py", "copies": "1", "size": "163472", "license": "apache-2.0", "hash": -2674230810816049700, "line_mean": 32.1653479408, "line_max": 114, "alpha_frac": 0.6022193403, "autogenerated": false, "ratio": 4.1963240579114895, "confi...
""" Base class for all Cloudstack resources -Virtual machine, Volume, Snapshot etc """ import base64 import time from marvin.cloudstackAPI import * from marvin.cloudstackException import ( printException, CloudstackAPIException ) from marvin.codes import ( FAILED, FAIL, PASS, RUNNING, S...
{ "repo_name": "MissionCriticalCloud/cosmic", "path": "cosmic-marvin/marvin/lib/base.py", "copies": "1", "size": "148900", "license": "apache-2.0", "hash": 5064510044123229000, "line_mean": 32.0155210643, "line_max": 128, "alpha_frac": 0.5955809268, "autogenerated": false, "ratio": 4.1824667846408...
"""Base class for all commands""" from optparse import OptionGroup class BaseCommand(object): # default settings to be used for this command instead of global defaults default_settings = {} exitcode = 0 def __init__(self): self.settings = None self.configured = False def synta...
{ "repo_name": "idumpling/robotx", "path": "robotx/core/base.py", "copies": "4", "size": "1672", "license": "mit", "hash": -6430792870296611000, "line_mean": 25.9677419355, "line_max": 79, "alpha_frac": 0.586722488, "autogenerated": false, "ratio": 4.846376811594203, "config_test": false, "has...
"""Baseclass for all conditional distributions.""" import numpy import chaospy from .distribution import Distribution class ItemDistribution(Distribution): """Baseclass for an index of multivariate distribution.""" def __init__(self, index, parent): super(ItemDistribution, self).__init__( ...
{ "repo_name": "jonathf/chaospy", "path": "chaospy/distributions/baseclass/slice_.py", "copies": "1", "size": "2091", "license": "mit", "hash": -7143399591703161000, "line_mean": 33.2786885246, "line_max": 78, "alpha_frac": 0.62505978, "autogenerated": false, "ratio": 4.124260355029586, "config_...
"""Baseclass for all Copulas.""" import numpy import chaospy from .distribution import Distribution class CopulaDistribution(Distribution): """Baseclass for all Copulas.""" def __init__(self, dist, trans, rotation=None, repr_args=None): r""" Args: dist (Distribution): ...
{ "repo_name": "jonathf/chaospy", "path": "chaospy/distributions/baseclass/copula.py", "copies": "1", "size": "2103", "license": "mit", "hash": 7454966961125849000, "line_mean": 34.05, "line_max": 86, "alpha_frac": 0.6005706134, "autogenerated": false, "ratio": 3.789189189189189, "config_test": ...
""" Base class for all Cosmic resources -Virtual machine, Volume, Snapshot etc """ import base64 from abc import ABCMeta, abstractmethod from common import * from utils import * class BaseAbstract: __metaclass__ = ABCMeta @abstractmethod def __init__(self, items, **kwargs): self.id = None ...
{ "repo_name": "MissionCriticalCloud/cosmic", "path": "cosmic-core/test/integration/tests/cosmic/base.py", "copies": "1", "size": "138682", "license": "apache-2.0", "hash": -5584703086269392000, "line_mean": 31.5239212008, "line_max": 180, "alpha_frac": 0.5690067925, "autogenerated": false, "ratio...
""" base class for all electrolyte related physics i.e. the most simple specifications that pnps should work with """ from nanopores.physics.default import * T = 293 # temperature [K] bulkcon = 300. # bulk concentration of ions [mol/m**3] D = 1.9e-9 # diffusivity [m^2/s] pscale = 1e7 # scaling of pressure kT = lamb...
{ "repo_name": "mitschabaude/nanopores", "path": "nanopores/physics/electrolyte.py", "copies": "1", "size": "1265", "license": "mit", "hash": 261965641814225820, "line_mean": 28.4186046512, "line_max": 96, "alpha_frac": 0.6901185771, "autogenerated": false, "ratio": 2.5555555555555554, "config_t...
"""Base class for all estimators.""" # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD Style import copy import inspect import numpy as np from scipy import sparse import warnings from .metrics import r2_score ############################################################################### def ...
{ "repo_name": "ominux/scikit-learn", "path": "sklearn/base.py", "copies": "1", "size": "12291", "license": "bsd-3-clause", "hash": 947249638690205800, "line_mean": 34.4207492795, "line_max": 79, "alpha_frac": 0.5233910992, "autogenerated": false, "ratio": 4.639864099660249, "config_test": true,...
"""Base class for all estimators.""" # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD Style import copy import inspect import warnings import numpy as np from scipy import sparse from .externals import six ############################################################################### def clo...
{ "repo_name": "maxlikely/scikit-learn", "path": "sklearn/base.py", "copies": "1", "size": "14118", "license": "bsd-3-clause", "hash": -7488151793505249000, "line_mean": 35.1074168798, "line_max": 79, "alpha_frac": 0.5280492988, "autogenerated": false, "ratio": 4.642551792173627, "config_test": ...
# Base class for all exception types raised by the template engine. class TemplateError(Exception): def __init__(self, msg): self.msg = msg def __str__(self): if hasattr(self, "token") and self.token is not None: return f"Template '{self.token.template_id}', line {self.token.line_n...
{ "repo_name": "dmulholland/ibis", "path": "ibis/errors.py", "copies": "1", "size": "1531", "license": "unlicense", "hash": 5702873285030275000, "line_mean": 28.4423076923, "line_max": 100, "alpha_frac": 0.66361855, "autogenerated": false, "ratio": 4.10455764075067, "config_test": false, "has_...
"""Base class for all isotherm models.""" import abc import logging logger = logging.getLogger('pygaps') import numpy from .. import scipy from ..utilities.exceptions import CalculationError class IsothermBaseModel(): """Base class for all isotherm models.""" __metaclass__ = abc.ABCMeta # Class spec...
{ "repo_name": "pauliacomi/pyGAPS", "path": "src/pygaps/modelling/base_model.py", "copies": "1", "size": "7691", "license": "mit", "hash": -5575698813204515000, "line_mean": 29.2795275591, "line_max": 99, "alpha_frac": 0.5445325705, "autogenerated": false, "ratio": 4.476717112922002, "config_tes...
"""Base class for all objects in sympy""" from decorators import _sympifyit from assumptions import AssumeMeths, make__get_assumption from cache import cacheit from core import BasicMeta, BasicType, C from sympify import _sympify, sympify, SympifyError from compatibility import any, all class Basic(AssumeMeths): ...
{ "repo_name": "tarballs-are-good/sympy", "path": "sympy/core/basic.py", "copies": "1", "size": "31111", "license": "bsd-3-clause", "hash": 2870032805701174000, "line_mean": 27.886722377, "line_max": 89, "alpha_frac": 0.508566102, "autogenerated": false, "ratio": 4.104895104895105, "config_test"...
"""Base class for all objects in sympy""" import sympy.mpmath as mpmath from assumptions import AssumeMeths, make__get_assumption from sympify import _sympify, _sympifyit, sympify, SympifyError from cache import cacheit, Memoizer, MemoizerArg # from numbers import Number, Integer, Rational, Real /cyclic/ # from int...
{ "repo_name": "ryanGT/sympy", "path": "sympy/core/basic.py", "copies": "1", "size": "71445", "license": "bsd-3-clause", "hash": 1205851921521651000, "line_mean": 28.843358396, "line_max": 109, "alpha_frac": 0.5043040101, "autogenerated": false, "ratio": 4.046728971962617, "config_test": false, ...
"""Base class for all objects in sympy""" import sympy.mpmath as mpmath from decorators import _sympifyit from assumptions import AssumeMeths, make__get_assumption from cache import cacheit # used for canonical ordering of symbolic sequences # via __cmp__ method: # FIXME this is *so* irrelevant and outdated! orderi...
{ "repo_name": "fperez/sympy", "path": "sympy/core/basic.py", "copies": "1", "size": "75167", "license": "bsd-3-clause", "hash": -3193704822010727000, "line_mean": 29.0067864271, "line_max": 109, "alpha_frac": 0.5078292336, "autogenerated": false, "ratio": 4.042540604496074, "config_test": false...
"""Base class for all objects in sympy""" import sympy.mpmath as mpmath from decorators import _sympifyit from assumptions import AssumeMeths, make__get_assumption from cache import cacheit # used for canonical ordering of symbolic sequences # via __cmp__ method: # FIXME this is *so* irrelevant and outdated! orderin...
{ "repo_name": "hazelnusse/sympy-old", "path": "sympy/core/basic.py", "copies": "1", "size": "72579", "license": "bsd-3-clause", "hash": 5887421363315849000, "line_mean": 28.611995104, "line_max": 109, "alpha_frac": 0.5025558357, "autogenerated": false, "ratio": 4.023672247477547, "config_test":...
"""Base class for all objects in sympy""" type_class = type import decimal from basic_methods import BasicMeths, cache_it, cache_it_immutable, BasicType class MemoizerArg: """ See Memoizer. """ def __init__(self, allowed_types, converter = None, name = None): self._allowed_types = allowed_types ...
{ "repo_name": "certik/sympy-oldcore", "path": "sympy/core/basic.py", "copies": "1", "size": "40604", "license": "bsd-3-clause", "hash": -5311556231898024000, "line_mean": 31.904376013, "line_max": 130, "alpha_frac": 0.5204905921, "autogenerated": false, "ratio": 4.055938467685546, "config_test"...
"""Base class for all OpenGLContext event objects.""" class Event(object): """Base class for all local event objects. This is an abstract class from which all local event objects are derived. It defines the base API for each event type, as understood by the event dispatch system. Attributes: ...
{ "repo_name": "alexus37/AugmentedRealityChess", "path": "pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGLContext/events/event.py", "copies": "2", "size": "2010", "license": "mit", "hash": 2336772479516156000, "line_mean": 36.2407407407, "line_max": 80, "alpha...
""" Base class for all OpenMDAO variables """ # public symbols __all__ = ["Variable", "gui_excludes"] import re from keyword import iskeyword from openmdao.main.expreval import _expr_dict from openmdao.main.interfaces import implements, IVariable, IVariableTree from openmdao.main.mp_support import has_interface from...
{ "repo_name": "DailyActie/Surrogate-Model", "path": "01-codes/OpenMDAO-Framework-dev/openmdao.main/src/openmdao/main/variable.py", "copies": "1", "size": "3618", "license": "mit", "hash": -5640120726745261000, "line_mean": 30.4608695652, "line_max": 82, "alpha_frac": 0.6083471531, "autogenerated": ...
"""Base class for all path parametrization contraints. """ from enum import Enum import logging import numpy as np from ..interpolator import AbstractGeometricPath logger = logging.getLogger(__name__) class ConstraintType(Enum): """Type of path parametrization constraint.""" #: Unknown Unknown = -1 ...
{ "repo_name": "hungpham2511/toppra", "path": "toppra/constraint/constraint.py", "copies": "1", "size": "3105", "license": "mit", "hash": 791733720281742500, "line_mean": 29.145631068, "line_max": 115, "alpha_frac": 0.6322061192, "autogenerated": false, "ratio": 4.2651098901098905, "config_test"...
"""Base class for all progress bars (including other data like rates and ETA).""" from etaprogress.eta import ETA class BaseProgressBar(object): """Holds common properties/methods/etc for ProgressBar and related subclasses.""" def __init__(self, denominator, max_width=None, eta_every=1): self._eta =...
{ "repo_name": "Robpol86/etaprogress", "path": "etaprogress/components/base_progress_bar.py", "copies": "1", "size": "2619", "license": "mit", "hash": -4049603419553833000, "line_mean": 33.4605263158, "line_max": 119, "alpha_frac": 0.6227567774, "autogenerated": false, "ratio": 4.314662273476112, ...
"""Base class for all protocol commands""" import zlib import oa import oa.errors import oa.message class BaseProtocol(object): """Base object for any protocol command implementation.""" # If this is set to True then try to load options has_options = False # If this is set to True then the command e...
{ "repo_name": "SpamExperts/OrangeAssassin", "path": "oa/protocol/base.py", "copies": "2", "size": "3879", "license": "apache-2.0", "hash": -7542886526566277000, "line_mean": 35.9428571429, "line_max": 74, "alpha_frac": 0.5643207012, "autogenerated": false, "ratio": 4.2117263843648205, "config_t...
"""Base class for all RTML elements.""" import random import string import warnings from lxml import etree import rtmlparse.elements class BaseElement(object): def __init__(self, tagname, parent, name=None, uid=None, valid_element_types=False, attributes={}): # uid must start with a letter self...
{ "repo_name": "thusser/rtml-parse", "path": "rtmlparse/elements/baseelement.py", "copies": "1", "size": "11539", "license": "mit", "hash": 8730244088228945000, "line_mean": 31.8746438746, "line_max": 117, "alpha_frac": 0.5485743999, "autogenerated": false, "ratio": 4.375805839969662, "config_te...
"""Base class for all serialziers used by Storm component. Please note that for each serializer a Java counterpart needs to exist. """ from __future__ import absolute_import, print_function, unicode_literals import logging from ..exceptions import StormWentAwayError log = logging.getLogger(__name__) class Serial...
{ "repo_name": "pystorm/pystorm", "path": "pystorm/serializers/serializer.py", "copies": "1", "size": "1405", "license": "apache-2.0", "hash": -3456583931040364000, "line_mean": 33.2682926829, "line_max": 79, "alpha_frac": 0.6491103203, "autogenerated": false, "ratio": 4.33641975308642, "config_...
"""Base class for all Skytap Resources.""" import json from skytap.framework.ApiClient import ApiClient # noqa from skytap.framework.Json import SkytapJsonEncoder # noqa import skytap.framework.Utils as Utils # noqa class SkytapResource(object): """Represents one Skytap Resource - a VM, Environment, User, wha...
{ "repo_name": "FulcrumIT/skytap", "path": "skytap/models/SkytapResource.py", "copies": "2", "size": "3537", "license": "mit", "hash": -971495786382816900, "line_mean": 33.0096153846, "line_max": 78, "alpha_frac": 0.5872208086, "autogenerated": false, "ratio": 4.132009345794392, "config_test": f...
''' Base class for all Stims and associated functionality. ''' from abc import ABCMeta, abstractmethod from os.path import isdir, join, basename, realpath, isfile from glob import glob from urllib.request import urlopen from urllib.parse import urlparse from collections import namedtuple from contextlib import context...
{ "repo_name": "tyarkoni/pliers", "path": "pliers/stimuli/base.py", "copies": "2", "size": "7472", "license": "bsd-3-clause", "hash": -712094998781822300, "line_mean": 30.3949579832, "line_max": 83, "alpha_frac": 0.6013115632, "autogenerated": false, "ratio": 4.049864498644986, "config_test": fa...
""" Base class for all taemin plugin """ import itertools MAX_MSG_LENGTH = 400 class TaeminPlugin(object): helper = {} def __init__(self, taemin): self.taemin = taemin def start(self): pass def stop(self): pass def on_join(self, connection): pass def on_pu...
{ "repo_name": "ningirsu/taemin", "path": "taemin/plugin.py", "copies": "1", "size": "1367", "license": "mit", "hash": 2170388021260195300, "line_mean": 21.7833333333, "line_max": 128, "alpha_frac": 0.5479151426, "autogenerated": false, "ratio": 3.5598958333333335, "config_test": false, "has_n...
"""Baseclass for all tests.""" import copy import inspect import logging import os import sys import time import unittest from mpf.core.config_loader import YamlMultifileConfigLoader from unittest.mock import * import asyncio from asyncio import events from mpf.core.logging import LogMixin from mpf.core.rgb_color i...
{ "repo_name": "missionpinball/mpf", "path": "mpf/tests/MpfTestCase.py", "copies": "1", "size": "35190", "license": "mit", "hash": 854755628938634100, "line_mean": 36.1987315011, "line_max": 129, "alpha_frac": 0.6075589656, "autogenerated": false, "ratio": 4.258228460793805, "config_test": true,...
"""Base class for all the objects in Diofant.""" from collections import defaultdict from collections.abc import Mapping from itertools import zip_longest from .cache import cacheit from .compatibility import iterable, ordered from .decorators import _sympifyit from .sympify import SympifyError, sympify class Basic...
{ "repo_name": "skirpichev/omg", "path": "diofant/core/basic.py", "copies": "1", "size": "40552", "license": "bsd-3-clause", "hash": -8071604844361862000, "line_mean": 30.3627223511, "line_max": 94, "alpha_frac": 0.5298875518, "autogenerated": false, "ratio": 4.237408568443051, "config_test": fa...
"""Base class for all the objects in Diofant.""" from collections import defaultdict from collections.abc import Mapping from itertools import zip_longest from ..utilities import ordered from .cache import cacheit from .compatibility import iterable from .decorators import _sympifyit from .sympify import SympifyError...
{ "repo_name": "diofant/diofant", "path": "diofant/core/basic.py", "copies": "1", "size": "40625", "license": "bsd-3-clause", "hash": 1177663887446019600, "line_mean": 30.3706563707, "line_max": 94, "alpha_frac": 0.53024, "autogenerated": false, "ratio": 4.23795117880242, "config_test": false, ...
"""Base class for all the objects in SymPy""" from copy import copy from sympy.core.assumptions import ManagedProperties from sympy.core.cache import cacheit from sympy.core.core import BasicType, C from sympy.core.sympify import _sympify, sympify, SympifyError from sympy.core.compatibility import callable, reduce, cmp...
{ "repo_name": "srjoglekar246/sympy", "path": "sympy/core/basic.py", "copies": "2", "size": "48908", "license": "bsd-3-clause", "hash": 6373277272781850000, "line_mean": 29.3587833644, "line_max": 120, "alpha_frac": 0.5177476078, "autogenerated": false, "ratio": 4.110952340926284, "config_test":...
"""Base class for all the objects in SymPy""" from __future__ import print_function, division from collections import Mapping from .assumptions import BasicMeta, ManagedProperties from .cache import cacheit from .sympify import _sympify, sympify, SympifyError from .compatibility import (iterable, Iterator, ordered, ...
{ "repo_name": "Titan-C/sympy", "path": "sympy/core/basic.py", "copies": "1", "size": "59477", "license": "bsd-3-clause", "hash": -7372447753740728000, "line_mean": 31.2019491067, "line_max": 94, "alpha_frac": 0.5195789969, "autogenerated": false, "ratio": 4.175582701488346, "config_test": false...
"""Base class for all the objects in SymPy""" from __future__ import print_function, division from .assumptions import BasicMeta, ManagedProperties from .cache import cacheit from .sympify import _sympify, sympify, SympifyError from .compatibility import (iterable, Iterator, ordered, string_types, with_metaclass, ...
{ "repo_name": "oliverlee/sympy", "path": "sympy/core/basic.py", "copies": "3", "size": "60082", "license": "bsd-3-clause", "hash": -1373973373235891500, "line_mean": 31.2501341922, "line_max": 94, "alpha_frac": 0.5219699744, "autogenerated": false, "ratio": 4.161667936551916, "config_test": fal...
"""Base class for all the objects in SymPy""" from __future__ import print_function, division from .assumptions import ManagedProperties from .cache import cacheit from .core import BasicType, C from .sympify import _sympify, sympify, SympifyError from .compatibility import (iterable, Iterator, ordered, string_typ...
{ "repo_name": "AunShiLord/sympy", "path": "sympy/core/basic.py", "copies": "4", "size": "59499", "license": "bsd-3-clause", "hash": 4794068530433970000, "line_mean": 31.3364130435, "line_max": 94, "alpha_frac": 0.5217062472, "autogenerated": false, "ratio": 4.151479207368127, "config_test": fal...
"""Base class for all the objects in SymPy""" from __future__ import print_function, division from .assumptions import ManagedProperties from .cache import cacheit from .core import BasicType from .sympify import _sympify, sympify, SympifyError from .compatibility import (iterable, Iterator, ordered, string_types,...
{ "repo_name": "vipulroxx/sympy", "path": "sympy/core/basic.py", "copies": "3", "size": "59624", "license": "bsd-3-clause", "hash": 7816672059447071000, "line_mean": 31.3516006511, "line_max": 94, "alpha_frac": 0.5220045619, "autogenerated": false, "ratio": 4.157010388342745, "config_test": fals...
"""Base class for all the objects in SymPy""" from __future__ import print_function, division from sympy.core.assumptions import ManagedProperties from sympy.core.cache import cacheit from sympy.core.core import BasicType, C from sympy.core.sympify import _sympify, sympify, SympifyError from sympy.core.compatibility i...
{ "repo_name": "hrashk/sympy", "path": "sympy/core/basic.py", "copies": "1", "size": "59965", "license": "bsd-3-clause", "hash": -2664053451165306400, "line_mean": 30.8623804463, "line_max": 94, "alpha_frac": 0.5179854915, "autogenerated": false, "ratio": 4.1538514824050985, "config_test": false...
"""Base class for all the objects in SymPy""" from assumptions import AssumeMeths, make__get_assumption from cache import cacheit from core import BasicMeta, BasicType, C from sympify import _sympify, sympify, SympifyError from compatibility import any, iterable from sympy.core.decorators import deprecated from sympy...
{ "repo_name": "minrk/sympy", "path": "sympy/core/basic.py", "copies": "1", "size": "35323", "license": "bsd-3-clause", "hash": 893423442597579600, "line_mean": 28.0963756178, "line_max": 120, "alpha_frac": 0.5031848937, "autogenerated": false, "ratio": 4.060581676054719, "config_test": false, ...
"""Base class for all the objects in SymPy""" from assumptions import WithAssumptions from cache import cacheit from core import BasicType, C from sympify import _sympify, sympify, SympifyError from compatibility import callable, reduce, cmp, iterable from sympy.core.decorators import deprecated from sympy.core.single...
{ "repo_name": "ichuang/sympy", "path": "sympy/core/basic.py", "copies": "1", "size": "49496", "license": "bsd-3-clause", "hash": 960495181620323600, "line_mean": 29.1620962828, "line_max": 120, "alpha_frac": 0.5048084694, "autogenerated": false, "ratio": 4.164577198148927, "config_test": false,...
"""Base class for all the objects in SymPy""" from decorators import _sympifyit from assumptions import WithAssumptions from cache import cacheit from core import BasicType, C from sympify import _sympify, sympify, SympifyError from compatibility import callable, reduce, cmp, iterable from sympy.core.decorators import...
{ "repo_name": "Cuuuurzel/KiPyCalc", "path": "sympy_old/core/basic.py", "copies": "1", "size": "33919", "license": "mit", "hash": -66980734579514020, "line_mean": 27.8426870748, "line_max": 120, "alpha_frac": 0.500604381, "autogenerated": false, "ratio": 4.075333413432657, "config_test": false, ...
"""Base class for all the `processor-cli` commands.""" import abc import sys from loguru import logger from tabulate import tabulate class AbstractCommand: """Base class for the commands.""" __metaclass__ = abc.ABCMeta def __init__(self, command_args=None, global_args=None): """ Initial...
{ "repo_name": "rgreinho/python-cookiecutter", "path": "{{cookiecutter.project_name}}/{{cookiecutter.project_name}}/cli/base.py", "copies": "1", "size": "2211", "license": "mit", "hash": 1834390440963335000, "line_mean": 29.7083333333, "line_max": 112, "alpha_frac": 0.6132971506, "autogenerated": fa...
""" Base class for Amazon cover sources. """ from sacad.sources.base import CoverSource class AmazonBaseCoverSource(CoverSource): """ Base class for Amazon cover sources. """ def __init__(self, *args, base_domain, **kwargs): super().__init__( *args, allow_cookies=True, ...
{ "repo_name": "desbma/sacad", "path": "sacad/sources/amazonbase.py", "copies": "1", "size": "1575", "license": "mpl-2.0", "hash": 6477008636399662000, "line_mean": 35.6279069767, "line_max": 104, "alpha_frac": 0.5968253968, "autogenerated": false, "ratio": 3.75, "config_test": false, "has_no_...
"""Base class for API REST Handlers.""" from __future__ import annotations import abc import inspect import typing as t import marshmallow as ma from asgi_tools.response import parse_response from muffin import Request from muffin.typing import JSONType from muffin.handler import Handler, HandlerMeta from . import L...
{ "repo_name": "klen/muffin-rest", "path": "muffin_rest/handler.py", "copies": "1", "size": "10824", "license": "mit", "hash": -4239171298957629000, "line_mean": 33.1451104101, "line_max": 122, "alpha_frac": 0.6016260163, "autogenerated": false, "ratio": 4.131297709923664, "config_test": false, ...
"""Base class for api services.""" import contextlib import datetime import logging import pprint import urllib import urlparse from protorpc import message_types from protorpc import messages import six from six.moves import http_client from googlecloudapis.apitools.base.py import credentials_lib from googlecloud...
{ "repo_name": "ychen820/microblog", "path": "y/google-cloud-sdk/.install/.backup/lib/googlecloudapis/apitools/base/py/base_api.py", "copies": "2", "size": "22502", "license": "bsd-3-clause", "hash": 2794085058582151000, "line_mean": 35.7679738562, "line_max": 80, "alpha_frac": 0.6843836103, "autoge...
"""Base class for asyncio modes.""" from typing import Optional import abc import asyncio from mpf.core.mode import Mode MYPY = False if MYPY: # pragma: no cover from mpf.core.machine import MachineController # pylint: disable-msg=cyclic-import,unused-import class AsyncMode(Mode, metaclass=abc.ABCMeta): ...
{ "repo_name": "missionpinball/mpf", "path": "mpf/core/async_mode.py", "copies": "1", "size": "1618", "license": "mit", "hash": 2186277818249126400, "line_mean": 25.0967741935, "line_max": 102, "alpha_frac": 0.5945611867, "autogenerated": false, "ratio": 4.159383033419023, "config_test": false, ...
"""Base class for August entity.""" from homeassistant.core import callback from homeassistant.helpers.entity import Entity from . import DOMAIN from .const import MANUFACTURER DEVICE_TYPES = ["keypad", "lock", "camera", "doorbell", "door", "bell"] class AugustEntityMixin(Entity): """Base implementation for Aug...
{ "repo_name": "w1ll1am23/home-assistant", "path": "homeassistant/components/august/entity.py", "copies": "5", "size": "2399", "license": "apache-2.0", "hash": 2093975339824191700, "line_mean": 29.7564102564, "line_max": 71, "alpha_frac": 0.6060858691, "autogenerated": false, "ratio": 3.9199346405...
"""Base class for August entity.""" from homeassistant.const import EVENT_HOMEASSISTANT_STOP from homeassistant.core import callback from homeassistant.helpers.event import async_track_time_interval class AugustSubscriberMixin: """Base implementation for a subscriber.""" def __init__(self, hass, update_int...
{ "repo_name": "kennedyshead/home-assistant", "path": "homeassistant/components/august/subscriber.py", "copies": "2", "size": "2369", "license": "apache-2.0", "hash": -1692545484796668400, "line_mean": 30.1710526316, "line_max": 77, "alpha_frac": 0.6217813423, "autogenerated": false, "ratio": 4.42...
"""Base class for August entity.""" from homeassistant.core import callback from homeassistant.helpers.event import async_track_time_interval class AugustSubscriberMixin: """Base implementation for a subscriber.""" def __init__(self, hass, update_interval): """Initialize an subscriber.""" s...
{ "repo_name": "robbiet480/home-assistant", "path": "homeassistant/components/august/subscriber.py", "copies": "9", "size": "1551", "license": "apache-2.0", "hash": -7910287513537302000, "line_mean": 33.4666666667, "line_max": 77, "alpha_frac": 0.6305609284, "autogenerated": false, "ratio": 4.4568...
"""Base class for authentication backends.""" from __future__ import unicode_literals import re import warnings from django.contrib.auth.models import User from djblets.db.query import get_object_or_none class BaseAuthBackend(object): """Base class for a Review Board authentication backend.""" #: The uniq...
{ "repo_name": "reviewboard/reviewboard", "path": "reviewboard/accounts/backends/base.py", "copies": "2", "size": "7970", "license": "mit", "hash": 5616813288537588000, "line_mean": 33.3534482759, "line_max": 79, "alpha_frac": 0.6229611041, "autogenerated": false, "ratio": 4.9015990159901595, "c...
""" Base class for auto generated NGPF emulation hosts """ from ixnetwork.IxnQuery import IxnQuery import time class IxnEmulationHost(object): def __init__(self, ixnhttp): self._ixnhttp = ixnhttp self.session_ids = {} self._port_offset = None self._port_count = None ...
{ "repo_name": "OpenIxia/ixnetwork_client_python", "path": "ixnetwork/IxnEmulationHost.py", "copies": "1", "size": "10148", "license": "mit", "hash": -7754140138572082000, "line_mean": 44.9814814815, "line_max": 145, "alpha_frac": 0.5342924714, "autogenerated": false, "ratio": 4.316461080391323, ...
"""Base class for backpropagation components.""" import numpy as np class BaseBPropComponent(object): """Base class for all back-propagatable components.""" def __init__(self, nparams=None, params=None, grad=None): """Dummy constructor. This class should never be instantiated.""" # To satisfy ...
{ "repo_name": "dwf/convolupy", "path": "convolupy/base.py", "copies": "1", "size": "3318", "license": "bsd-3-clause", "hash": -8016464040122205000, "line_mean": 36.7045454545, "line_max": 79, "alpha_frac": 0.5337552743, "autogenerated": false, "ratio": 4.061199510403917, "config_test": false, ...
"""Baseclass for ball device ball counters. The duty of this device is to maintain the current ball count of the device. """ import asyncio from typing import List, Optional from mpf.core.utility_functions import Util MYPY = False if MYPY: # pragma: no cover from mpf.devices.ball_device.ball_device import Bal...
{ "repo_name": "missionpinball/mpf", "path": "mpf/devices/ball_device/physical_ball_counter.py", "copies": "1", "size": "10433", "license": "mit", "hash": -6906366514736281000, "line_mean": 33.206557377, "line_max": 137, "alpha_frac": 0.6138215278, "autogenerated": false, "ratio": 3.97296268088347...
"""Baseclass for ball device ejectors.""" MYPY = False if MYPY: # pragma: no cover from mpf.core.machine import MachineController # pylint: disable-msg=cyclic-import,unused-import from mpf.devices.ball_device.ball_device import BallDevice # pylint: disable-msg=cyclic-import,unused-import class BallDevic...
{ "repo_name": "missionpinball/mpf", "path": "mpf/devices/ball_device/ball_device_ejector.py", "copies": "1", "size": "1572", "license": "mit", "hash": -8526438622804095000, "line_mean": 31.0816326531, "line_max": 113, "alpha_frac": 0.6316793893, "autogenerated": false, "ratio": 3.7251184834123223...
"""Base class for ball device handlers.""" import asyncio from mpf.core.utility_functions import Util class BallDeviceStateHandler: """Base class for ball device handler.""" __slots__ = ["ball_device", "machine", "_task"] def __init__(self, ball_device): """Initialise handler. Args: ...
{ "repo_name": "missionpinball/mpf", "path": "mpf/devices/ball_device/ball_device_state_handler.py", "copies": "1", "size": "1423", "license": "mit", "hash": -1350898348659652900, "line_mean": 26.9019607843, "line_max": 91, "alpha_frac": 0.5769501054, "autogenerated": false, "ratio": 3.92011019283...
"""Base class for bio-inspired optimizers.""" from concurrent import futures import datetime import enum import os import sys from deap import base, creator, tools import numpy import matplotlib.pylab as plt from external_programs.profit import run_profit def default_build(spec_seq_params): specification, sequ...
{ "repo_name": "woolfson-group/isambard", "path": "isambard/optimisation/base_evo_opt.py", "copies": "1", "size": "19281", "license": "mit", "hash": 1473542746025491000, "line_mean": 35.6558935361, "line_max": 82, "alpha_frac": 0.5629894715, "autogenerated": false, "ratio": 4.441603317208017, "c...
"""Base class for bio-inspired optimizers.""" import operator import random from deap import creator, tools import numpy from optimisation.base_evo_opt import BaseOptimizer, Parameter, default_build class DE(BaseOptimizer): """Differential evolution optimisation algorithm. Notes ----- Can use neig...
{ "repo_name": "woolfson-group/isambard", "path": "isambard/optimisation/evo_optimizers.py", "copies": "1", "size": "25190", "license": "mit", "hash": -4674765430990591000, "line_mean": 38.2367601246, "line_max": 79, "alpha_frac": 0.5819372767, "autogenerated": false, "ratio": 4.010507880910683, ...
"""Base class for buffer objects. @todo: Implement binding as separate object to allow binding buffers to different targets. This problem is very similar to rebinding L{Sampler}s to different units and should probably be handled in a similar way. @todo: Implement slicing with C{glGetBufferSubData}. @todo: Remember tha...
{ "repo_name": "swenger/glitter", "path": "glitter/arrays/basebuffer.py", "copies": "1", "size": "3651", "license": "mit", "hash": 4567059633668901400, "line_mean": 33.7714285714, "line_max": 214, "alpha_frac": 0.6305121884, "autogenerated": false, "ratio": 3.7103658536585367, "config_test": fal...
"""base class for builder""" import os from etl_framework.BaseConfig import BaseConfig from etl_framework.Exceptions import DuplicateConfigException, ConfigNotFoundException class Builder(object): def __init__( self, configs=None, etl_module=None, environment=None, ): ...
{ "repo_name": "pantheon-systems/etl-framework", "path": "etl_framework/builders.py", "copies": "1", "size": "2767", "license": "mit", "hash": -593586237581514900, "line_mean": 24.1545454545, "line_max": 86, "alpha_frac": 0.5898084568, "autogenerated": false, "ratio": 4.371248025276461, "config_...
"""Base class for Bundle and Partition databases. This module also includes interfaces for temporary CSV files and HDF files. Copyright (c) 2013 Clarinova. This file is licensed under the terms of the Revised BSD License, included in this distribution as LICENSE.txt """ import h5py import os.path from numpy import * ...
{ "repo_name": "treyhunner/databundles", "path": "databundles/hdf5.py", "copies": "1", "size": "3289", "license": "bsd-3-clause", "hash": 565441754673059500, "line_mean": 29.738317757, "line_max": 128, "alpha_frac": 0.5655214351, "autogenerated": false, "ratio": 4.19515306122449, "config_test": ...
"""Base class for chaining DBs ChainDBSingleton Copyright 2015-2016, the xonsh developers """ import itertools from collections import ChainMap from collections.abc import MutableMapping class ChainDBSingleton(object): """Singleton for representing when no default value is given.""" __inst = None def...
{ "repo_name": "scopatz/regolith", "path": "regolith/chained_db.py", "copies": "1", "size": "2480", "license": "cc0-1.0", "hash": 2145745143040021200, "line_mean": 30, "line_max": 87, "alpha_frac": 0.5661290323, "autogenerated": false, "ratio": 4.609665427509293, "config_test": false, "has_no_...
""" Base class for channel adapters """ from abc import ABC, abstractmethod import traceback from logging import Logger from concurrent.futures import ThreadPoolExecutor from ..core import Minette class Adapter(ABC): """ Base class for channel adapters Attributes ---------- bot : minette.Minette...
{ "repo_name": "uezo/minette-python", "path": "minette/adapter/base.py", "copies": "1", "size": "3368", "license": "apache-2.0", "hash": 9064749637636814000, "line_mean": 24.7099236641, "line_max": 77, "alpha_frac": 0.5564133017, "autogenerated": false, "ratio": 5.064661654135338, "config_test":...
"""Base class for checking file trees""" import stat import os import time from fnmatch import fnmatch import py from . import report as rep from . import ignore as ig from . import checkinfo as ci from .problems import every_problem as ep def get_username(pypath): from pwd import getpwuid st = pypath.stat...
{ "repo_name": "jackstanek/BotBot", "path": "botbot/checker.py", "copies": "1", "size": "5916", "license": "mit", "hash": 4251933532863991000, "line_mean": 30.3015873016, "line_max": 82, "alpha_frac": 0.5393847194, "autogenerated": false, "ratio": 4.424831712789828, "config_test": false, "has_...
"""Base class for Checks. If you are writing your own checks you should subclass the AgentCheck class. The Check class is being deprecated so don't write new checks with it. """ import logging import re import socket import time import types import os import sys import traceback import copy from pprint import pprint ...
{ "repo_name": "JohnLZeller/dd-agent", "path": "checks/__init__.py", "copies": "1", "size": "27757", "license": "bsd-3-clause", "hash": -2264827513036978000, "line_mean": 37.2327823691, "line_max": 151, "alpha_frac": 0.5835645063, "autogenerated": false, "ratio": 4.274911443092561, "config_test"...
"""Base class for Checks. If you are writing your own checks you should subclass the AgentCheck class. The Check class is being deprecated so don't write new checks with it. """ # stdlib from collections import defaultdict import copy import logging import numbers import os import re import time import timeit import t...
{ "repo_name": "Mashape/dd-agent", "path": "checks/__init__.py", "copies": "2", "size": "34884", "license": "bsd-3-clause", "hash": 2032829009965604000, "line_mean": 37.0414394766, "line_max": 151, "alpha_frac": 0.585081986, "autogenerated": false, "ratio": 4.30188679245283, "config_test": true,...
"""Base class for coding experiment.""" import abc import matplotlib.pyplot as plt import numpy as np import tensorflow as tf import tensorflow_probability as tfp class CompressionModel(tf.keras.Model, metaclass=abc.ABCMeta): """Base class for coding experiment.""" def __init__(self, source, lmbda, distortion_l...
{ "repo_name": "tensorflow/compression", "path": "models/toy_sources/compression_model.py", "copies": "1", "size": "6954", "license": "apache-2.0", "hash": 8993906544571017000, "line_mean": 33.5970149254, "line_max": 80, "alpha_frac": 0.6320103538, "autogenerated": false, "ratio": 3.477, "config...
import math import logging import pygame from plugin import Plugin class Collage(Plugin): """ Base class for collage plugins See simple_resize.py or recursive_split.py for example implementation of a plugin """ def __init__(self, config): super(Collage, self).__init__() ...
{ "repo_name": "loktacar/wallpapermaker", "path": "plugins/collage.py", "copies": "1", "size": "2645", "license": "mit", "hash": -3821228206907375000, "line_mean": 29.4022988506, "line_max": 93, "alpha_frac": 0.5792060491, "autogenerated": false, "ratio": 4.007575757575758, "config_test": true, ...
"""Base class for command handlers.""" __author__ = 'pramodg@room77.com (Pramod Gupta)' __copyright__ = 'Copyright 2012 Room77, Inc.' import json import os from collections import OrderedDict from pylib.base.flags import Flags from pylib.base.term_color import TermColor from pylib.file.file_utils import FileUtils f...
{ "repo_name": "room77/py77", "path": "pylib/zeus/pipeline_cmd_base.py", "copies": "1", "size": "6397", "license": "mit", "hash": -4677094798688249000, "line_mean": 35.1412429379, "line_max": 99, "alpha_frac": 0.6165390027, "autogenerated": false, "ratio": 4.015693659761457, "config_test": false...
"""Base class for command handlers.""" __author__ = 'pramodg@room77.com (Pramod Gupta)' __copyright__ = 'Copyright 2012 Room77, Inc.' import json import os from pylib.base.flags import Flags from pylib.base.term_color import TermColor from pylib.flash.rules import Rules from pylib.flash.utils import Utils class Cm...
{ "repo_name": "room77/py77", "path": "pylib/flash/cmd_handler.py", "copies": "1", "size": "4888", "license": "mit", "hash": -581625925290805200, "line_mean": 33.9142857143, "line_max": 86, "alpha_frac": 0.5718085106, "autogenerated": false, "ratio": 3.9967293540474245, "config_test": false, "...
"""Base class for commands. Handles parsing supplied arguments.""" import getopt import sys __author__ = "David Hulton" __license__ = "BSD" __copyright__ = "Copyright 2016, David Hulton" class Command: def __init__(self, argv, options, flags, allowArgRemainder=False): try: self.flags ...
{ "repo_name": "h1kari/des_kpt", "path": "des_kpt/commands/Command.py", "copies": "1", "size": "1143", "license": "bsd-3-clause", "hash": -6996143600396912000, "line_mean": 28.3076923077, "line_max": 91, "alpha_frac": 0.5660542432, "autogenerated": false, "ratio": 4.010526315789473, "config_test...
# Base class for comments and submissions class Post(object): """ A class for "posts" - a post can either be a submission or a comment or tweet. """ def __init__( self, id, text, created_utc, score, permalink ): # Post id self.id = id # For comments, the comment body...
{ "repo_name": "thundergolfer/mAIcroft", "path": "maicroft/social_objects.py", "copies": "1", "size": "3925", "license": "mit", "hash": -560833789614166340, "line_mean": 28.0740740741, "line_max": 82, "alpha_frac": 0.5872611465, "autogenerated": false, "ratio": 3.792270531400966, "config_test": ...
"""Base class for common speaker tasks.""" from __future__ import annotations import asyncio from collections.abc import Coroutine import contextlib import datetime from functools import partial import logging from typing import Any, Callable import urllib.parse import async_timeout from pysonos.alarms import get_ala...
{ "repo_name": "home-assistant/home-assistant", "path": "homeassistant/components/sonos/speaker.py", "copies": "1", "size": "35126", "license": "apache-2.0", "hash": -3005784583742443500, "line_mean": 36.3283740701, "line_max": 91, "alpha_frac": 0.5917838638, "autogenerated": false, "ratio": 4.040...
"""Base class for common speaker tasks.""" from __future__ import annotations import asyncio from collections import deque from collections.abc import Coroutine import contextlib import datetime from functools import partial import logging from typing import Any, Callable import urllib.parse import async_timeout from...
{ "repo_name": "kennedyshead/home-assistant", "path": "homeassistant/components/sonos/speaker.py", "copies": "1", "size": "36590", "license": "apache-2.0", "hash": -4294629451702512000, "line_mean": 35.480558325, "line_max": 91, "alpha_frac": 0.5926482646, "autogenerated": false, "ratio": 4.051600...
"""Base class for common use locators and actions.""" from pypom import Page class Base(Page): """Contain the locators and actions that can be used anywhere.""" def __init__(self, selenium, base_url, **kwargs): """Create the base class object.""" super(Base, self).__init__( selen...
{ "repo_name": "mozilla-lockbox/lockbox-extension", "path": "test/integration/pages/base.py", "copies": "1", "size": "1118", "license": "mpl-2.0", "hash": 4457483935121645000, "line_mean": 36.2666666667, "line_max": 73, "alpha_frac": 0.6216457961, "autogenerated": false, "ratio": 3.714285714285714...