text stringlengths 0 1.05M | meta dict |
|---|---|
'''Base class for compiler (jmc) and interprator (jms)
'''
from __future__ import absolute_import
from __future__ import with_statement
import sys
import os.path
from contextlib import contextmanager
from optparse import OptionParser
from ..runtime.filepath import FilePath
from ..runtime.require import files_search_... | {
"repo_name": "matthagy/Jamenson",
"path": "jamenson/bin/jmbase.py",
"copies": "1",
"size": "3854",
"license": "apache-2.0",
"hash": -4634241691425595000,
"line_mean": 31.9401709402,
"line_max": 104,
"alpha_frac": 0.5467047224,
"autogenerated": false,
"ratio": 4.539458186101296,
"config_test": ... |
"""Base class for creating HTML processing modules
This class is designed to take HTML as input and spit out equivalent
HTML as output. By itself it's not very interesting; you use it by
subclassing it and providing the methods you need to create your HTML
transformation.
This program is part of "Dive Into Python", ... | {
"repo_name": "tapomayukh/projects_in_python",
"path": "sandbox_tapo/src/refs/diveintopython-pdf-5.4/diveintopython-5.4/py/BaseHTMLProcessor.py",
"copies": "4",
"size": "3750",
"license": "mit",
"hash": 4943351401202827000,
"line_mean": 39.3225806452,
"line_max": 82,
"alpha_frac": 0.6981333333,
"au... |
"""Base class for creating scikit-learn Pipeline compatible steps"""
from abc import ABC, abstractmethod
class Step(ABC):
"""Step in pipeline.
You *must* override "transform"
"""
@abstractmethod
def transform(self, df, y=None):
"""Transform a DataFrame"""
pass
# API compati... | {
"repo_name": "tebeka/pythonwise",
"path": "sklearn-pipes.py",
"copies": "1",
"size": "1410",
"license": "bsd-3-clause",
"hash": 2549984927819518500,
"line_mean": 20.6923076923,
"line_max": 70,
"alpha_frac": 0.604964539,
"autogenerated": false,
"ratio": 3.4814814814814814,
"config_test": false,... |
"""Base class for custom spiders"""
from threaded_spider.http import Request
from threaded_spider.basic import log
class BaseSpider(object):
"""Base class for user-defined spiders. All spiders *must*
inherit from this class.
"""
name = None
def __init__(self, name=None, **kws):... | {
"repo_name": "aware-why/multithreaded_crawler",
"path": "threaded_spider/core/spider.py",
"copies": "1",
"size": "2092",
"license": "bsd-2-clause",
"hash": -2633976930838076400,
"line_mean": 32.9,
"line_max": 94,
"alpha_frac": 0.568833652,
"autogenerated": false,
"ratio": 4.226262626262626,
"c... |
"""Base class for database classes and decorator for db method.
The base class DBObjectBase is the base class for all other database
base classes. It has methods for common database operations like
select, insert, update and delete. This module also contains the
definition for ShardRouting which is used for determin... | {
"repo_name": "cloudbearings/vitess",
"path": "py/vtdb/db_object.py",
"copies": "8",
"size": "13568",
"license": "bsd-3-clause",
"hash": -5718004041887606000,
"line_mean": 32.92,
"line_max": 80,
"alpha_frac": 0.6614091981,
"autogenerated": false,
"ratio": 3.9430398140075558,
"config_test": fals... |
"""Base class for datasources that read data from files in a
directory.
"""
# standard imports
from typing import Union
import os
import glob
import random
# toolbox imports
from dltb.base.data import Data
from dltb.tool.classifier import ClassScheme
from dltb.util import read_cache, write_cache
from .files import D... | {
"repo_name": "Petr-By/qtpyvis",
"path": "dltb/datasource/directory.py",
"copies": "1",
"size": "6295",
"license": "mit",
"hash": 1052672004730905200,
"line_mean": 35.5988372093,
"line_max": 78,
"alpha_frac": 0.6015885624,
"autogenerated": false,
"ratio": 4.362439362439362,
"config_test": false... |
"""Base class for deCONZ devices."""
from homeassistant.core import callback
from homeassistant.helpers.device_registry import CONNECTION_ZIGBEE
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Entity
from .const import DECONZ_REACHABLE, DOMAIN as DECONZ_DO... | {
"repo_name": "HydrelioxGitHub/home-assistant",
"path": "homeassistant/components/deconz/deconz_device.py",
"copies": "4",
"size": "2623",
"license": "apache-2.0",
"hash": 5209962584963206000,
"line_mean": 34.4459459459,
"line_max": 79,
"alpha_frac": 0.6343881052,
"autogenerated": false,
"ratio":... |
"""Base class for destinations.
A destination is a place where Grow static builds can be deployed. Grow takes
a pod, builds a static fileset, and deploys it to a remote location (the
desitnation), suitable for serving the web site to lvie end users.
A "deployment" is a destination loaded up with a configuration.
Cur... | {
"repo_name": "denmojo/pygrow",
"path": "grow/deployments/destinations/base.py",
"copies": "1",
"size": "9418",
"license": "mit",
"hash": -6058360234549721000,
"line_mean": 33.8814814815,
"line_max": 92,
"alpha_frac": 0.6412189425,
"autogenerated": false,
"ratio": 4.17649667405765,
"config_test... |
"""Base class for directed graphs."""
# Copyright (C) 2004-2011 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from copy import deepcopy
import networkx as nx
from networkx.classes.graph import Graph
from ne... | {
"repo_name": "Duke-NSOE/GeoHAT",
"path": "GeoHat_V10/Scripts/networkx/classes/digraph.py",
"copies": "1",
"size": "39673",
"license": "cc0-1.0",
"hash": -2397420285004384000,
"line_mean": 31.0460420032,
"line_max": 90,
"alpha_frac": 0.5320242986,
"autogenerated": false,
"ratio": 4.07320328542094... |
"""Base class for directed graphs."""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from copy import deepcopy
from ...networkx.classes.graph import Graph
from ...networkx.exception... | {
"repo_name": "denik/vwoptimize",
"path": "vwoptimizelib/third_party/networkx/classes/digraph.py",
"copies": "1",
"size": "44184",
"license": "mit",
"hash": 184306991709682900,
"line_mean": 32.0718562874,
"line_max": 89,
"alpha_frac": 0.5450615607,
"autogenerated": false,
"ratio": 4.0443020594965... |
"""Base class for directed graphs."""
# Copyright (C) 2004-2016 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from copy import deepcopy
import networkx as nx
from networkx.classes.graph import Graph
from ne... | {
"repo_name": "andnovar/networkx",
"path": "networkx/classes/digraph.py",
"copies": "2",
"size": "43078",
"license": "bsd-3-clause",
"hash": 4115143863261576700,
"line_mean": 32.3937984496,
"line_max": 89,
"alpha_frac": 0.5455685036,
"autogenerated": false,
"ratio": 4.069721303731696,
"config_t... |
"""Base class for ensemble-based estimators."""
# Authors: Gilles Louppe
# License: BSD 3 clause
from abc import ABCMeta, abstractmethod
import numbers
from typing import List
import numpy as np
from joblib import effective_n_jobs
from ..base import clone
from ..base import is_classifier, is_regressor
from ..base ... | {
"repo_name": "kevin-intel/scikit-learn",
"path": "sklearn/ensemble/_base.py",
"copies": "2",
"size": "10365",
"license": "bsd-3-clause",
"hash": -4589568621278889000,
"line_mean": 34.4965753425,
"line_max": 79,
"alpha_frac": 0.62170767,
"autogenerated": false,
"ratio": 4.60462016881386,
"confi... |
"""Base class for estimators."""
import tensorflow as tf
from ..functions import define_scope, to_array, log_loss
from abc import ABCMeta, abstractmethod, abstractproperty
from six.moves import cPickle as Pickle
from datetime import datetime
from sklearn.metrics import roc_auc_score
class BaseEstimator(metaclass=ABCM... | {
"repo_name": "maxbarkhausen/sparseflow",
"path": "sparseflow/estimators/base_estimator.py",
"copies": "1",
"size": "10289",
"license": "mit",
"hash": 293345431741594560,
"line_mean": 41.341563786,
"line_max": 118,
"alpha_frac": 0.5551559918,
"autogenerated": false,
"ratio": 4.00194476857254,
"... |
"""Base class for Etl SetUp"""
#pylint: disable=unsubscriptable-object
#pylint: disable=relative-import
import os
import abc
import datetime
from .Exceptions import EnvironmentVariableNotSetException
from .method_wrappers.check_attr_set import _check_attr_set
from .utilities.DatetimeConverter import DatetimeConverter... | {
"repo_name": "pantheon-systems/etl-framework",
"path": "etl_framework/BaseEtlSetUp.py",
"copies": "1",
"size": "10464",
"license": "mit",
"hash": -4800450380912306000,
"line_mean": 33.5346534653,
"line_max": 112,
"alpha_frac": 0.5603019878,
"autogenerated": false,
"ratio": 3.6638655462184873,
... |
"""Base class for face detectors
"""
# third party imports
# FIXME[todo]: remove third party dependencies (there are also inline import down in the code)!
import numpy as np
# toolbox imports
from ..detector import ImageDetector
class Detector(ImageDetector):
# pylint: disable=too-many-ancestors
"""Base c... | {
"repo_name": "Petr-By/qtpyvis",
"path": "dltb/tool/face/detector.py",
"copies": "1",
"size": "2736",
"license": "mit",
"hash": -7086519878763963000,
"line_mean": 31.1882352941,
"line_max": 95,
"alpha_frac": 0.5281432749,
"autogenerated": false,
"ratio": 4.228748068006182,
"config_test": false,... |
"""Base-class for file-path strings
"""
import os
class BasePath (str):
"""Representation of a path in a virtual file system
Interact with the paths in an object-oriented way
(following are ideas for what to do)
* Support for standard os and os.path queries
* listdir
* isfile/dir/symlink
* create sub-d... | {
"repo_name": "correl/Transmission-XBMC",
"path": "resources/lib/basictypes/vfs/basepath.py",
"copies": "2",
"size": "5021",
"license": "mit",
"hash": 2316138145994521600,
"line_mean": 31.6038961039,
"line_max": 87,
"alpha_frac": 0.6775542721,
"autogenerated": false,
"ratio": 3.5660511363636362,
... |
"""Base class for filesystem wrappers.
"""
from __future__ import unicode_literals
import typing
import six
from . import errors
from .base import FS
from .copy import copy_file, copy_dir
from .info import Info
from .move import move_file, move_dir
from .path import abspath, join, normpath
from .error_tools import ... | {
"repo_name": "PyFilesystem/pyfilesystem2",
"path": "fs/wrapfs.py",
"copies": "1",
"size": "17852",
"license": "mit",
"hash": 1432026550722064100,
"line_mean": 31.5173041894,
"line_max": 88,
"alpha_frac": 0.541395922,
"autogenerated": false,
"ratio": 3.695301179879942,
"config_test": false,
"... |
'''Base class for finding birds in movies'''
import mpi4py.MPI as mpi
import numpy as np
import pandas as pd
from scipy.stats import norm
import cv2
import pylab as plt
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
import os
import datetime
import time
import subprocess
class Video(object):
... | {
"repo_name": "drdangersimon/image_diff",
"path": "image_diff/detectors/base.py",
"copies": "1",
"size": "12905",
"license": "mit",
"hash": 2166320542672942800,
"line_mean": 39.5817610063,
"line_max": 122,
"alpha_frac": 0.5426578845,
"autogenerated": false,
"ratio": 3.4765625,
"config_test": fa... |
"""Base class for fritzbox_callmonitor entities."""
from contextlib import suppress
from datetime import timedelta
import logging
import re
from fritzconnection.lib.fritzphonebook import FritzPhonebook
from homeassistant.util import Throttle
from .const import REGEX_NUMBER, UNKOWN_NAME
_LOGGER = logging.getLogger(_... | {
"repo_name": "kennedyshead/home-assistant",
"path": "homeassistant/components/fritzbox_callmonitor/base.py",
"copies": "5",
"size": "2417",
"license": "apache-2.0",
"hash": 1760901339173809400,
"line_mean": 30.8026315789,
"line_max": 89,
"alpha_frac": 0.6301199835,
"autogenerated": false,
"ratio... |
"""Base class for fritzbox_callmonitor entities."""
from datetime import timedelta
import logging
import re
from fritzconnection.lib.fritzphonebook import FritzPhonebook
from homeassistant.util import Throttle
from .const import REGEX_NUMBER, UNKOWN_NAME
_LOGGER = logging.getLogger(__name__)
# Return cached result... | {
"repo_name": "turbokongen/home-assistant",
"path": "homeassistant/components/fritzbox_callmonitor/base.py",
"copies": "2",
"size": "2445",
"license": "apache-2.0",
"hash": 3197379257562010600,
"line_mean": 29.9493670886,
"line_max": 89,
"alpha_frac": 0.6122699387,
"autogenerated": false,
"ratio"... |
"""Base class for game application.
Only one application can exist in one interpreter instance.
"""
from tornado import ioloop
from xoinvader.constants import DEFAULT_FPS, DRIVER_NCURSES, DRIVER_SDL
from xoinvader.common import Settings
class ApplicationNotInitializedError(Exception):
"""Raise when try to get ... | {
"repo_name": "pankshok/xoinvader",
"path": "xoinvader/application/__init__.py",
"copies": "1",
"size": "5091",
"license": "mit",
"hash": -2867863612416201000,
"line_mean": 23.2428571429,
"line_max": 77,
"alpha_frac": 0.5987035946,
"autogenerated": false,
"ratio": 4.411611785095321,
"config_tes... |
"""Base class for generating general purpose graphs to external formats.
The primary use for this will be generating GEXF files for use in
visualization.
Routines
--------
LayoutGraph
"""
class LayoutGraph():
"""Base class for networks that will be given layouts for visualization.
For the graph it wraps i... | {
"repo_name": "ADicksonLab/wepy",
"path": "src/wepy/analysis/network_layouts/layout_graph.py",
"copies": "1",
"size": "17237",
"license": "mit",
"hash": -3858948459992450000,
"line_mean": 27.9211409396,
"line_max": 99,
"alpha_frac": 0.5619887451,
"autogenerated": false,
"ratio": 3.890970654627539... |
"""Base class for IKEA TRADFRI."""
from functools import wraps
import logging
from pytradfri.error import PytradfriError
from homeassistant.core import callback
from homeassistant.helpers.entity import Entity
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
def handle_error(func):
"""Handle tra... | {
"repo_name": "sander76/home-assistant",
"path": "homeassistant/components/tradfri/base_class.py",
"copies": "15",
"size": "3536",
"license": "apache-2.0",
"hash": 7596402931798479000,
"line_mean": 26.4108527132,
"line_max": 82,
"alpha_frac": 0.5885180995,
"autogenerated": false,
"ratio": 4.14051... |
"""Base class for IKEA TRADFRI."""
import logging
from pytradfri.error import PytradfriError
from homeassistant.core import callback
from homeassistant.helpers.entity import Entity
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
class TradfriBaseClass(Entity):
"""Base class for IKEA TRADFRI.
... | {
"repo_name": "qedi-r/home-assistant",
"path": "homeassistant/components/tradfri/base_class.py",
"copies": "1",
"size": "3184",
"license": "apache-2.0",
"hash": 1484519903745175000,
"line_mean": 27.1769911504,
"line_max": 82,
"alpha_frac": 0.5882537688,
"autogenerated": false,
"ratio": 4.16209150... |
"""Base class for IKEA TRADFRI."""
import logging
from pytradfri.error import PytradfriError
from homeassistant.core import callback
from homeassistant.helpers.entity import Entity
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
class TradfriBaseClass(Entity):
"""Base class for IKEA TRADFRI.
... | {
"repo_name": "postlund/home-assistant",
"path": "homeassistant/components/tradfri/base_class.py",
"copies": "4",
"size": "3185",
"license": "apache-2.0",
"hash": -6652036688030039000,
"line_mean": 26.9385964912,
"line_max": 82,
"alpha_frac": 0.5880690738,
"autogenerated": false,
"ratio": 4.15796... |
"""Base class for Image, Feature and Collection.
This class is never intended to be instantiated by the user.
"""
# Using lowercase function naming to match the JavaScript names.
# pylint: disable=g-bad-name
import apifunction
import computedobject
import ee_exception
class Element(computedobject.ComputedObject)... | {
"repo_name": "geary/claslite",
"path": "web/app/lib/ee/element.py",
"copies": "5",
"size": "3131",
"license": "unlicense",
"hash": 4851426031876184000,
"line_mean": 31.6145833333,
"line_max": 78,
"alpha_frac": 0.6358990738,
"autogenerated": false,
"ratio": 4.163563829787234,
"config_test": fal... |
"""Base class for implementing servers"""
# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details.
import sys
import _socket
import errno
from gevent.greenlet import Greenlet, getfuncname
from gevent.event import Event
from gevent.hub import string_types, integer_types, get_hub
__all__ = ['BaseServer']
cla... | {
"repo_name": "viger/docker",
"path": "proxy/proxy/code/default/python27/1.0/lib/darwin/gevent/baseserver.py",
"copies": "26",
"size": "11725",
"license": "mit",
"hash": 8631727638280193000,
"line_mean": 35.3003095975,
"line_max": 122,
"alpha_frac": 0.5646908316,
"autogenerated": false,
"ratio": ... |
"""Base class for implementing servers"""
# Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details.
import sys
import _socket
import errno
from gevent.greenlet import Greenlet
from gevent.event import Event
from gevent.hub import get_hub
from gevent._compat import string_types, integer_types, xrange
__all__ =... | {
"repo_name": "burzillibus/RobHome",
"path": "venv/lib/python2.7/site-packages/gevent/baseserver.py",
"copies": "1",
"size": "14939",
"license": "mit",
"hash": 8642184201100433000,
"line_mean": 36.1616915423,
"line_max": 111,
"alpha_frac": 0.5796238035,
"autogenerated": false,
"ratio": 4.31264434... |
""" Base class for integrators. """
# Third-party
import numpy as np
# This project
from ..units import UnitSystem, DimensionlessUnitSystem
__all__ = ["Integrator"]
class Integrator(object):
def __init__(self, func, func_args=(), func_units=None, progress=False):
if not hasattr(func, '__call__'):
... | {
"repo_name": "adrn/gary",
"path": "gala/integrate/core.py",
"copies": "2",
"size": "4203",
"license": "mit",
"hash": 4570922108645449700,
"line_mean": 32.094488189,
"line_max": 80,
"alpha_frac": 0.5386628599,
"autogenerated": false,
"ratio": 4.275686673448627,
"config_test": false,
"has_no_k... |
"""Base class for interface item.
"""
from abc import ABC
class InterfaceItemBase(ABC):
"""Base class for interface item.
:param name: item name
:param description: list of string description elements
:param design_description: list of string design description elements
:param issues: list of i... | {
"repo_name": "smartdevicelink/rpc_spec",
"path": "InterfaceParser/model/interface_item_base.py",
"copies": "1",
"size": "1844",
"license": "bsd-3-clause",
"hash": -423892169193417000,
"line_mean": 42.9047619048,
"line_max": 105,
"alpha_frac": 0.6952277657,
"autogenerated": false,
"ratio": 4.6215... |
"""Base class for iRobot devices."""
import asyncio
import logging
from homeassistant.components.vacuum import (
ATTR_STATUS,
STATE_CLEANING,
STATE_DOCKED,
STATE_ERROR,
STATE_IDLE,
STATE_PAUSED,
STATE_RETURNING,
SUPPORT_BATTERY,
SUPPORT_LOCATE,
SUPPORT_PAUSE,
SUPPORT_RETURN_... | {
"repo_name": "sander76/home-assistant",
"path": "homeassistant/components/roomba/irobot_base.py",
"copies": "3",
"size": "8467",
"license": "apache-2.0",
"hash": 3289548565594531300,
"line_mean": 31.9455252918,
"line_max": 86,
"alpha_frac": 0.6071808197,
"autogenerated": false,
"ratio": 3.756433... |
"""Base class for JSONRPC 2.0 clients."""
from __future__ import print_function
import json
def is_valid_json(stuff):
"""Checks if a string is valid json."""
try:
json.loads(stuff)
except:
return False
else:
return True
class RPCError(Exception):
pass
class JSONRPC(obje... | {
"repo_name": "ChrisCalderon/PyRPCTools",
"path": "rpctools/jsonrpc.py",
"copies": "1",
"size": "2549",
"license": "mit",
"hash": 7422355915307023000,
"line_mean": 28.6395348837,
"line_max": 79,
"alpha_frac": 0.5637504904,
"autogenerated": false,
"ratio": 4.320338983050847,
"config_test": false... |
"""Base class for json rpc clients."""
import os
import codecs
import ujson
from typing import Any, Union, List, Tuple, Dict, Optional, Callable
_hex = codecs.getencoder("hex")
JsonObject = Dict[str, Union[int, str, List['JsonObject'], 'JsonObject']]
JsonParams = Tuple[JsonObject, int, str]
JsonBatch = List[JsonObject... | {
"repo_name": "AugurProject/dapper",
"path": "dapper/rpc_client_base.py",
"copies": "1",
"size": "2697",
"license": "mit",
"hash": -1731323523229631200,
"line_mean": 31.8902439024,
"line_max": 81,
"alpha_frac": 0.5862068966,
"autogenerated": false,
"ratio": 4.001483679525222,
"config_test": fal... |
"""Base class for json-rpc clients."""
from jsonrpc_pyclient import protocolhandler
from jsonrpc_pyclient.batch import BatchResponse
class Client(object):
"""
Base class for json-rpc clients.
This class is a proxy for the server-side object
where the actual processing happens.
"""
... | {
"repo_name": "tvannoy/jsonrpc_pyclient",
"path": "jsonrpc_pyclient/client.py",
"copies": "1",
"size": "3443",
"license": "mit",
"hash": 9103204286470992000,
"line_mean": 32.9393939394,
"line_max": 85,
"alpha_frac": 0.5721754284,
"autogenerated": false,
"ratio": 4.7621023513139695,
"config_test... |
"""Base class for learners in deepmodels.
"""
import abc
import tensorflow as tf
import tensorflow.contrib.slim as slim
from keras.models import Sequential
from deepmodels.core import commons
from deepmodels.core import base_model
from deepmodels.core.dm_models import common as model_common
class DMLearner(object)... | {
"repo_name": "learningsociety/deepmodels",
"path": "deepmodels/core/learners/dm_learner.py",
"copies": "1",
"size": "6546",
"license": "mit",
"hash": -2951405971370606000,
"line_mean": 32.0606060606,
"line_max": 79,
"alpha_frac": 0.6622364803,
"autogenerated": false,
"ratio": 3.5576086956521737,... |
"""Base class for learners in deepmodels.
"""
import abc
import tensorflow as tf
import tensorflow.contrib.slim as slim
from deepmodels.tf.core import commons
from deepmodels.tf.core import base_model
from deepmodels.tf.core.dm_models import common as model_common
class DMLearner(object):
"""Base class for deepm... | {
"repo_name": "flyfj/deepmodels",
"path": "deepmodels/tf/core/learners/dm_learner.py",
"copies": "1",
"size": "6519",
"license": "mit",
"hash": -8998682174246740000,
"line_mean": 32.0913705584,
"line_max": 79,
"alpha_frac": 0.6611443473,
"autogenerated": false,
"ratio": 3.546789989118607,
"conf... |
""" Base class for making API calls to the Janrain API. """
# pylint: disable=E0611
from __future__ import unicode_literals
from janrain.capture.exceptions import ApiResponseError
from janrain.capture.version import __version__
from json import dumps as to_json
from base64 import b64encode
from hashlib import sha1
impo... | {
"repo_name": "janrain/janrain-python-api",
"path": "janrain/capture/api.py",
"copies": "1",
"size": "8073",
"license": "mit",
"hash": -898227896848375700,
"line_mean": 31.9510204082,
"line_max": 80,
"alpha_frac": 0.6000247739,
"autogenerated": false,
"ratio": 4.235571878279119,
"config_test": ... |
""" Base class for making API calls to the UserApp API. """
import sys
import re
import json
import base64
import logging
import requests
class IterableObjectEncoder(json.JSONEncoder):
def default(self, obj):
return obj.source
class IterableObject(object):
"""
Wraps a dictionary and makes it feel... | {
"repo_name": "userapp-io/userapp-python",
"path": "userapp/__init__.py",
"copies": "1",
"size": "11990",
"license": "mit",
"hash": -1192454701578376400,
"line_mean": 30.1454545455,
"line_max": 146,
"alpha_frac": 0.5738115096,
"autogenerated": false,
"ratio": 4.256301029463969,
"config_test": f... |
from __future__ import division
import numpy as np
np.seterr(all='raise')
import logging
import VisionEgg
import pygame
from pygame.locals import K_UP,K_DOWN,K_RIGHT,K_LEFT,K_EQUALS,K_MINUS,K_RSHIFT,K_LSHIFT,K_SPACE,K_RETURN,K_KP_ENTER,KMOD_CTRL
from pygame.locals import K_e,K_0,K_KP0,K_1,K_KP1,K_2,K_KP2, K_t, K_u
fro... | {
"repo_name": "chrox/RealTimeElectrophy",
"path": "StimControl/LightStim/ManStimulus.py",
"copies": "1",
"size": "13493",
"license": "bsd-2-clause",
"hash": 5372292323950103000,
"line_mean": 45.8506944444,
"line_max": 137,
"alpha_frac": 0.6086859853,
"autogenerated": false,
"ratio": 3.65169147496... |
"""Base class for mixture models."""
# Author: Wei Xue <xuewei4d@gmail.com>
# Modified by Thierry Guillemot <thierry.guillemot.work@gmail.com>
# License: BSD 3 clause
from __future__ import print_function
import warnings
from abc import ABCMeta, abstractmethod
from time import time
import numpy as np
from scipy.mis... | {
"repo_name": "ldirer/scikit-learn",
"path": "sklearn/mixture/base.py",
"copies": "2",
"size": "16652",
"license": "bsd-3-clause",
"hash": 2708360303643613000,
"line_mean": 32.171314741,
"line_max": 79,
"alpha_frac": 0.5529666106,
"autogenerated": false,
"ratio": 4.180768265126789,
"config_test... |
"""Base class for mixture models."""
# Author: Wei Xue <xuewei4d@gmail.com>
# Modified by Thierry Guillemot <thierry.guillemot.work@gmail.com>
# License: BSD 3 clause
import warnings
from abc import ABCMeta, abstractmethod
from time import time
import numpy as np
from scipy.special import logsumexp
from .. import c... | {
"repo_name": "xuewei4d/scikit-learn",
"path": "sklearn/mixture/_base.py",
"copies": "11",
"size": "18341",
"license": "bsd-3-clause",
"hash": -8803971435311864000,
"line_mean": 33.2182835821,
"line_max": 79,
"alpha_frac": 0.5610381113,
"autogenerated": false,
"ratio": 4.211481056257176,
"confi... |
"""Base class for mixture models."""
# Author: Wei Xue <xuewei4d@gmail.com>
# Modified by Thierry Guillemot <thierry.guillemot.work@gmail.com>
from __future__ import print_function
import warnings
from abc import ABCMeta, abstractmethod
from time import time
import numpy as np
from .. import cluster
from ..base im... | {
"repo_name": "moutai/scikit-learn",
"path": "sklearn/mixture/base.py",
"copies": "15",
"size": "14393",
"license": "bsd-3-clause",
"hash": -5543512089402292000,
"line_mean": 31.5633484163,
"line_max": 79,
"alpha_frac": 0.5551309664,
"autogenerated": false,
"ratio": 4.174303944315545,
"config_t... |
'''Base class for :mod:`argparse`-based interactive :mod:`cmd` sessions.
.. This software is released under an MIT/X11 open source license.
Copyright 2014 Diffeo, Inc.
.. autoclass:: ArgParseCmd
'''
from __future__ import absolute_import
import argparse
from cmd import Cmd
import logging
import pdb
import shlex
... | {
"repo_name": "diffeo/yakonfig",
"path": "yakonfig/cmd.py",
"copies": "1",
"size": "6756",
"license": "mit",
"hash": -4842802869997555000,
"line_mean": 33.824742268,
"line_max": 80,
"alpha_frac": 0.5634991119,
"autogenerated": false,
"ratio": 4.2357366771159874,
"config_test": false,
"has_no_... |
"""Base class for MPF controllers."""
import abc
from mpf.core.logging import LogMixin
MYPY = False
if MYPY: # pragma: no cover
from mpf.core.machine import MachineController # pylint: disable-msg=cyclic-import,unused-import
class MpfController(LogMixin, metaclass=abc.ABCMeta):
"""Base class for MPF cont... | {
"repo_name": "missionpinball/mpf",
"path": "mpf/core/mpf_controller.py",
"copies": "1",
"size": "1177",
"license": "mit",
"hash": -4505464745346571000,
"line_mean": 30.8108108108,
"line_max": 101,
"alpha_frac": 0.629566695,
"autogenerated": false,
"ratio": 4.159010600706714,
"config_test": tru... |
"""Base class for MultiDiGraph."""
# Copyright (C) 2004-2011 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from copy import deepcopy
import networkx as nx
from networkx.classes.graph import Graph # for doc... | {
"repo_name": "Duke-NSOE/GeoHAT",
"path": "GeoHat_V10/Scripts/networkx/classes/multidigraph.py",
"copies": "1",
"size": "28562",
"license": "cc0-1.0",
"hash": -5230185473405414000,
"line_mean": 32.6023529412,
"line_max": 90,
"alpha_frac": 0.5366921084,
"autogenerated": false,
"ratio": 4.100200976... |
"""Base class for MultiDiGraph."""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from copy import deepcopy
import networkx as nx
from networkx.classes.graph import Graph # for doc... | {
"repo_name": "jni/networkx",
"path": "networkx/classes/multidigraph.py",
"copies": "1",
"size": "33360",
"license": "bsd-3-clause",
"hash": -520203484309632450,
"line_mean": 34.0788643533,
"line_max": 90,
"alpha_frac": 0.5528477218,
"autogenerated": false,
"ratio": 4.014440433212997,
"config_t... |
"""Base class for MultiDiGraph."""
# Copyright (C) 2004-2016 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from copy import deepcopy
import networkx as nx
from networkx.classes.graph import Graph # for doc... | {
"repo_name": "SanketDG/networkx",
"path": "networkx/classes/multidigraph.py",
"copies": "2",
"size": "34318",
"license": "bsd-3-clause",
"hash": 9002251432698291000,
"line_mean": 34.8974895397,
"line_max": 90,
"alpha_frac": 0.5493909902,
"autogenerated": false,
"ratio": 4.056501182033097,
"con... |
"""Base class for MultiGraph."""
# Copyright (C) 2004-2015 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from copy import deepcopy
import networkx as nx
from networkx.classes.graph import Graph
from network... | {
"repo_name": "harlowja/networkx",
"path": "networkx/classes/multigraph.py",
"copies": "20",
"size": "36439",
"license": "bsd-3-clause",
"hash": 1980794758295332000,
"line_mean": 33.2793979304,
"line_max": 90,
"alpha_frac": 0.5296797387,
"autogenerated": false,
"ratio": 3.9055734190782423,
"con... |
"""Base class for MultiGraph."""
# Copyright (C) 2004-2016 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
from copy import deepcopy
import networkx as nx
from networkx.classes.graph import Graph
from network... | {
"repo_name": "SanketDG/networkx",
"path": "networkx/classes/multigraph.py",
"copies": "2",
"size": "35381",
"license": "bsd-3-clause",
"hash": 1263068819300076300,
"line_mean": 33.4844054581,
"line_max": 106,
"alpha_frac": 0.5328848817,
"autogenerated": false,
"ratio": 3.943930442537064,
"conf... |
"""Base class for multi level switches in devolo Home Control."""
import logging
from .devolo_device import DevoloDeviceEntity
_LOGGER = logging.getLogger(__name__)
class DevoloMultiLevelSwitchDeviceEntity(DevoloDeviceEntity):
"""Representation of a multi level switch device within devolo Home Control. Somethin... | {
"repo_name": "tchellomello/home-assistant",
"path": "homeassistant/components/devolo_home_control/devolo_multi_level_switch.py",
"copies": "2",
"size": "1332",
"license": "apache-2.0",
"hash": -711827788594709200,
"line_mean": 37.0571428571,
"line_max": 124,
"alpha_frac": 0.6441441441,
"autogenera... |
"""Base class for Namespace proxies in class creation."""
import weakref
from . import ops
from .proxy import _Proxy
_NAMESPACES = weakref.WeakKeyDictionary()
_OWNERS = weakref.WeakKeyDictionary()
def namespace(self):
"""Return the associated Namespace."""
return _owner(self).proxies[self]
def _owner(sel... | {
"repo_name": "mwchase/class-namespaces",
"path": "src/class_namespaces/scope_proxy.py",
"copies": "1",
"size": "1251",
"license": "mit",
"hash": 8015712271681010000,
"line_mean": 22.6037735849,
"line_max": 73,
"alpha_frac": 0.6123101519,
"autogenerated": false,
"ratio": 4.009615384615385,
"con... |
"""Base class for nbviewer tests.
Derived from IPython.html notebook test case in 2.0
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, ... | {
"repo_name": "iamjakob/nbviewer",
"path": "nbviewer/tests/base.py",
"copies": "8",
"size": "3675",
"license": "bsd-3-clause",
"hash": -2267412742889690000,
"line_mean": 25.25,
"line_max": 78,
"alpha_frac": 0.546122449,
"autogenerated": false,
"ratio": 4.364608076009501,
"config_test": true,
... |
"""Base class for Netatmo entities."""
from __future__ import annotations
from homeassistant.core import CALLBACK_TYPE, callback
from homeassistant.helpers.entity import Entity
from .const import DATA_DEVICE_IDS, DOMAIN, MANUFACTURER, MODELS, SIGNAL_NAME
from .data_handler import PUBLICDATA_DATA_CLASS_NAME, NetatmoDa... | {
"repo_name": "kennedyshead/home-assistant",
"path": "homeassistant/components/netatmo/netatmo_entity_base.py",
"copies": "1",
"size": "3570",
"license": "apache-2.0",
"hash": -3240175481076495000,
"line_mean": 33,
"line_max": 88,
"alpha_frac": 0.5647058824,
"autogenerated": false,
"ratio": 4.175... |
"""Base class for Netatmo entities."""
from __future__ import annotations
import logging
from homeassistant.core import CALLBACK_TYPE, callback
from homeassistant.helpers.entity import Entity
from .const import DATA_DEVICE_IDS, DOMAIN, MANUFACTURER, MODELS, SIGNAL_NAME
from .data_handler import NetatmoDataHandler
_... | {
"repo_name": "sander76/home-assistant",
"path": "homeassistant/components/netatmo/netatmo_entity_base.py",
"copies": "3",
"size": "3509",
"license": "apache-2.0",
"hash": -7592478836468375000,
"line_mean": 31.4907407407,
"line_max": 79,
"alpha_frac": 0.5645483044,
"autogenerated": false,
"ratio"... |
"""Base class for Netatmo entities."""
import logging
from typing import Dict, List
from homeassistant.core import CALLBACK_TYPE, callback
from homeassistant.helpers.entity import Entity
from .const import DATA_DEVICE_IDS, DOMAIN, MANUFACTURER, MODELS, SIGNAL_NAME
from .data_handler import NetatmoDataHandler
_LOGGER... | {
"repo_name": "partofthething/home-assistant",
"path": "homeassistant/components/netatmo/netatmo_entity_base.py",
"copies": "1",
"size": "3503",
"license": "mit",
"hash": 1308314884450666500,
"line_mean": 31.738317757,
"line_max": 79,
"alpha_frac": 0.5646588638,
"autogenerated": false,
"ratio": 4... |
"""Base class for notebook tests."""
from __future__ import print_function
import sys
import time
import requests
from contextlib import contextmanager
from subprocess import Popen, STDOUT
from unittest import TestCase
import nose
from IPython.utils.tempdir import TemporaryDirectory
MAX_WAITTIME = 30 # seconds t... | {
"repo_name": "WillisXChen/django-oscar",
"path": "oscar/lib/python2.7/site-packages/IPython/html/tests/launchnotebook.py",
"copies": "7",
"size": "3184",
"license": "bsd-3-clause",
"hash": -3868815072709105700,
"line_mean": 30.2254901961,
"line_max": 94,
"alpha_frac": 0.6064698492,
"autogenerated"... |
"""Base class for OpenGL contexts.
This module wraps large parts of per-context state.
@todo: Provide convenience setters for C{glBlendFunc} via C{blend_func=("SRC_ALPHA", "ONE_MINUS_SRC_ALPHA")}.
@todo: Add listing of all bound textures, buffers, etc.
@todo: Do we need indexed variants for C{glEnable}?
@todo: Wrap C... | {
"repo_name": "swenger/glitter",
"path": "glitter/contexts/context.py",
"copies": "1",
"size": "22494",
"license": "mit",
"hash": -6288946193242307000,
"line_mean": 55.6599496222,
"line_max": 293,
"alpha_frac": 0.6916955633,
"autogenerated": false,
"ratio": 3.3329382130686027,
"config_test": tr... |
"""Base class for optimizers."""
# pylint: disable=g-bad-name
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import ops
from tensorflow.python.framework import types as tf_types
from tensorflow.python.ops import array_ops
f... | {
"repo_name": "brodyh/tensorflow",
"path": "tensorflow/python/training/optimizer.py",
"copies": "2",
"size": "15119",
"license": "apache-2.0",
"hash": -7544266981075334000,
"line_mean": 34.2424242424,
"line_max": 80,
"alpha_frac": 0.6701501422,
"autogenerated": false,
"ratio": 4.052264808362369,
... |
"""Base class for optimizers."""
# pylint: disable=g-bad-name
from tensorflow.python.framework import ops
from tensorflow.python.framework import types as tf_types
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import gradients
from tensorflow.... | {
"repo_name": "javierblasco/tensorflow",
"path": "tensorflow/python/training/optimizer.py",
"copies": "5",
"size": "15003",
"license": "apache-2.0",
"hash": 7175516173120545000,
"line_mean": 34.3011764706,
"line_max": 80,
"alpha_frac": 0.6695327601,
"autogenerated": false,
"ratio": 4.051579800162... |
"""Base class for other `openstack.common.wsgi` classes."""
import routes.middleware
import webob.dec
class Application(object):
"""WSGI application class."""
@webob.dec.wsgify
def __call__(self, request):
"""Called on every request to this application."""
msg = _("WSGI applications must... | {
"repo_name": "blamarvt/openstack-common",
"path": "src/openstack/common/wsgi/base.py",
"copies": "1",
"size": "3385",
"license": "apache-2.0",
"hash": 612989526285248600,
"line_mean": 31.2380952381,
"line_max": 78,
"alpha_frac": 0.6174298375,
"autogenerated": false,
"ratio": 4.721059972105997,
... |
"""base class for parallel client tests
Authors:
* Min RK
"""
#-------------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of t... | {
"repo_name": "noslenfa/tdjangorest",
"path": "uw/lib/python2.7/site-packages/IPython/parallel/tests/clienttest.py",
"copies": "2",
"size": "5502",
"license": "apache-2.0",
"hash": 3082410497405103600,
"line_mean": 28.902173913,
"line_max": 119,
"alpha_frac": 0.562522719,
"autogenerated": false,
... |
"""Base class for patching time and I/O modules."""
import sys
import inspect
class BasePatcher(object):
"""Base class for patching time and I/O modules."""
# These modules will not be patched by default, unless explicitly specified
# in `modules_to_patch`.
# This is done to prevent time-travel from... | {
"repo_name": "snudler6/time-travel",
"path": "src/time_travel/patchers/base_patcher.py",
"copies": "1",
"size": "5702",
"license": "mit",
"hash": -4847940306778699000,
"line_mean": 37.0133333333,
"line_max": 79,
"alpha_frac": 0.5743598737,
"autogenerated": false,
"ratio": 4.658496732026144,
"c... |
"""Base class for platform implementations
"""
import ctypes
from OpenGL.platform import ctypesloader
from OpenGL._bytes import as_8_bit
import sys
from OpenGL import _configflags
from OpenGL import logs, MODULE_ANNOTATIONS
class _CheckContext( object ):
def __init__( self, func, ccisvalid ):
self.func = f... | {
"repo_name": "frederica07/Dragon_Programming_Process",
"path": "PyOpenGL-3.0.2/OpenGL/platform/baseplatform.py",
"copies": "1",
"size": "14695",
"license": "bsd-2-clause",
"hash": -3359159034228540000,
"line_mean": 36.1085858586,
"line_max": 178,
"alpha_frac": 0.5505954406,
"autogenerated": false,... |
"""Base class for platform implementations
"""
import ctypes
from OpenGL.platform import ctypesloader
import sys
import OpenGL as top_level_module
from OpenGL import logs, MODULE_ANNOTATIONS
class _CheckContext( object ):
def __init__( self, func, ccisvalid ):
self.func = func
self.ccisvalid = cc... | {
"repo_name": "Universal-Model-Converter/UMC3.0a",
"path": "data/Python/x86/Lib/site-packages/OpenGL/platform/baseplatform.py",
"copies": "1",
"size": "14377",
"license": "mit",
"hash": -6759131653036238000,
"line_mean": 35.9588688946,
"line_max": 178,
"alpha_frac": 0.5513667664,
"autogenerated": f... |
"""Base class for Plugin classes."""
from .exceptions import PluginMethodNotImplementedError
class BasePlugin:
"""Base class for APISpec plugin classes."""
def init_spec(self, spec):
"""Initialize plugin with APISpec object
:param APISpec spec: APISpec object this plugin instance is attach... | {
"repo_name": "marshmallow-code/apispec",
"path": "src/apispec/plugin.py",
"copies": "1",
"size": "2990",
"license": "mit",
"hash": 1938737409658394600,
"line_mean": 42.3333333333,
"line_max": 106,
"alpha_frac": 0.6906354515,
"autogenerated": false,
"ratio": 4.686520376175548,
"config_test": fa... |
"""Base class for Portal models."""
import datetime
from django.db import models
import autoslug
class BaseModel(models.Model):
slug = None # overrided by subclasses
class Meta:
app_label = "ocrlab"
abstract = True
@property
def options(self):
return self._meta
@models... | {
"repo_name": "mikesname/python-ocrlab",
"path": "ocrsite/ocrlab/models/base.py",
"copies": "1",
"size": "1989",
"license": "mit",
"hash": -3810537508705447000,
"line_mean": 25.1710526316,
"line_max": 72,
"alpha_frac": 0.6244343891,
"autogenerated": false,
"ratio": 3.83976833976834,
"config_tes... |
"""Base class for preprocessors"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from ..utils.base import NbConvertBase
from IPython.utils.traitlets import Bool
class Preprocessor(NbConvertBase):
""" A configurable preprocessor
Inherit from this class... | {
"repo_name": "mattvonrocketstein/smash",
"path": "smashlib/ipy3x/nbconvert/preprocessors/base.py",
"copies": "1",
"size": "2831",
"license": "mit",
"hash": 1853209813470071000,
"line_mean": 30.1098901099,
"line_max": 76,
"alpha_frac": 0.6291063229,
"autogenerated": false,
"ratio": 5.252319109461... |
"""Base class for preprocessors"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from ..utils.base import NbConvertBase
from traitlets import Bool
class Preprocessor(NbConvertBase):
""" A configurable preprocessor
Inherit from this class if you wish to... | {
"repo_name": "nitin-cherian/LifeLongLearning",
"path": "Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/nbconvert/preprocessors/base.py",
"copies": "1",
"size": "2886",
"license": "mit",
"hash": -2182484786910204200,
"line_mean": 31.0666666667,
"line_max": 85,
"a... |
"""Base class for problem/dataset definitions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import copy
import functools
import multiprocessing
import os
import random
import six
import tensorflow as tf
from tensorflow.contrib.tpu.... | {
"repo_name": "mlperf/training_results_v0.6",
"path": "Google/benchmarks/transformer/implementations/tpu-v3-1024-transformer/transformer/data_generators/problem.py",
"copies": "6",
"size": "48166",
"license": "apache-2.0",
"hash": 4602502579535899600,
"line_mean": 34.2606149341,
"line_max": 80,
"alph... |
''' Base class for reading and pushing to eslasticsearch'''
__author__="Mike Stabile, contact @ mstabile75@gmail.com"
import sys
import os
import inspect
import logging
import csv
import pdb
import argparse
import requests
import json
import pprint
from elasticsearch import Elasticsearch, helpers
from ... | {
"repo_name": "KnowledgeLinks/rdfframework",
"path": "rdfframework/search/elasticsearchbase.py",
"copies": "1",
"size": "14060",
"license": "mit",
"hash": 6194877266859141000,
"line_mean": 37.8300283286,
"line_max": 85,
"alpha_frac": 0.4738975818,
"autogenerated": false,
"ratio": 4.15976331360946... |
"""Base class for real-world parsers (such as parser.Parser)"""
from simpleparse.stt.TextTools.TextTools import *
from simpleparse.generator import Generator
class BaseParser:
"""Class on which real-world parsers build
Normally you use a sub-class of this class, such as
simpleparser.parser.Parser
"""
_rootProduc... | {
"repo_name": "alexus37/AugmentedRealityChess",
"path": "pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/simpleparse/baseparser.py",
"copies": "1",
"size": "2472",
"license": "mit",
"hash": -1212976728700466200,
"line_mean": 36.4545454545,
"line_max": 121,
"alpha_f... |
""" Base class for records. """
from abc import ABCMeta, abstractmethod
from .utils import set_encoded
class InserterRegistry(object):
""" Registry of inserters. """
def __init__(self):
self._inserters = []
self._register_inserters()
def _register_inserters(self):
""" Register ... | {
"repo_name": "enthought/sandia-data-archive",
"path": "sdafile/record_inserter.py",
"copies": "1",
"size": "6072",
"license": "bsd-3-clause",
"hash": 7662115121032054000,
"line_mean": 27.641509434,
"line_max": 75,
"alpha_frac": 0.5886034256,
"autogenerated": false,
"ratio": 4.343347639484978,
... |
"""Base class for ResourceSync capabilities with large lists of resources.
Handles possibly large lists by including support for both sitemaps and
sitemapindexes. Extends ListBase to add the support for sitemapindexes.
"""
import collections
import math
import os
from datetime import datetime
import re
import sys
imp... | {
"repo_name": "resync/resync",
"path": "resync/list_base_with_index.py",
"copies": "1",
"size": "18088",
"license": "apache-2.0",
"hash": -2560914520610367500,
"line_mean": 41.8625592417,
"line_max": 133,
"alpha_frac": 0.5976890756,
"autogenerated": false,
"ratio": 4.402044293015332,
"config_te... |
"""Base class for ResourceSync capabilities with list of resources.
Adds Sitemap based IO to the ResourceContainer class and is
intended as the base class for ResourceList, ChangeList,
CapabilityList etc.. Adds common read() and write() methods.
"""
from datetime import datetime
import io
import os
import re
import s... | {
"repo_name": "resync/resync",
"path": "resync/list_base.py",
"copies": "1",
"size": "5375",
"license": "apache-2.0",
"hash": -3187460752674913000,
"line_mean": 33.9025974026,
"line_max": 83,
"alpha_frac": 0.6165581395,
"autogenerated": false,
"ratio": 4.279458598726115,
"config_test": false,
... |
"""Base class for ResourceSync capabilities with list of resources
Adds Sitemap based IO to the ResourceContainer class and is
intended as the base class for ResourceList, ChangeList,
CapabilityList etc.. Adds common read() and write() methods.
"""
import collections
import os
from datetime import datetime
import re
... | {
"repo_name": "dans-er/resync",
"path": "resync/list_base.py",
"copies": "2",
"size": "4222",
"license": "apache-2.0",
"hash": -2478710458965205000,
"line_mean": 32.776,
"line_max": 98,
"alpha_frac": 0.6309805779,
"autogenerated": false,
"ratio": 4.3796680497925315,
"config_test": false,
"has... |
"""Base class for ResourceSync capabilities with lists of resources including
support for both sitemaps and sitemapindexes.
Extends ListBase to add support for sitemapindexes.
"""
import collections
import math
import os
from datetime import datetime
import re
import sys
import itertools
from urllib import URLopene... | {
"repo_name": "dans-er/resync",
"path": "resync/list_base_with_index.py",
"copies": "2",
"size": "16893",
"license": "apache-2.0",
"hash": 4305874715153147000,
"line_mean": 45.029972752,
"line_max": 181,
"alpha_frac": 0.6196057539,
"autogenerated": false,
"ratio": 4.3382126348228045,
"config_te... |
"""Base class for Rituals Perfume Genie diffuser entity."""
from __future__ import annotations
from pyrituals import Diffuser
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from . import RitualsDataUpdateCoordinator
from .const import ATTRIB... | {
"repo_name": "home-assistant/home-assistant",
"path": "homeassistant/components/rituals_perfume_genie/entity.py",
"copies": "2",
"size": "2010",
"license": "apache-2.0",
"hash": 1077250537035873400,
"line_mean": 29.9230769231,
"line_max": 87,
"alpha_frac": 0.6537313433,
"autogenerated": false,
"... |
"""Base class for robotics environments."""
#!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | {
"repo_name": "google-research/relay-policy-learning",
"path": "adept_envs/adept_envs/robot_env.py",
"copies": "1",
"size": "5492",
"license": "apache-2.0",
"hash": 7306827597007363000,
"line_mean": 32.0843373494,
"line_max": 80,
"alpha_frac": 0.6067006555,
"autogenerated": false,
"ratio": 4.2839... |
"""Base-class for scenegraph nodes
Requires Python 2.2.x, as it makes
extensive use of properties
"""
from vrml import field, fieldtypes, weaklist, weakkeydictfix
from vrml import copier as copiermodule
from vrml import olist
from vrml.protofunctions import *
from pydispatch import dispatcher
import weakref
class Nod... | {
"repo_name": "menpo/vrml97",
"path": "vrml/node.py",
"copies": "2",
"size": "18165",
"license": "bsd-3-clause",
"hash": -4673191728989113000,
"line_mean": 34.9702970297,
"line_max": 173,
"alpha_frac": 0.5741260666,
"autogenerated": false,
"ratio": 4.51080208592004,
"config_test": false,
"has... |
"""Base class for SciUnit models."""
import inspect
from fnmatch import fnmatchcase
from typing import Union
from sciunit.base import SciUnit
from sciunit.capabilities import Capability
class Model(SciUnit):
"""Abstract base class for sciunit models."""
def __init__(self, name=None, **params):
"""I... | {
"repo_name": "scidash/sciunit",
"path": "sciunit/models/base.py",
"copies": "1",
"size": "4506",
"license": "mit",
"hash": 4708073799100748000,
"line_mean": 30.5104895105,
"line_max": 83,
"alpha_frac": 0.5650244119,
"autogenerated": false,
"ratio": 4.583926754832146,
"config_test": false,
"h... |
"""Base class for serial communicator."""
from typing import Optional
import asyncio
from serial import SerialException, EIGHTBITS, PARITY_NONE, STOPBITS_ONE
from mpf.core.utility_functions import Util
MYPY = False
if MYPY: # pragma: no cover
from mpf.core.machine import MachineController # pylint: disable-m... | {
"repo_name": "missionpinball/mpf",
"path": "mpf/platforms/base_serial_communicator.py",
"copies": "1",
"size": "6292",
"license": "mit",
"hash": -3237888876948619000,
"line_mean": 34.5480225989,
"line_max": 115,
"alpha_frac": 0.5815321043,
"autogenerated": false,
"ratio": 4.158625247851949,
"c... |
"""Base class for service helpers"""
__author__ = "Amanjeev Sethi"
import logging
class BaseService(object):
@staticmethod
def steps_to_execute(initial_language="", cascade_steps=[]):
"""construct the final steps to execute, checks whether the original language
is the first and the last ite... | {
"repo_name": "amanjeev/ulit",
"path": "ulit/base_service.py",
"copies": "1",
"size": "1120",
"license": "mit",
"hash": -6592782389628342000,
"line_mean": 36.3333333333,
"line_max": 111,
"alpha_frac": 0.66875,
"autogenerated": false,
"ratio": 4.516129032258065,
"config_test": false,
"has_no_k... |
"""Base class for sharded document storage (for phylesystem, tree collections, etc.)
N.B. that this class has no knowledge of different document types. It provides
basic functionality common to minimal *Proxy classes with remote shards, and
more full-featured subclasses based on TypeAwareDocStore.
"""
from threading im... | {
"repo_name": "OpenTreeOfLife/peyotl",
"path": "peyotl/git_storage/sharded_doc_store.py",
"copies": "2",
"size": "3219",
"license": "bsd-2-clause",
"hash": 2673682460305380000,
"line_mean": 38.7407407407,
"line_max": 106,
"alpha_frac": 0.6172724449,
"autogenerated": false,
"ratio": 3.906553398058... |
"""Base class for SharedKeyDB and VerifierDB."""
import anydbm
import thread
class BaseDB:
def __init__(self, filename, type):
self.type = type
self.filename = filename
if self.filename:
self.db = None
else:
self.db = {}
self.lock = thread.allocate_l... | {
"repo_name": "webspinner/webspinner-gae-cms",
"path": "gdata/tlslite/BaseDB.py",
"copies": "121",
"size": "3389",
"license": "bsd-3-clause",
"hash": -3677194648445566000,
"line_mean": 27.25,
"line_max": 78,
"alpha_frac": 0.5455886692,
"autogenerated": false,
"ratio": 4.356041131105399,
"config... |
"""Base class for SharedKeyDB and VerifierDB."""
import dbm.ndbm
import _thread
class BaseDB:
def __init__(self, filename, type):
self.type = type
self.filename = filename
if self.filename:
self.db = None
else:
self.db = {}
self.lock = _thread.alloca... | {
"repo_name": "webmedic/booker",
"path": "src/gdata/tlslite/BaseDB.py",
"copies": "1",
"size": "3397",
"license": "mit",
"hash": -1227868207086220800,
"line_mean": 27.3166666667,
"line_max": 78,
"alpha_frac": 0.5451869296,
"autogenerated": false,
"ratio": 4.338441890166028,
"config_test": false... |
"""Base class for SharedKeyDB and VerifierDB."""
import dbm
import _thread
class BaseDB:
def __init__(self, filename, type):
self.type = type
self.filename = filename
if self.filename:
self.db = None
else:
self.db = {}
self.lock = _thread.allocate_lo... | {
"repo_name": "zhuwenping/python-for-android",
"path": "python3-alpha/extra_modules/gdata/tlslite/BaseDB.py",
"copies": "46",
"size": "3382",
"license": "apache-2.0",
"hash": 8607378262183415000,
"line_mean": 27.1916666667,
"line_max": 78,
"alpha_frac": 0.5440567711,
"autogenerated": false,
"rati... |
"""Base class for SharedKeyDB and VerifierDB."""
import dbm
import _thread
class BaseDB:
def __init__(self, filename, type):
self.type = type
self.filename = filename
if self.filename:
self.db = None
else:
self.db = {}
self.lock = _threa... | {
"repo_name": "acil-bwh/SlicerCIP",
"path": "Scripted/attic/PicasaSnap/gdata/tlslite/BaseDB.py",
"copies": "1",
"size": "3501",
"license": "bsd-3-clause",
"hash": -1352339761562850300,
"line_mean": 27.1916666667,
"line_max": 78,
"alpha_frac": 0.5255641245,
"autogenerated": false,
"ratio": 4.51741... |
"""Base class for simulator backends for SciUnit models."""
import inspect
import pickle
import shelve
import tempfile
from pathlib import Path
from typing import Any, Union
from sciunit.base import SciUnit
available_backends = {}
def register_backends(vars: dict) -> None:
"""Register backends for use with mod... | {
"repo_name": "scidash/sciunit",
"path": "sciunit/models/backends.py",
"copies": "1",
"size": "6362",
"license": "mit",
"hash": -5880485314377841000,
"line_mean": 32.3089005236,
"line_max": 94,
"alpha_frac": 0.6020119459,
"autogenerated": false,
"ratio": 4.086062941554271,
"config_test": false,... |
"""Base class for SOM and Neural Gas."""
import json
import logging
import time
import types
from collections import Counter, defaultdict
from typing import Callable, Dict, List, Optional, Tuple, TypeVar
import numpy as np
from tqdm import tqdm
from somber.components.utilities import shuffle, Scaler
from somber.compo... | {
"repo_name": "stephantul/somber",
"path": "somber/base.py",
"copies": "1",
"size": "19473",
"license": "mit",
"hash": -3878877699799614500,
"line_mean": 34.3411978221,
"line_max": 98,
"alpha_frac": 0.5840907924,
"autogenerated": false,
"ratio": 4.141429179072735,
"config_test": false,
"has_n... |
"""Base class for source collector unit tests."""
import io
import json
import logging
import pathlib
import unittest
import sys
import zipfile
from typing import Union
from unittest.mock import AsyncMock, PropertyMock, patch
import aiohttp
from base_collectors import MetricsCollector
MODULE_DIR = pathlib.Path(__f... | {
"repo_name": "ICTU/quality-time",
"path": "components/collector/tests/source_collectors/source_collector_test_case.py",
"copies": "1",
"size": "6013",
"license": "apache-2.0",
"hash": 7959972917784406000,
"line_mean": 43.5407407407,
"line_max": 118,
"alpha_frac": 0.6579078663,
"autogenerated": fal... |
"""Base class for sparse matrices"""
from __future__ import division, print_function, absolute_import
__all__ = ['spmatrix', 'isspmatrix', 'issparse',
'SparseWarning','SparseEfficiencyWarning']
import sys
from warnings import warn
import numpy as np
from scipy.lib.six import xrange
from .sputils import isde... | {
"repo_name": "18padx08/PPTex",
"path": "PPTexEnv_x86_64/lib/python2.7/site-packages/scipy/sparse/base.py",
"copies": "7",
"size": "28713",
"license": "mit",
"hash": 3860460471780683000,
"line_mean": 32.0794930876,
"line_max": 84,
"alpha_frac": 0.5261379863,
"autogenerated": false,
"ratio": 4.214... |
"""Base class for sparse matrices"""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy._lib.six import xrange
from scipy._lib._numpy_compat import broadcast_to
from .sputils import (isdense, isscalarlike, isintlike,
get_sum_dtype, validateaxis, check_... | {
"repo_name": "lhilt/scipy",
"path": "scipy/sparse/base.py",
"copies": "3",
"size": "41413",
"license": "bsd-3-clause",
"hash": 8656053430968718000,
"line_mean": 32.8895253682,
"line_max": 80,
"alpha_frac": 0.5465192089,
"autogenerated": false,
"ratio": 4.399086466964096,
"config_test": false,
... |
"""Base class for sparse matrices"""
from __future__ import division, print_function, absolute_import
import numpy as np
from .sputils import (isdense, isscalarlike, isintlike,
get_sum_dtype, validateaxis, check_reshape_kwargs,
check_shape, asmatrix)
__all__ = ['spmatrix',... | {
"repo_name": "arokem/scipy",
"path": "scipy/sparse/base.py",
"copies": "1",
"size": "41296",
"license": "bsd-3-clause",
"hash": 5920575312784621000,
"line_mean": 32.8491803279,
"line_max": 80,
"alpha_frac": 0.5455976366,
"autogenerated": false,
"ratio": 4.398338481201406,
"config_test": false,... |
"""Base class for sparse matrices"""
from __future__ import division, print_function, absolute_import
import sys
import numpy as np
from scipy._lib.six import xrange
from .sputils import (isdense, isscalarlike, isintlike,
get_sum_dtype, validateaxis)
__all__ = ['spmatrix', 'isspmatrix', 'isspa... | {
"repo_name": "DailyActie/Surrogate-Model",
"path": "01-codes/scipy-master/scipy/sparse/base.py",
"copies": "1",
"size": "37355",
"license": "mit",
"hash": -4977592840305957000,
"line_mean": 32.5022421525,
"line_max": 79,
"alpha_frac": 0.5368223799,
"autogenerated": false,
"ratio": 4.353729603729... |
"""Base class for sparse matrices"""
from __future__ import division, print_function, absolute_import
import sys
import numpy as np
from scipy._lib.six import xrange
from scipy._lib._numpy_compat import broadcast_to
from .sputils import (isdense, isscalarlike, isintlike,
get_sum_dtype, validate... | {
"repo_name": "gfyoung/scipy",
"path": "scipy/sparse/base.py",
"copies": "3",
"size": "41295",
"license": "bsd-3-clause",
"hash": 2727414259816673300,
"line_mean": 32.8483606557,
"line_max": 80,
"alpha_frac": 0.5467247851,
"autogenerated": false,
"ratio": 4.393552505585701,
"config_test": false... |
"""Base class for sparse matrices"""
from __future__ import division, print_function, absolute_import
import sys
import numpy as np
from scipy._lib.six import xrange
from .sputils import (isdense, isscalarlike, isintlike,
get_sum_dtype, validateaxis)
__all__ = ['spmatrix', 'isspmatrix', 'isspa... | {
"repo_name": "matthewalbani/scipy",
"path": "scipy/sparse/base.py",
"copies": "7",
"size": "36362",
"license": "bsd-3-clause",
"hash": -3416447471194782700,
"line_mean": 32.5133640553,
"line_max": 79,
"alpha_frac": 0.5361091249,
"autogenerated": false,
"ratio": 4.337587975665036,
"config_test"... |
"""Base class for sparse matrices"""
import numpy as np
from .sputils import (isdense, isscalarlike, isintlike,
get_sum_dtype, validateaxis, check_reshape_kwargs,
check_shape, asmatrix)
__all__ = ['spmatrix', 'isspmatrix', 'issparse',
'SparseWarning', 'SparseEffi... | {
"repo_name": "anntzer/scipy",
"path": "scipy/sparse/base.py",
"copies": "12",
"size": "42095",
"license": "bsd-3-clause",
"hash": -2588575053285987300,
"line_mean": 33.0850202429,
"line_max": 80,
"alpha_frac": 0.5475234588,
"autogenerated": false,
"ratio": 4.390383813099708,
"config_test": fal... |
"""Base class for sparse matrices"""
__all__ = ['spmatrix', 'isspmatrix', 'issparse',
'SparseWarning','SparseEfficiencyWarning']
from warnings import warn
import numpy as np
from sputils import isdense, isscalarlike, isintlike
class SparseWarning(Warning): pass
class SparseFormatWarning(SparseWarning): pa... | {
"repo_name": "stefanv/scipy3",
"path": "scipy/sparse/base.py",
"copies": "2",
"size": "18848",
"license": "bsd-3-clause",
"hash": -4515927305277416000,
"line_mean": 29.6471544715,
"line_max": 82,
"alpha_frac": 0.5325233447,
"autogenerated": false,
"ratio": 4.107212900414034,
"config_test": fal... |
"""Base class for sparse matrice with a .data attribute
subclasses must provide a _with_data() method that
creates a new matrix with the same sparsity pattern
as self but with a different data array
"""
__all__ = []
from base import spmatrix
from sputils import isscalarlike
#TODO implement all relevant... | {
"repo_name": "lesserwhirls/scipy-cwt",
"path": "scipy/sparse/data.py",
"copies": "10",
"size": "1743",
"license": "bsd-3-clause",
"hash": -7445292726677060000,
"line_mean": 24.6323529412,
"line_max": 59,
"alpha_frac": 0.5788869765,
"autogenerated": false,
"ratio": 3.890625,
"config_test": fals... |
"""Base class for sparse matrix formats using compressed storage."""
__all__ = []
from warnings import warn
import operator
import numpy as np
from scipy._lib._util import _prune_array
from .base import spmatrix, isspmatrix, SparseEfficiencyWarning
from .data import _data_matrix, _minmax_mixin
from .dia import dia_m... | {
"repo_name": "aeklant/scipy",
"path": "scipy/sparse/compressed.py",
"copies": "3",
"size": "50412",
"license": "bsd-3-clause",
"hash": -8824457687028539000,
"line_mean": 38.0790697674,
"line_max": 79,
"alpha_frac": 0.5233872887,
"autogenerated": false,
"ratio": 3.983878615457563,
"config_test"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.