text stringlengths 0 1.05M | meta dict |
|---|---|
from enum import Enum
from twisted.internet import defer
import json
class Trigger:
jtype = "DEF"
def check_trigger(self, field):
d = defer.Deferred()
d.callback(False)
return d
def to_dict(self):
return {"Type": self.jtype}
@staticmethod
def create_from_dict(jdi... | {
"repo_name": "tsnik/SkyNet",
"path": "snp/Script.py",
"copies": "1",
"size": "8930",
"license": "mit",
"hash": 60043090505400344,
"line_mean": 25.4201183432,
"line_max": 105,
"alpha_frac": 0.5804031355,
"autogenerated": false,
"ratio": 3.771114864864865,
"config_test": false,
"has_no_keyword... |
from enum import Enum
from typing import Any, Dict, List
from malcolm.core import Info, VMeta
class DatasetType(Enum):
"""NeXus type of a produced dataset"""
#: Detector data, like the 2D data from an imaging detector
PRIMARY = "primary"
#: Calculated from detector data, like the sum of each frame
... | {
"repo_name": "dls-controls/pymalcolm",
"path": "malcolm/modules/scanning/infos.py",
"copies": "1",
"size": "5488",
"license": "apache-2.0",
"hash": -1630105922906790100,
"line_mean": 29.8314606742,
"line_max": 84,
"alpha_frac": 0.644861516,
"autogenerated": false,
"ratio": 4.280811232449298,
"... |
from enum import Enum
from typing import Any, Dict, List, NoReturn, Optional, Tuple, Type, TypeVar
from django.core.exceptions import ValidationError
from django.utils.translation import gettext as _
T = TypeVar("T", bound="AbstractEnum")
class AbstractEnum(Enum):
"""An enumeration whose members are used strict... | {
"repo_name": "zulip/zulip",
"path": "zerver/lib/exceptions.py",
"copies": "2",
"size": "12066",
"license": "apache-2.0",
"hash": -1947565380763243800,
"line_mean": 27.1258741259,
"line_max": 100,
"alpha_frac": 0.6453671474,
"autogenerated": false,
"ratio": 3.9495908346972177,
"config_test": fa... |
from enum import Enum
from typing import Any, Dict, List, NoReturn, Optional, Tuple, Type, TypeVar
from django.utils.translation import gettext as _
T = TypeVar("T", bound="AbstractEnum")
class AbstractEnum(Enum):
"""An enumeration whose members are used strictly for their names."""
def __new__(cls: Type[T... | {
"repo_name": "eeshangarg/zulip",
"path": "zerver/lib/exceptions.py",
"copies": "1",
"size": "10552",
"license": "apache-2.0",
"hash": -4903023308983244000,
"line_mean": 26.9893899204,
"line_max": 100,
"alpha_frac": 0.6355193328,
"autogenerated": false,
"ratio": 3.8737151248164463,
"config_test... |
from enum import Enum
from typing import Any, Dict, List, NoReturn, Optional, Type, TypeVar
from django.utils.translation import gettext as _
T = TypeVar("T", bound="AbstractEnum")
class AbstractEnum(Enum):
"""An enumeration whose members are used strictly for their names."""
def __new__(cls: Type[T]) -> T... | {
"repo_name": "punchagan/zulip",
"path": "zerver/lib/exceptions.py",
"copies": "2",
"size": "9997",
"license": "apache-2.0",
"hash": 4468962230554995000,
"line_mean": 26.7694444444,
"line_max": 100,
"alpha_frac": 0.6365909773,
"autogenerated": false,
"ratio": 3.891397430906968,
"config_test": f... |
from enum import Enum
from typing import Any, Dict, List, NoReturn, Optional, Type, TypeVar
from django.utils.translation import ugettext as _
T = TypeVar("T", bound="AbstractEnum")
class AbstractEnum(Enum):
'''An enumeration whose members are used strictly for their names.'''
def __new__(cls: Type[T]) -> T... | {
"repo_name": "shubhamdhama/zulip",
"path": "zerver/lib/exceptions.py",
"copies": "2",
"size": "7676",
"license": "apache-2.0",
"hash": -2740525295410198500,
"line_mean": 30.4590163934,
"line_max": 100,
"alpha_frac": 0.6377019281,
"autogenerated": false,
"ratio": 3.946529562982005,
"config_test... |
from enum import Enum
from typing import Any, Dict, List, NoReturn, Optional, Type, TypeVar
from django.utils.translation import ugettext as _
T = TypeVar("T", bound="AbstractEnum")
class AbstractEnum(Enum):
"""An enumeration whose members are used strictly for their names."""
def __new__(cls: Type[T]) -> ... | {
"repo_name": "hackerkid/zulip",
"path": "zerver/lib/exceptions.py",
"copies": "1",
"size": "9998",
"license": "apache-2.0",
"hash": -8293308024604000000,
"line_mean": 26.7722222222,
"line_max": 100,
"alpha_frac": 0.6366273255,
"autogenerated": false,
"ratio": 3.8917866874270146,
"config_test":... |
from enum import Enum
from typing import Any, Dict, List, Optional, Text, Type
from django.core.exceptions import PermissionDenied
class AbstractEnum(Enum):
'''An enumeration whose members are used strictly for their names.'''
def __new__(cls):
# type: (Type[AbstractEnum]) -> AbstractEnum
obj... | {
"repo_name": "brockwhittaker/zulip",
"path": "zerver/lib/exceptions.py",
"copies": "3",
"size": "4911",
"license": "apache-2.0",
"hash": -5006548195332857000,
"line_mean": 31.3092105263,
"line_max": 83,
"alpha_frac": 0.5931582162,
"autogenerated": false,
"ratio": 4.085690515806989,
"config_tes... |
from enum import Enum
from typing import Any, Dict, List, Optional, Type
from mypy_extensions import NoReturn
from django.core.exceptions import PermissionDenied
from django.utils.translation import ugettext as _
class AbstractEnum(Enum):
'''An enumeration whose members are used strictly for their names.'''
... | {
"repo_name": "dhcrzf/zulip",
"path": "zerver/lib/exceptions.py",
"copies": "1",
"size": "6081",
"license": "apache-2.0",
"hash": 5420896724238038000,
"line_mean": 30.8376963351,
"line_max": 85,
"alpha_frac": 0.6295017267,
"autogenerated": false,
"ratio": 3.9667318982387476,
"config_test": fals... |
from enum import Enum
from typing import Any, Dict, List, Tuple, Union
import numpy as np
from annotypes import Array
from p4p import Type, Value
from malcolm.compat import OrderedDict
from malcolm.core import AlarmSeverity, AlarmStatus
from malcolm.core.models import NTTable
EMPTY = Value(Type([]))
# https://mdavi... | {
"repo_name": "dls-controls/pymalcolm",
"path": "malcolm/modules/pva/controllers/pvaconvert.py",
"copies": "1",
"size": "4727",
"license": "apache-2.0",
"hash": -2636555301078078000,
"line_mean": 30.5133333333,
"line_max": 85,
"alpha_frac": 0.5667442352,
"autogenerated": false,
"ratio": 3.4937176... |
from enum import Enum
from typing import Any, Dict, List, Type
from mypy_extensions import NoReturn
from django.core.exceptions import PermissionDenied
from django.utils.translation import ugettext as _
class AbstractEnum(Enum):
'''An enumeration whose members are used strictly for their names.'''
def __new_... | {
"repo_name": "rishig/zulip",
"path": "zerver/lib/exceptions.py",
"copies": "1",
"size": "6395",
"license": "apache-2.0",
"hash": 1060394071900440200,
"line_mean": 30.6584158416,
"line_max": 85,
"alpha_frac": 0.6297107115,
"autogenerated": false,
"ratio": 3.945095619987662,
"config_test": false... |
from enum import Enum
from typing import Any, Dict, List, Type, Optional
from typing_extensions import NoReturn
from django.core.exceptions import PermissionDenied
from django.utils.translation import ugettext as _
class AbstractEnum(Enum):
'''An enumeration whose members are used strictly for their names.'''
... | {
"repo_name": "tommyip/zulip",
"path": "zerver/lib/exceptions.py",
"copies": "1",
"size": "6864",
"license": "apache-2.0",
"hash": -2370370154083246000,
"line_mean": 30.9255813953,
"line_max": 100,
"alpha_frac": 0.6325757576,
"autogenerated": false,
"ratio": 3.938037865748709,
"config_test": fa... |
from enum import Enum
from typing import Any, Dict, List, Type, TypeVar, Optional
from typing_extensions import NoReturn
from django.core.exceptions import PermissionDenied
from django.utils.translation import ugettext as _
T = TypeVar("T", bound="AbstractEnum")
class AbstractEnum(Enum):
'''An enumeration whose... | {
"repo_name": "rht/zulip",
"path": "zerver/lib/exceptions.py",
"copies": "1",
"size": "7425",
"license": "apache-2.0",
"hash": 6195167806620732000,
"line_mean": 30.7307692308,
"line_max": 100,
"alpha_frac": 0.6374410774,
"autogenerated": false,
"ratio": 3.949468085106383,
"config_test": false,
... |
from enum import Enum
from typing import Any, Iterable, List, Optional, Union
from valohai_yaml.excs import ValidationErrors
from valohai_yaml.lint import LintResult
from valohai_yaml.utils import listify
from .base import Item
class MultipleMode(Enum):
"""How to serialize multiple values given for a parameter.... | {
"repo_name": "valohai/valohai-yaml",
"path": "valohai_yaml/objs/parameter.py",
"copies": "1",
"size": "8852",
"license": "mit",
"hash": 6212291820478550000,
"line_mean": 36.6680851064,
"line_max": 119,
"alpha_frac": 0.5682331676,
"autogenerated": false,
"ratio": 4.203228869895536,
"config_test... |
from enum import Enum
from typing import Any, Iterator, Mapping
import dask
import pandas as pd
from .hook import flatten_hooks, group_hooks, RuntimeHook
from .process import RuntimeSignal
from .stores import ZarrSimulationStore
from .utils import get_batch_size, MAIN_CLOCK
class ValidateOption(Enum):
INPUTS = ... | {
"repo_name": "benbovy/xarray-simlab",
"path": "xsimlab/drivers.py",
"copies": "1",
"size": "14807",
"license": "bsd-3-clause",
"hash": 6986876817208359000,
"line_mean": 28.2051282051,
"line_max": 89,
"alpha_frac": 0.594921321,
"autogenerated": false,
"ratio": 3.9422257720979768,
"config_test":... |
from enum import Enum
from typing import Any, List, Dict, Union, Optional
import bugsnag
from bugsnag.breadcrumbs import BreadcrumbType
from bugsnag.legacy import _auto_leave_breadcrumb
from bugsnag.utils import sanitize_url
__all__ = ('BugsnagMiddleware',)
SEVERITY_REASON = {
"type": "unhandledExceptionMiddlewa... | {
"repo_name": "bugsnag/bugsnag-python",
"path": "bugsnag/asgi.py",
"copies": "1",
"size": "4602",
"license": "mit",
"hash": -8035990461156891000,
"line_mean": 30.306122449,
"line_max": 76,
"alpha_frac": 0.5645371578,
"autogenerated": false,
"ratio": 3.860738255033557,
"config_test": true,
"ha... |
from enum import Enum
from typing import Any, List, Optional, Type, TypeVar
_T = TypeVar('_T')
class EnumBase(Enum):
@classmethod
def values(enum_class: Type[_T]) -> Any:
return [x.value for x in enum_class] # type: ignore
@classmethod
def parse(enum_class: Type[_T], value: str) -> _T:
... | {
"repo_name": "jldbc/pybaseball",
"path": "pybaseball/enums/enum_base.py",
"copies": "1",
"size": "1232",
"license": "mit",
"hash": -4521173708067282000,
"line_mean": 27.6511627907,
"line_max": 125,
"alpha_frac": 0.5892857143,
"autogenerated": false,
"ratio": 3.8620689655172415,
"config_test": ... |
from enum import Enum
from typing import Any
__author__ = "Timothy Heys"
__email__ = "theys@kayak.com"
class Arithmetic(Enum):
add = "+"
sub = "-"
mul = "*"
div = "/"
lshift = "<<"
rshift = ">>"
class Comparator(Enum):
pass
class Equality(Comparator):
eq = "="
ne = "<>"
gt... | {
"repo_name": "kayak/pypika",
"path": "pypika/enums.py",
"copies": "1",
"size": "3057",
"license": "apache-2.0",
"hash": 60213053149982350,
"line_mean": 18.4713375796,
"line_max": 76,
"alpha_frac": 0.5538109257,
"autogenerated": false,
"ratio": 3.1004056795131847,
"config_test": false,
"has_n... |
from enum import Enum
from typing import Any
import mugen.video.detect as v_detect
from mugen.mixins.Filterable import Filter, ContextFilter
from mugen.video.segments import Segment
""" FILTER FUNCTIONS """
def is_repeat(segment: Segment, memory: Any) -> bool:
return v_detect.video_segment_is_repeat(segment, vi... | {
"repo_name": "scherroman/mugen",
"path": "mugen/video/video_filters.py",
"copies": "1",
"size": "2278",
"license": "mit",
"hash": -2455396349755422000,
"line_mean": 25.488372093,
"line_max": 99,
"alpha_frac": 0.6852502195,
"autogenerated": false,
"ratio": 3.467275494672755,
"config_test": fals... |
from enum import Enum
from typing import Dict, Any
from pydantic import BaseModel as PydanticBaseModel, Extra
from ray.core.generated import common_pb2
class BaseModel(PydanticBaseModel):
class Config:
arbitrary_types_allowed = True
extra = Extra.forbid
class Language(str, Enum):
PYTHON = co... | {
"repo_name": "ray-project/ray",
"path": "dashboard/modules/job/job_description.py",
"copies": "1",
"size": "1725",
"license": "apache-2.0",
"hash": 466104650851532400,
"line_mean": 33.7959183673,
"line_max": 77,
"alpha_frac": 0.675659824,
"autogenerated": false,
"ratio": 3.515463917525773,
"co... |
from enum import Enum
from typing import Dict, List
__all__ = [
"Keys",
"ALL_KEYS",
]
class Keys(str, Enum):
"""
List of keys for use in key bindings.
Note that this is an "StrEnum", all values can be compared against
strings.
"""
value: str
Escape = "escape" # Also Control-[
... | {
"repo_name": "sserrot/champion_relationships",
"path": "venv/Lib/site-packages/prompt_toolkit/keys.py",
"copies": "2",
"size": "4885",
"license": "mit",
"hash": 1381405346403705900,
"line_mean": 21.3059360731,
"line_max": 70,
"alpha_frac": 0.5602865916,
"autogenerated": false,
"ratio": 2.6621253... |
from enum import Enum
from typing import Dict, List
from robot.board import Board
class PinMode(Enum):
"""A pin-mode for a pin on the servo board."""
INPUT = 'Z'
INPUT_PULLUP = 'P'
OUTPUT_HIGH = 'H'
OUTPUT_LOW = 'L'
class PinValue(Enum):
"""A value state for a pin on the servo board."""
... | {
"repo_name": "sourcebots/robot-api",
"path": "robot/servo.py",
"copies": "1",
"size": "6734",
"license": "mit",
"hash": 6495623046283731000,
"line_mean": 29.8899082569,
"line_max": 87,
"alpha_frac": 0.5611820612,
"autogenerated": false,
"ratio": 3.734886300610094,
"config_test": false,
"has_... |
from enum import Enum
from typing import Dict, List, Optional, Sequence
import torch
from fairseq.data import Dictionary
class EncoderLangtok(Enum):
"""
Prepend to the beginning of source sentence either the
source or target language token. (src/tgt).
"""
src = "src"
tgt = "tgt"
class Lang... | {
"repo_name": "pytorch/fairseq",
"path": "fairseq/data/multilingual/multilingual_utils.py",
"copies": "1",
"size": "1623",
"license": "mit",
"hash": 4665592876987067000,
"line_mean": 24.7619047619,
"line_max": 85,
"alpha_frac": 0.6358595194,
"autogenerated": false,
"ratio": 3.353305785123967,
"... |
from enum import Enum
from typing import Dict, List, Optional, Tuple
from doom.level import Line, LineFlags, Sector, Side, Thing, ThingFlags, Vertex
from utils.lexer import Lexer, Rule
class UDMFParserError(Exception):
def __init__(self, message: str, position: Tuple[int, int]):
super(Exception, self).__... | {
"repo_name": "GitExl/DoomIdgamesArchive",
"path": "idgames-extract/src/doom/udmfparser.py",
"copies": "1",
"size": "14677",
"license": "bsd-2-clause",
"hash": -3341827261695192600,
"line_mean": 32.7402298851,
"line_max": 131,
"alpha_frac": 0.5847925325,
"autogenerated": false,
"ratio": 3.3935260... |
from enum import Enum
from typing import Dict, List, Tuple
from .cards import Card
from .constants import VALUES
class HandValues(Enum):
STRAIGHT_FLUSH = 8
QUADS = 7
FULL_HOUSE = 6
FLUSH = 5
STRAIGHT = 4
TRIPS = 3
TWO_PAIR = 2
ONE_PAIR = 1
HIGH_CARD = 0
def _count_values(cards: List[Card]) -> Dict[str, Lis... | {
"repo_name": "tychung84/poker_tester",
"path": "poker_player/hands.py",
"copies": "1",
"size": "5845",
"license": "mit",
"hash": 1607508124792050400,
"line_mean": 34.4242424242,
"line_max": 107,
"alpha_frac": 0.6781864842,
"autogenerated": false,
"ratio": 2.9254254254254253,
"config_test": fal... |
from enum import Enum
from typing import Dict, List, Union, Optional
from linear_operator import LOLambda, LOMu
from counter import Counter
class VariableType(Enum):
INPUT = 0
OUTPUT = 1
UNKNOWN = 2
ZERO = 3
def __str__(self) -> str:
return {VariableType.INPUT: 'a',
Variab... | {
"repo_name": "oguzey/differential-analysis-MISTY-type-ciphers",
"path": "dp_analyzer/variable.py",
"copies": "1",
"size": "4707",
"license": "mit",
"hash": -1645487010857179600,
"line_mean": 32.8633093525,
"line_max": 97,
"alpha_frac": 0.5430210325,
"autogenerated": false,
"ratio": 3.85503685503... |
from enum import Enum
from typing import Dict
from opentrons.types import Point, Mount
from robot_server.robot.calibration.constants import STATE_WILDCARD
class TipCalibrationState(str, Enum):
sessionStarted = "sessionStarted"
labwareLoaded = "labwareLoaded"
measuringNozzleOffset = "measuringNozzleOffset"... | {
"repo_name": "OpenTrons/opentrons-api",
"path": "robot-server/robot_server/robot/calibration/tip_length/constants.py",
"copies": "2",
"size": "1454",
"license": "apache-2.0",
"hash": 1376790431379574500,
"line_mean": 32.8139534884,
"line_max": 77,
"alpha_frac": 0.7077028886,
"autogenerated": false... |
from enum import Enum
from typing import Dict
import requests
class ImportType(Enum):
"""
Import types can be found in the School Guide to Importing and Exporting Data 2017 document
"""
STUDENT = 1
PARENT = 12
SAT_BEFORE_MAR_2016 = 5
SAT = 39
PSAT_BEFORE_OCT_2015 = 6
PSAT = 29
... | {
"repo_name": "IronCountySchoolDistrict/naviance-client",
"path": "naviance/Naviance.py",
"copies": "1",
"size": "4003",
"license": "mit",
"hash": 2877006847124929500,
"line_mean": 30.5196850394,
"line_max": 134,
"alpha_frac": 0.5860604547,
"autogenerated": false,
"ratio": 4.039354187689203,
"c... |
from enum import Enum
from typing import Dict, Optional
from plenum.common.channel import TxChannel, RxChannel, create_direct_channel, Router
from plenum.common.constants import POOL_LEDGER_ID, AUDIT_LEDGER_ID, AUDIT_TXN_LEDGERS_SIZE, AUDIT_TXN_LEDGER_ROOT, \
CONFIG_LEDGER_ID
from plenum.common.ledger import Ledge... | {
"repo_name": "evernym/zeno",
"path": "plenum/server/catchup/node_leecher_service.py",
"copies": "2",
"size": "10381",
"license": "apache-2.0",
"hash": -978684586721412900,
"line_mean": 39.7098039216,
"line_max": 120,
"alpha_frac": 0.5866486851,
"autogenerated": false,
"ratio": 3.7873039036847866... |
from enum import Enum
from typing import Iterable, Dict
import torch.nn.functional as F
from torch import nn, Tensor
from sentence_transformers.SentenceTransformer import SentenceTransformer
class SiameseDistanceMetric(Enum):
"""
The metric for the contrastive loss
"""
EUCLIDEAN = lambda x, y: F.pairw... | {
"repo_name": "UKPLab/sentence-transformers",
"path": "sentence_transformers/losses/ContrastiveLoss.py",
"copies": "1",
"size": "3214",
"license": "apache-2.0",
"hash": -896627701577359400,
"line_mean": 44.9142857143,
"line_max": 162,
"alpha_frac": 0.6972619788,
"autogenerated": false,
"ratio": 3... |
from enum import Enum
from typing import Iterable
from attr import attrib, attrs
class TypeKind(Enum):
SCALAR = "Represents scalar types such as Int, String, and Boolean. Scalars cannot have fields."
OBJECT = "Object types represent concrete instantiations of sets of fields. "
UNION = "Unions are an abst... | {
"repo_name": "polygraph-python/polygraph",
"path": "polygraph/types.py",
"copies": "1",
"size": "4921",
"license": "mit",
"hash": 6231661569402239000,
"line_mean": 30.0696202532,
"line_max": 100,
"alpha_frac": 0.6663271542,
"autogenerated": false,
"ratio": 4.080631753948462,
"config_test": fal... |
from enum import Enum
from typing import Iterator, List, Optional, Tuple
import re
class _TokenType(Enum):
LPAREN = 1
RPAREN = 2
LBRACE = 3
RBRACE = 4
LBRACK = 5
RBRACK = 6
KW = 7
IDENT = 8
COMMA = 9
COLON = 10
class _Keyword(Enum):
IN = 1
OUT = 2
INOUT = 3
clas... | {
"repo_name": "X2CommunityCore/X2WOTCCommunityHighlander",
"path": ".scripts/make_docs/event_tuples.py",
"copies": "1",
"size": "8682",
"license": "mit",
"hash": 6263253242239097000,
"line_mean": 26.6496815287,
"line_max": 89,
"alpha_frac": 0.5375489519,
"autogenerated": false,
"ratio": 3.5050464... |
from enum import Enum
from typing import Iterator, NamedTuple
from . import Note, NoteData, NoteType
from ..timing import TimingData
from ..timing.engine import SongTime, TimingEngine
__all__ = ['TimedNote', 'UnhittableNotes', 'time_notes']
class TimedNote(NamedTuple):
"""
A note with its song time attache... | {
"repo_name": "garcia/simfile",
"path": "simfile/notes/timed.py",
"copies": "1",
"size": "1810",
"license": "mit",
"hash": 4819146067619074000,
"line_mean": 28.2096774194,
"line_max": 74,
"alpha_frac": 0.6193370166,
"autogenerated": false,
"ratio": 3.762993762993763,
"config_test": false,
"ha... |
from enum import Enum
from typing import List, Any, cast
import yass
from tutorial.base_types_external import Integer
# shows how to use contract internal base types
class ExpirationHandler(yass.BaseTypeHandler):
def readBase(self, reader): # type: (yass.Reader) -> Expiration
return Expiration(
... | {
"repo_name": "sushicutta/yass",
"path": "py2/tutorial/generated/contract/__init__.py",
"copies": "1",
"size": "2697",
"license": "bsd-3-clause",
"hash": -5399833754033642000,
"line_mean": 28,
"line_max": 82,
"alpha_frac": 0.6214312199,
"autogenerated": false,
"ratio": 3.52088772845953,
"config... |
from enum import Enum
from typing import List, NamedTuple, Union, Any, Tuple
_sentinel = object()
class AspectRatio(float, Enum):
FULLSCREEN = 4 / 3
WIDESCREEN = 16 / 9
ULTRAWIDE = 21 / 9
class DimensionsBase(NamedTuple):
width: int
height: int
class Dimensions(DimensionsBase):
__slots__ ... | {
"repo_name": "scherroman/mugen",
"path": "mugen/video/sizing.py",
"copies": "1",
"size": "3267",
"license": "mit",
"hash": -8680964338070182000,
"line_mean": 32,
"line_max": 120,
"alpha_frac": 0.6675849403,
"autogenerated": false,
"ratio": 3.979293544457978,
"config_test": false,
"has_no_key... |
from enum import Enum
from typing import List
from random import randint
class Suit(Enum):
SPADE = 0
CLUB = 1
HEART = 2
DIAMOND = 3
def __str__(self) -> str:
return str(self.name).capitalize()
class Rank(Enum):
ACE = 1
TWO = 2
THREE = 3
FOUR = 4
FIVE = 5
SIX = 6
... | {
"repo_name": "jonjesbuzz/cards",
"path": "python/cards.py",
"copies": "1",
"size": "1613",
"license": "mit",
"hash": 5687092305539702000,
"line_mean": 21.4027777778,
"line_max": 67,
"alpha_frac": 0.4631122133,
"autogenerated": false,
"ratio": 3.4465811965811968,
"config_test": false,
"has_no... |
from enum import Enum
from typing import List
from data_refinery_common import utils
from data_refinery_common.logging import get_and_configure_logger
from data_refinery_common.models import (
OriginalFile,
OriginalFileSampleAssociation,
ProcessorJob,
Sample,
)
logger = get_and_configure_logger(__nam... | {
"repo_name": "data-refinery/data_refinery",
"path": "common/data_refinery_common/job_lookup.py",
"copies": "1",
"size": "9606",
"license": "bsd-3-clause",
"hash": -4220227975028269000,
"line_mean": 40.9475982533,
"line_max": 105,
"alpha_frac": 0.6762440142,
"autogenerated": false,
"ratio": 3.987... |
from enum import Enum
from typing import List
import re
from addressing import ImmediateReadAddressing, Addressing, ZeroPageAddressing, ZeroPageAddressingWithX, \
AbsoluteAddressing, AbsoluteAddressingWithX, AbsoluteAddressingWithY, IndirectAddressingWithX, \
IndirectAddressingWithY, ZeroPageAddressingWithY, ... | {
"repo_name": "PyAndy/Py3NES",
"path": "helpers.py",
"copies": "1",
"size": "2367",
"license": "apache-2.0",
"hash": -7320055949580394000,
"line_mean": 31.4246575342,
"line_max": 114,
"alpha_frac": 0.6683565695,
"autogenerated": false,
"ratio": 3.5223214285714284,
"config_test": false,
"has_n... |
from enum import Enum
from typing import List
import re
from pyminutiaeviewer.errors import CorruptFileError
from pyminutiaeviewer.minutia import Minutia, MinutiaType
class MinutiaeFileFormat(Enum):
NBIST = "NBIST"
MINDTCT = "MINDTCT"
SIMPLE = "SIMPLE"
XYT = "XYT"
class MinutiaeReader(object):
... | {
"repo_name": "IgniparousTempest/py-minutiae-viewer",
"path": "pyminutiaeviewer/minutiae_reader.py",
"copies": "1",
"size": "4110",
"license": "mit",
"hash": 8647642814847574000,
"line_mean": 27.7412587413,
"line_max": 112,
"alpha_frac": 0.5761557178,
"autogenerated": false,
"ratio": 3.4335839598... |
from enum import Enum
from typing import List, Optional
from .resources import ProjectData
from .util import AttrEqMixin, ReprStrMixin
class Location(Enum):
FX_AREA = 0
VOICE_AREA = 1
@staticmethod
def from_int(i: int):
if i == 0:
return Location.FX_AREA
elif i == 1:
... | {
"repo_name": "gleb812/pch2csd",
"path": "pch2csd/patch.py",
"copies": "1",
"size": "6411",
"license": "mit",
"hash": 3493152159619235300,
"line_mean": 28.9579439252,
"line_max": 96,
"alpha_frac": 0.5673061925,
"autogenerated": false,
"ratio": 3.5264026402640263,
"config_test": false,
"has_no... |
from enum import Enum
from typing import List, Optional
import strawberry
from strawberry.types.datetime import DateTime
@strawberry.enum
class PretixOrderStatus(Enum):
PENDING = "n"
PAID = "p"
EXPIRED = "e"
CANCELED = "c"
@strawberry.type
class PretixOrder:
code: str
status: PretixOrderSta... | {
"repo_name": "patrick91/pycon",
"path": "backend/api/pretix/types.py",
"copies": "1",
"size": "1531",
"license": "mit",
"hash": 7719768356604449000,
"line_mean": 17.4457831325,
"line_max": 53,
"alpha_frac": 0.6453298498,
"autogenerated": false,
"ratio": 3.350109409190372,
"config_test": false,... |
from enum import Enum
from typing import List, Optional, Union
from app.data_objects.github_event import GithubEvent
from app.exceptions.triggear_error import TriggearError
class CollectionNames:
RELEASE = 'release'
LABELED = 'labeled'
OPENED = 'opened'
TAGGED = 'tagged'
PUSH = 'push'
class Eve... | {
"repo_name": "futuresimple/triggear",
"path": "app/enums/event_types.py",
"copies": "1",
"size": "2620",
"license": "mit",
"hash": 8777278836535174000,
"line_mean": 36.9710144928,
"line_max": 121,
"alpha_frac": 0.6091603053,
"autogenerated": false,
"ratio": 4.049459041731066,
"config_test": fa... |
from enum import Enum
from typing import List, Optional, Union
from .base import Item
class KeepDirectories(Enum):
"""How to retain directories when using storage wildcards."""
NONE = 'none'
SUFFIX = 'suffix'
FULL = 'full'
@classmethod
def cast(cls, value: Union[bool, str]) -> 'KeepDirector... | {
"repo_name": "valohai/valohai-yaml",
"path": "valohai_yaml/objs/input.py",
"copies": "1",
"size": "1446",
"license": "mit",
"hash": -7927840554531929000,
"line_mean": 28.5102040816,
"line_max": 76,
"alpha_frac": 0.6106500692,
"autogenerated": false,
"ratio": 4.3293413173652695,
"config_test": ... |
from enum import Enum
from typing import List, Optional, Union
from openbrokerapi.catalog import (
ServiceDashboardClient,
ServiceMetadata,
ServicePlan,
)
from openbrokerapi.settings import DISABLE_SPACE_ORG_GUID_CHECK
class ProvisionDetails:
def __init__(self,
service_id: str,
... | {
"repo_name": "eruvanos/openbrokerapi",
"path": "openbrokerapi/service_broker.py",
"copies": "1",
"size": "17885",
"license": "mit",
"hash": -8452800760395432000,
"line_mean": 35.9524793388,
"line_max": 185,
"alpha_frac": 0.5847358121,
"autogenerated": false,
"ratio": 4.773151854817187,
"config... |
from enum import Enum
from typing import List, Optional, Union
class RequestConstructor:
""" Construct requests to Facebook Messenger API.
"""
syntax = {}
def build(self):
""" Convert self.syntax to dict, removing None's.
"""
params = {}
for k, v in self.syntax.items()... | {
"repo_name": "0xKirill/fblib",
"path": "fblib/messenger/common.py",
"copies": "1",
"size": "14018",
"license": "isc",
"hash": 3221906885334686000,
"line_mean": 37.1961852861,
"line_max": 96,
"alpha_frac": 0.5812526751,
"autogenerated": false,
"ratio": 4.916871273237461,
"config_test": false,
... |
from enum import Enum
from typing import Mapping, Sequence, Optional, TypeVar, Any
from ._compat import (
bytes,
is_bare,
is_frozenset,
is_mapping,
is_mutable_set,
is_py2,
is_sequence,
is_tuple,
is_union_type,
lru_cache,
unicode,
)
from .disambiguators import create_uniq_fiel... | {
"repo_name": "randyzingle/tools",
"path": "kub/services/archive/cdk/python/sample-app/.env/lib/python3.6/site-packages/cattr/converters.py",
"copies": "1",
"size": "15431",
"license": "apache-2.0",
"hash": 7620096906808159000,
"line_mean": 35.7404761905,
"line_max": 79,
"alpha_frac": 0.5630224872,
... |
from enum import Enum
from typing import NamedTuple, Dict, List, Mapping
from pyrsistent.typing import PMap
from solo.configurator.config.routes import ViewMeta
from solo.configurator.config.sums import SumType
class HttpMethod(Enum):
HEAD = 'head'
GET = 'get'
POST = 'post'
def __lt__(self, other: ... | {
"repo_name": "avanov/solo",
"path": "solo/server/definitions.py",
"copies": "1",
"size": "1125",
"license": "mit",
"hash": -5070044644793666000,
"line_mean": 18.7543859649,
"line_max": 78,
"alpha_frac": 0.6604444444,
"autogenerated": false,
"ratio": 3.5266457680250785,
"config_test": false,
... |
from enum import Enum
from typing import NamedTuple
from yahtr.game import game_instance
from yahtr.ui.tile import Tile
from yahtr.utils.color import Color
from yahtr.utils.log import create_ui_logger
logger = create_ui_logger('ReachablePool')
class ReachableType(Enum):
selected_unit = Color(98, 51, 142, 255)
... | {
"repo_name": "fp12/yahtr",
"path": "yahtr/ui/utils/reachable_pool.py",
"copies": "1",
"size": "5898",
"license": "mit",
"hash": 3550624359290087000,
"line_mean": 36.5668789809,
"line_max": 125,
"alpha_frac": 0.5335707019,
"autogenerated": false,
"ratio": 3.9346230820547032,
"config_test": fals... |
from enum import Enum
from typing import NamedTuple, Optional, Any, Dict, Sequence
from src.constants_and_defined_types import ActionId, RoleId, ActionParamSubst, \
ActionParamSubstList
class EventType(Enum):
use_floating_permission = 'use_floating_permission'
fulfill_floating_obligation = 'fulfill_float... | {
"repo_name": "legalese-io/legalese-compiler",
"path": "L4/pyL4/src/model/EventsAndTraces.py",
"copies": "2",
"size": "1130",
"license": "apache-2.0",
"hash": 7864441665326870000,
"line_mean": 28.7368421053,
"line_max": 81,
"alpha_frac": 0.714159292,
"autogenerated": false,
"ratio": 3.32352941176... |
from enum import Enum
from typing import NamedTuple, Tuple
class Course(NamedTuple):
code: str
name: str
hours: int
requirements: Tuple['Course']
def __repr__(self):
return self.code
class Curriculum(Enum):
EEL5105 = Course('EEL5105',
'Circuitos e Técnicas Digit... | {
"repo_name": "cauebs/cco-graph",
"path": "cco.py",
"copies": "1",
"size": "4223",
"license": "mit",
"hash": -8995824715205326000,
"line_mean": 29.4452554745,
"line_max": 81,
"alpha_frac": 0.5159434188,
"autogenerated": false,
"ratio": 3.05791788856305,
"config_test": false,
"has_no_keywords"... |
from enum import Enum
from typing import (
Any,
Callable,
Collection,
Dict,
Generic,
List,
NamedTuple,
Optional,
TYPE_CHECKING,
Type,
TypeVar,
Union,
cast,
overload,
)
from ..error import GraphQLError
from ..language import (
EnumTypeDefinitionNode,
EnumV... | {
"repo_name": "graphql-python/graphql-core",
"path": "src/graphql/type/definition.py",
"copies": "1",
"size": "59410",
"license": "mit",
"hash": -935397375574207400,
"line_mean": 33.4805571677,
"line_max": 88,
"alpha_frac": 0.6237333782,
"autogenerated": false,
"ratio": 4.17058617058617,
"confi... |
from enum import Enum
from typing import (
List,
Optional,
)
_Signals = Enum("Signals", ["DOT", "DASH"])
_Pauses = Enum("Pauses", ["SIGNAL", "LETTER", "WORD"])
_ON_TIMINGS = {
0.25: _Signals.DOT,
0.75: _Signals.DASH,
}
_OFF_TIMINGS = {
0.25: _Pauses.SIGNAL,
1.25: _Pauses.LETTER,
2.50: _P... | {
"repo_name": "FuegoFro/KeepTalkingBot",
"path": "src/modules/morse_code_solution.py",
"copies": "1",
"size": "5695",
"license": "mit",
"hash": -9062401739373426000,
"line_mean": 33.1017964072,
"line_max": 116,
"alpha_frac": 0.5617208077,
"autogenerated": false,
"ratio": 3.6436340371081255,
"co... |
from enum import Enum
from typing import Optional, Dict, Union
import attr
# noinspection PyPackageRequirements
from Crypto.PublicKey import RSA
# noinspection PyPackageRequirements
from Crypto.PublicKey.RSA import RsaKey
@attr.s
class RequestType:
"""
Emulates structure of a Django HttpRequest for compatibi... | {
"repo_name": "jaywink/federation",
"path": "federation/types.py",
"copies": "2",
"size": "1615",
"license": "bsd-3-clause",
"hash": -6151030876274196000,
"line_mean": 26.3728813559,
"line_max": 71,
"alpha_frac": 0.6941176471,
"autogenerated": false,
"ratio": 3.7041284403669725,
"config_test": ... |
from enum import Enum
from typing import Optional, List
from fblib.messenger.templates import *
from fblib.messenger.common import Button, RequestConstructor
class URLButton(Button):
""" The URL Button opens a webpage in the Messenger webview.
This button can be used with the Button and Generic Templates... | {
"repo_name": "0xKirill/fblib",
"path": "fblib/messenger/buttons.py",
"copies": "1",
"size": "11374",
"license": "isc",
"hash": -7323056773614830000,
"line_mean": 32.650887574,
"line_max": 90,
"alpha_frac": 0.566819061,
"autogenerated": false,
"ratio": 4.7411421425594,
"config_test": false,
"... |
from enum import Enum
from typing import Optional
from PyQt5.QtWidgets import QWidget
from common import CancelException
from hw_common import HWDevice, HWType
from method_call_tracker import MethodCallLimit, method_call_tracker
from ui.ui_hw_initialize_wdg import Ui_WdgInitializeHw
from wallet_tools_common import Ac... | {
"repo_name": "Bertrand256/dash-masternode-tool",
"path": "src/hw_initialize_wdg.py",
"copies": "1",
"size": "7603",
"license": "mit",
"hash": -4979589029959618000,
"line_mean": 40.7802197802,
"line_max": 120,
"alpha_frac": 0.6167302381,
"autogenerated": false,
"ratio": 3.6818401937046006,
"con... |
from enum import Enum
from typing import Optional
import pkg_resources
from gi.repository import Gtk
from gi.repository import Pango
cssprovider = Gtk.CssProvider()
cssprovider.load_from_path(pkg_resources.resource_filename('cct', 'resource/css/indicatorcolors.css'))
class IndicatorState(Enum):
OK = 'ok'
WA... | {
"repo_name": "awacha/cct",
"path": "attic/gui/core/indicator.py",
"copies": "1",
"size": "2698",
"license": "bsd-3-clause",
"hash": -6239254199788961000,
"line_mean": 34.9733333333,
"line_max": 102,
"alpha_frac": 0.623795404,
"autogenerated": false,
"ratio": 3.4195183776932825,
"config_test": ... |
from enum import Enum
from typing import Optional, Tuple, List, AsyncIterable
from booru_toolkit.plugin.tag_cache import TagCache
class Safety(Enum):
Safe = 1
Questionable = 2
Explicit = 3
class Post:
def __init__(
self,
post_id: int,
safety: Safety,
tags: List[str],
... | {
"repo_name": "rr-/dotfiles",
"path": "opt/booru-toolkit/booru_toolkit/plugin/base.py",
"copies": "1",
"size": "3057",
"license": "mit",
"hash": -8187793184242531000,
"line_mean": 29.2673267327,
"line_max": 78,
"alpha_frac": 0.6182531894,
"autogenerated": false,
"ratio": 3.8942675159235667,
"co... |
from enum import Enum
from typing import Optional, Union, Any, Sequence, Mapping
from dataclasses import dataclass, field, MISSING
from collections import OrderedDict
from .utils import ImmutableDict, cached_property
class EnumConstruct:
@classmethod
def construct(cls, loader, node):
assert not load... | {
"repo_name": "vmagamedov/pi",
"path": "pi/types.py",
"copies": "1",
"size": "6705",
"license": "bsd-3-clause",
"hash": -4271820519122361300,
"line_mean": 22.6091549296,
"line_max": 80,
"alpha_frac": 0.6258016406,
"autogenerated": false,
"ratio": 3.8010204081632653,
"config_test": false,
"has... |
from enum import Enum
from typing import Sequence
from sqlalchemy import ARRAY, Text, cast, column, func, select, table, text
from sqlalchemy.engine import Connectable
from .exc import NoSuchObjectError
from .types import ColumnInfo, FunctionInfo, RelationInfo, SchemaRelationInfo
__all__ = (
'get_all_table_acls'... | {
"repo_name": "RazerM/pg_grant",
"path": "pg_grant/query.py",
"copies": "1",
"size": "16548",
"license": "mit",
"hash": -2037272784627930600,
"line_mean": 26.7651006711,
"line_max": 85,
"alpha_frac": 0.6211626783,
"autogenerated": false,
"ratio": 3.3620479479886227,
"config_test": false,
"has... |
from enum import Enum
from typing import Sequence, Union
from annotypes import Anno, Array
from malcolm.core import AMetaDescription, APartName, ChoiceMeta, Part, PartRegistrar
from ..util import AConfig, AGroup, AWidget, AWriteable, set_tags
with Anno("Possible choices for this attribute"):
AChoices = Union[Ar... | {
"repo_name": "dls-controls/pymalcolm",
"path": "malcolm/modules/builtin/parts/choicepart.py",
"copies": "1",
"size": "1443",
"license": "apache-2.0",
"hash": -7212886524426696000,
"line_mean": 30.3695652174,
"line_max": 85,
"alpha_frac": 0.6916146916,
"autogenerated": false,
"ratio": 3.681122448... |
from enum import Enum
from typing import Set, NamedTuple, Optional, Tuple
RelationShape = Enum('RelationShape', ['MANY_TO_MANY', 'MANY_TO_ONE', 'ONE_TO_MANY'])
AttributeDataType = Enum('AttributeDataType', ['BOOLEAN', 'STRING', 'INTEGER', 'DATETIME', 'OBJECT'])
AttributeDataFormat = Enum('AttributeDataFormat', ['URI'... | {
"repo_name": "CenterForOpenScience/SHARE",
"path": "share/schema/shapes.py",
"copies": "2",
"size": "1146",
"license": "apache-2.0",
"hash": 8417613205347932000,
"line_mean": 28.3846153846,
"line_max": 101,
"alpha_frac": 0.7068062827,
"autogenerated": false,
"ratio": 3.673076923076923,
"config... |
from enum import Enum
from typing import Tuple
from abjad.tools.durationtools.Duration import Duration
from abjad.tools.metertools import Meter
from abjad.tools.tonalanalysistools import Scale
from counterpoint.composition_environment import CompositionEnvironment
from counterpoint.composition_parameters import Compo... | {
"repo_name": "nickswalker/counterpoint-reinforcement-learning",
"path": "utilities/factories.py",
"copies": "1",
"size": "4150",
"license": "mit",
"hash": -3040179767950543000,
"line_mean": 44.6043956044,
"line_max": 119,
"alpha_frac": 0.6674698795,
"autogenerated": false,
"ratio": 4.14171656686... |
from enum import Enum
from typing import Tuple
from abjad.tools.pitchtools.NamedInterval import NamedInterval
def is_step(interval):
# A major or minor second
return interval.interval_class == 2 or abs(interval.semitones) < 3
def is_leap(interval):
# Anything larger than a second
return interval.in... | {
"repo_name": "nickswalker/counterpoint-reinforcement-learning",
"path": "counterpoint/musical_analysis.py",
"copies": "1",
"size": "2043",
"license": "mit",
"hash": -7098620028111993000,
"line_mean": 26.9863013699,
"line_max": 109,
"alpha_frac": 0.6926089085,
"autogenerated": false,
"ratio": 3.6... |
from enum import Enum
from typing import Tuple
from utils.lexer import Lexer, Rule
class MapInfoParserError(Exception):
def __init__(self, message: str, position: Tuple[int, int]):
super(Exception, self).__init__('Line {} column {}: {}'.format(position[0], position[1], message))
class MapInfoToken(Enum... | {
"repo_name": "GitExl/DoomIdgamesArchive",
"path": "idgames-extract/src/doom/mapinfoparser.py",
"copies": "1",
"size": "1810",
"license": "bsd-2-clause",
"hash": -6739489090320111000,
"line_mean": 33.1509433962,
"line_max": 148,
"alpha_frac": 0.5033149171,
"autogenerated": false,
"ratio": 3.43453... |
from enum import Enum
from typing import TYPE_CHECKING, Callable, Dict, Optional
from prompt_toolkit.clipboard import ClipboardData
if TYPE_CHECKING:
from .key_bindings.vi import TextObject
from .key_processor import KeyPressEvent
__all__ = [
"InputMode",
"CharacterFind",
"ViState",
]
class Inp... | {
"repo_name": "sserrot/champion_relationships",
"path": "venv/Lib/site-packages/prompt_toolkit/key_binding/vi_state.py",
"copies": "3",
"size": "3364",
"license": "mit",
"hash": -4559325650881652700,
"line_mean": 30.4392523364,
"line_max": 79,
"alpha_frac": 0.6165279429,
"autogenerated": false,
"... |
from enum import Enum
from typing import TYPE_CHECKING
from typing import Iterable
from typing import Optional
from typing import Union
from cleo._utils import strip_tags
from cleo.formatters.formatter import Formatter
if TYPE_CHECKING:
from .section_output import SectionOutput
class Verbosity(Enum):
QUIE... | {
"repo_name": "sdispater/cleo",
"path": "cleo/io/outputs/output.py",
"copies": "1",
"size": "3205",
"license": "mit",
"hash": -7721266897767378000,
"line_mean": 24.8467741935,
"line_max": 75,
"alpha_frac": 0.6134165367,
"autogenerated": false,
"ratio": 4.156939040207523,
"config_test": false,
... |
from enum import Enum
from typing import TypeVar, Generic, List
from Src.Core.Filter.FilterEntitySingleBase import FilterEntitySingleBase
TStatus = TypeVar('TStatus', bound=Enum)
TElementId = TypeVar('TElementId')
class FeSingleGlobalDifferentialSample(FilterEntitySingleBase, Generic[TStatus, TElementId]):
"""de... | {
"repo_name": "cemarchi/biosphere",
"path": "Src/BioAnalyzer/CrossCutting/Filters/GenePrioritization/FeSingleGlobalDifferentialSample.py",
"copies": "1",
"size": "1065",
"license": "bsd-3-clause",
"hash": 5937486525958132000,
"line_mean": 32.3125,
"line_max": 93,
"alpha_frac": 0.6647887324,
"autoge... |
from enum import Enum
from typing import TypeVar, Generic
T = TypeVar('T')
K = TypeVar('K', bound=Enum)
class DifferentialValueDto(Generic[T, K]):
"""description of class"""
def __init__(self, **kargs):
"""
:param kargs:
"""
self.__element_id = kargs.get('element_id', None)
... | {
"repo_name": "cemarchi/biosphere",
"path": "Src/BioAnalyzer/CrossCutting/DTOs/GenePrioritization/DifferentialValueDto.py",
"copies": "1",
"size": "1832",
"license": "bsd-3-clause",
"hash": -5093611121161235000,
"line_mean": 21.9125,
"line_max": 79,
"alpha_frac": 0.5387554585,
"autogenerated": fals... |
from enum import Enum
from typing import TypeVar, Iterable, Optional, Generic, Union, Iterator
from ..AbstractTree import AbstractSearchTree
__author__ = "Jan Golob"
T = TypeVar("T")
class LeafNode:
def __init__(self, b, parent=None, data=[]):
self.b = b
self.parent = parent
self.leaf ... | {
"repo_name": "jO-Osko/PSA2",
"path": "naloge/dn1/tree/Jan_Golob/BplusTree.py",
"copies": "1",
"size": "6660",
"license": "mit",
"hash": 8355537697978196000,
"line_mean": 27.3404255319,
"line_max": 102,
"alpha_frac": 0.4689189189,
"autogenerated": false,
"ratio": 3.883381924198251,
"config_test... |
from enum import Enum
from typing import Union, Dict, Any
from pyASA.baseconfigobject import BaseConfigObject
class LogLevel(Enum):
"""
Class used to represent log levels used for rule objects
"""
DEFAULT = "Default"
DISABLE = "Disabled"
EMERGENCIES = "Emergencies"
ALERTS = "Alerts"
C... | {
"repo_name": "xpac1985/pyASA",
"path": "pyASA/rulelogging.py",
"copies": "1",
"size": "4469",
"license": "mit",
"hash": -3192084893838206500,
"line_mean": 28.0194805195,
"line_max": 106,
"alpha_frac": 0.5806668158,
"autogenerated": false,
"ratio": 4.527862208713272,
"config_test": false,
"ha... |
from enum import Enum
from typing import Union
_VALUES = {}
class EnumSpecDescription(Enum):
def __new__(cls, description, *spec):
obj = object.__new__(cls)
obj._value_ = len(_VALUES) + 1
_VALUES[obj._value_] = obj
obj.__description = description
obj.__spec = spec
... | {
"repo_name": "rsalmei/clearly",
"path": "clearly/client/display_modes.py",
"copies": "1",
"size": "2403",
"license": "mit",
"hash": -6630203989454889000,
"line_mean": 31.9178082192,
"line_max": 76,
"alpha_frac": 0.608406159,
"autogenerated": false,
"ratio": 3.971900826446281,
"config_test": fa... |
from enum import Enum
from typing import Union, Optional
from .. import Telegram
from ..types import Chat, User, Message
class ChatService:
class ParseMode(Enum):
NONE = None
MARKDOWN = 'Markdown'
HTML = 'HTML'
def __init__(self, telegram: Telegram) -> None:
self.telegram = te... | {
"repo_name": "TallonRain/horsefaxbot",
"path": "horsefax/telegram/services/chat.py",
"copies": "1",
"size": "1222",
"license": "mit",
"hash": -3547982240001879000,
"line_mean": 31.1578947368,
"line_max": 102,
"alpha_frac": 0.5965630115,
"autogenerated": false,
"ratio": 4.059800664451827,
"conf... |
from enum import Enum
from unittest.mock import Mock
import graphene
import pytest
from django.core.exceptions import ImproperlyConfigured
from saleor.graphql.core.mutations import BaseMutation
from saleor.graphql.core.types.common import Error
from saleor.graphql.product import types as product_types
class Mutatio... | {
"repo_name": "maferelo/saleor",
"path": "tests/api/test_base_mutation.py",
"copies": "1",
"size": "4821",
"license": "bsd-3-clause",
"hash": 6364968226088685000,
"line_mean": 28.7592592593,
"line_max": 85,
"alpha_frac": 0.6150176312,
"autogenerated": false,
"ratio": 4.156034482758621,
"config_... |
from enum import Enum
from urllib.parse import urlparse
from src.couchdb import CouchDB
class Replication:
_RETRY_LIMIT = 3
class ReplType(Enum):
All = 1
Docs = 2
Designs = 3
def __init__(self, model, source, target, continuous=False, create=False, drop_first=False, repl_type=Re... | {
"repo_name": "RipcordSoftware/avancedb-replication-monitor",
"path": "src/replication.py",
"copies": "2",
"size": "5084",
"license": "mit",
"hash": -8074245813090400000,
"line_mean": 31.8,
"line_max": 120,
"alpha_frac": 0.5981510622,
"autogenerated": false,
"ratio": 3.925868725868726,
"config_... |
from enum import Enum
from utils.datastructure import InfiniteBidirectionalList
from turing.direction import Direction
from copy import copy, deepcopy
class Tape(object):
def __init__(self, nullValue = None):
self._tape = InfiniteBidirectionalList(nullValue)
self._cursor = 0
def set(self, item... | {
"repo_name": "sanelli/tms",
"path": "python/src/turing/tape.py",
"copies": "1",
"size": "2190",
"license": "unlicense",
"hash": -2531767360888518700,
"line_mean": 26.7341772152,
"line_max": 76,
"alpha_frac": 0.5753424658,
"autogenerated": false,
"ratio": 4.033149171270718,
"config_test": false... |
from enum import Enum
from utils.db0 import db0, ConstDB0, Channel0
from binascii import hexlify
from object.device import FieldDevice, DeviceACK, ACKName, Device, DevInfo
from object.fields import ClassType, FieldDevice
# from utils.log import logger, ConstLog
from utils.log import Logger, Action, IDType
class CID:
... | {
"repo_name": "soybean217/lora-python",
"path": "GServer/mac_cmd/mac_cmd_gen.py",
"copies": "1",
"size": "8764",
"license": "mit",
"hash": -8465507224525806000,
"line_mean": 31.7052238806,
"line_max": 123,
"alpha_frac": 0.5821542675,
"autogenerated": false,
"ratio": 3.1199715201139195,
"config_... |
from enum import Enum
from utils import Singleton
class Color(Enum):
white = 1
black = 2
class Piece():
def __init__(self, color):
self.color = color
def flip(self):
self.color = Color.white if self.color == Color.black else Color.black
class Board():
def __init__(self, rows, ... | {
"repo_name": "Mekhantev/Interview",
"path": "oop/reversi.py",
"copies": "1",
"size": "1326",
"license": "mit",
"hash": -3720227558978538000,
"line_mean": 24.5192307692,
"line_max": 78,
"alpha_frac": 0.5957767722,
"autogenerated": false,
"ratio": 3.7039106145251397,
"config_test": false,
"has... |
from enum import Enum
from Utils import Status
class ExtensionErrorCodeEnum(Enum):
success = 1
ExtensionTempTerminalState = 4
error_parameter = 11
error_12 = 12
error_wrong_time = 13
error_same_taskid = 14
error_http_failure = 15
error_upload_status_blob = 16
error = 2
FailedRet... | {
"repo_name": "jasonzio/azure-linux-extensions",
"path": "VMBackup/main/ExtensionErrorCodeHelper.py",
"copies": "1",
"size": "1512",
"license": "apache-2.0",
"hash": 7819782455220309000,
"line_mean": 39.8648648649,
"line_max": 116,
"alpha_frac": 0.7493386243,
"autogenerated": false,
"ratio": 4.32... |
from enum import Enum
from uuid import uuid4, UUID
from typing import Dict, Set, List, Type, ClassVar, Any, Optional, Tuple
import semver
from base64 import urlsafe_b64encode, urlsafe_b64decode
from . import AccessRights, AccessRightsSet, Platform
PlatformVersion = str
PlatformRequirements = Dict[Platform, PlatformVer... | {
"repo_name": "mosen/commandment",
"path": "commandment/mdm/commands.py",
"copies": "1",
"size": "20049",
"license": "mit",
"hash": 8272600346139944000,
"line_mean": 31.6,
"line_max": 120,
"alpha_frac": 0.6048181954,
"autogenerated": false,
"ratio": 3.984300476947536,
"config_test": false,
"h... |
from enum import Enum
from uuid import UUID
from flask_io import fields
from flask_io.validate import ValidationError
from unittest import TestCase
class MyEnum(Enum):
member1 = 1
member2 = 2
member3 = 3
class TestDelimitedList(TestCase):
def test_serialize(self):
field = fields.DelimitedLis... | {
"repo_name": "viniciuschiele/flask-binding",
"path": "tests/test_fields.py",
"copies": "2",
"size": "3150",
"license": "apache-2.0",
"hash": -1413538460518315000,
"line_mean": 31.1428571429,
"line_max": 129,
"alpha_frac": 0.6682539683,
"autogenerated": false,
"ratio": 3.6713286713286712,
"conf... |
from enum import Enum
from variable import Variable
from side import Side, SideException
from logger import logger
class ConditionException(Exception):
pass
class ConditionState(Enum):
IS_ZERO = 0
IS_NOT_ZERO = 1
IS_EQUAL = 2
def __str__(self) -> str:
return {
ConditionS... | {
"repo_name": "oguzey/differential-analysis-MISTY-type-ciphers",
"path": "dp_analyzer/condition.py",
"copies": "1",
"size": "5579",
"license": "mit",
"hash": -3502564626594381300,
"line_mean": 36.9523809524,
"line_max": 113,
"alpha_frac": 0.5836171357,
"autogenerated": false,
"ratio": 3.895949720... |
from enum import Enum
from vkapp.bot.logic.user_states import BootStrapState, RootState
# class UserStates(Enum):
# news_proposing = 1
# chat_with_admin = 2
# statistics_mode = 3
# undefined = 0
class UserStruct:
def __init__(self):
self.message_queue=[]
self.state=BootStrapState()... | {
"repo_name": "ParuninPavel/lenta4_hack",
"path": "vkapp/bot/logic/core/QueueMachine.py",
"copies": "1",
"size": "1172",
"license": "mit",
"hash": -1619045302750663700,
"line_mean": 23.4166666667,
"line_max": 65,
"alpha_frac": 0.5802047782,
"autogenerated": false,
"ratio": 3.6739811912225706,
"... |
from enum import Enum
import arrow
class Region(Enum):
brazil = "BR"
europe_north_east = "EUNE"
europe_west = "EUW"
japan = "JP"
korea = "KR"
latin_america_north = "LAN"
latin_america_south = "LAS"
north_america = "NA"
oceania = "OCE"
turkey = "TR"
russia = "RU"
@prope... | {
"repo_name": "10se1ucgo/cassiopeia",
"path": "cassiopeia/data.py",
"copies": "1",
"size": "20473",
"license": "mit",
"hash": -3736490649891034000,
"line_mean": 38.9083820663,
"line_max": 449,
"alpha_frac": 0.6453377619,
"autogenerated": false,
"ratio": 2.8363812690495984,
"config_test": false,... |
from enum import Enum
import astropy
import math
import astropy
import numpy as np
from sklearn.preprocessing import normalize
import os
from astropy.io import fits
import copy
def binArray(data, axis, binstep, binsize, func=np.nanmean):
data = np.array(data)
dims = np.array(data.shape)
argdims = np.arange(... | {
"repo_name": "luciencd/astrophotograpython",
"path": "library/processing.py",
"copies": "1",
"size": "13682",
"license": "mit",
"hash": -7435505747154504000,
"line_mean": 35.1002638522,
"line_max": 301,
"alpha_frac": 0.6658383277,
"autogenerated": false,
"ratio": 3.551921079958463,
"config_tes... |
from enum import Enum
import asyncio
class EventType(Enum):
Longpoll = 0
ChatChange = 1
Callback = 2
class ProxyParametrs:
__slots__ = ("parent", "wait", "sender")
def __init__(self, parent, sender=None, wait="yes"):
self.sender = sender
self.wait = wait
self.parent = pa... | {
"repo_name": "VKBots/VBot",
"path": "utils/utils.py",
"copies": "2",
"size": "7443",
"license": "mit",
"hash": -3480179070130785000,
"line_mean": 25.3936170213,
"line_max": 122,
"alpha_frac": 0.4960365444,
"autogenerated": false,
"ratio": 3.8346213292117466,
"config_test": false,
"has_no_key... |
from enum import Enum
import basicTypes
class MainOp(Enum):
J = 2
JAL = 3
BEQ = 4
BNE = 5
BLEZ = 6
BGTZ = 7
ADDI = 8
ADDIU = 9
SLTI = 10
SLTIU = 11
ANDI = 12
ORI = 13
XORI = 14
LUI = 15
BEQL = 20
BNEL = 21
BLEZL = 22
BGTZL = ... | {
"repo_name": "PFedak/DAKompiler",
"path": "instruction.py",
"copies": "1",
"size": "9872",
"license": "mit",
"hash": 7951011505320750000,
"line_mean": 33.5174825175,
"line_max": 141,
"alpha_frac": 0.5161061588,
"autogenerated": false,
"ratio": 3.0440949737897007,
"config_test": false,
"has_n... |
from enum import Enum
import collections
import functools
import itertools
import numpy as np
import scipy
@functools.total_ordering
class Extremum(object):
class Concavity(Enum):
MINIMUM = -1
INFLECT = 0
MAXIMUM = 1
def __init__(self, index, concavity, value):
self.index =... | {
"repo_name": "oliverlee/antlia",
"path": "python/antlia/pattern.py",
"copies": "1",
"size": "6058",
"license": "bsd-2-clause",
"hash": 5784555319135648000,
"line_mean": 31.0529100529,
"line_max": 80,
"alpha_frac": 0.5671838891,
"autogenerated": false,
"ratio": 3.807668133249529,
"config_test":... |
from enum import Enum
import collections
import os.path
import re
from gather import graph
__all__ = ("Collector", "Ambiguity")
Ambiguity = collections.namedtuple(
"Ambiguity", (
"direction",
"file",
"choices",
)
)
NameInfo = collections.namedtuple(
"NameInfo", (
"path... | {
"repo_name": "yellcorp/gather",
"path": "gather/analyze.py",
"copies": "1",
"size": "5255",
"license": "mit",
"hash": 4660671072837498000,
"line_mean": 24.2644230769,
"line_max": 71,
"alpha_frac": 0.5472882969,
"autogenerated": false,
"ratio": 3.7455452601568067,
"config_test": false,
"has_n... |
from enum import Enum
import collections
import struct
ClumpingPacket = collections.namedtuple("ClumpingPacket", ["type", "data", "frameno", "dest"])
class ClumpingFrameType(Enum):
"""
frame types for clumping frames
"""
KeepAlive = 1 << 0
IP = 1 << 1
Control = 1 << 2
ACK = 1 << 3
ETHE... | {
"repo_name": "majestrate/i2p-tools",
"path": "pyi2tun/i2tun/protocol.py",
"copies": "1",
"size": "2987",
"license": "mit",
"hash": -4121573252831704000,
"line_mean": 29.4795918367,
"line_max": 94,
"alpha_frac": 0.5560763308,
"autogenerated": false,
"ratio": 4.041948579161028,
"config_test": fa... |
from enum import Enum
import configparser
import tensorflow as tf
from keras.models import model_from_json
class CQT_Dtype(Enum):
"""
型の定義
"""
NONE = 0
INT8 = 1
UINT8 = 2
INT32 = 3
FLOAT32 = 4
FIX8 = 5
FIX16 = 6
FLOAT16 = 7
class CocytusLayerInfo:
"""
コキュートス用の追加レ... | {
"repo_name": "natsutan/cocytus",
"path": "cocytus/compiler/compiler.py",
"copies": "1",
"size": "14945",
"license": "mit",
"hash": -3073023920497784000,
"line_mean": 28.9803921569,
"line_max": 111,
"alpha_frac": 0.5178402732,
"autogenerated": false,
"ratio": 3.0210757409440174,
"config_test": ... |
from enum import Enum
import copy
import random
import numpy as np
from matplotlib import cm
random.seed(1)
class State:
def __init__(self, dealer_card, player_card, is_terminal=False):
"""
:type self.is_terminal: bool
:type self.dealer: int
:type self.player: int
"""
... | {
"repo_name": "analog-rl/Easy21",
"path": "Joe #3 TD Learning in Easy21/easy21c.py",
"copies": "1",
"size": "6815",
"license": "mit",
"hash": -8896710622369219000,
"line_mean": 32.0825242718,
"line_max": 124,
"alpha_frac": 0.5213499633,
"autogenerated": false,
"ratio": 3.662009672219237,
"confi... |
from enum import Enum
import copy
import random
random.seed(1)
class State:
def __init__(self, dealer_card, player_card, is_terminal=False):
"""
:type self.is_terminal: bool
:type self.dealer: int
:type self.player: int
"""
self.dealer = dealer_card.value
s... | {
"repo_name": "analog-rl/Easy21",
"path": "Joe #2 Monte-Carlo Control in Easy21/easy21.py",
"copies": "1",
"size": "2200",
"license": "mit",
"hash": -328824472327121800,
"line_mean": 23.7191011236,
"line_max": 68,
"alpha_frac": 0.4922727273,
"autogenerated": false,
"ratio": 3.741496598639456,
"... |
from enum import Enum
import copy
import time
import math
import ctypes
import numpy as np
from OpenGL.GL import *
from OpenGL.GLU import *
from PyEngine3D.Common import logger
from PyEngine3D.OpenGLContext import DispatchIndirectCommand, DispatchIndirectBuffer
from PyEngine3D.OpenGLContext import DrawElementsIndirec... | {
"repo_name": "ubuntunux/PyEngine3D",
"path": "PyEngine3D/Render/Effect.py",
"copies": "1",
"size": "52845",
"license": "bsd-2-clause",
"hash": -9130625068539739000,
"line_mean": 47.084622384,
"line_max": 158,
"alpha_frac": 0.600283849,
"autogenerated": false,
"ratio": 3.949256408340184,
"confi... |
from enum import Enum
import datetime
import os
from select import select, error
import errno
import time
class EventType(Enum):
NONE = 0
READ = 1
WRITE = 2
TIMEOUT = 4
READWRITE = READ | WRITE
class EventRegistration(object):
def __init__(self, callback, closure=None):
self.callback =... | {
"repo_name": "wannabegeek/PyFIX",
"path": "pyfix/event.py",
"copies": "1",
"size": "5841",
"license": "cc0-1.0",
"hash": -3504379170010367500,
"line_mean": 32.9593023256,
"line_max": 105,
"alpha_frac": 0.5937339497,
"autogenerated": false,
"ratio": 4.503469545104086,
"config_test": false,
"h... |
from enum import Enum
import datetime
from loaders import get_loader
from misc import BinaryIO, ProtocolException
class GamePlatform(Enum):
xbox = 0
playstation = 1
gamecube = 2
class MST:
def __init__(self):
self.platform = None
self.package_size = 0
self.file_count = 0
... | {
"repo_name": "amPerl/MATools",
"path": "tools/mst.py",
"copies": "1",
"size": "2289",
"license": "mit",
"hash": -4149594805453053000,
"line_mean": 31.2394366197,
"line_max": 104,
"alpha_frac": 0.5862822193,
"autogenerated": false,
"ratio": 3.860033726812816,
"config_test": false,
"has_no_key... |
from enum import Enum
import fsm
import logging
## Behavior is an abstract superclass for Skill, Play, etc
class Behavior(fsm.StateMachine):
## These are the core states of the Behavior class
# Subclasses may extend this by adding substates of the following
class State(Enum):
start = 1
ru... | {
"repo_name": "JNeiger/robocup-software",
"path": "soccer/gameplay/behavior.py",
"copies": "1",
"size": "3338",
"license": "apache-2.0",
"hash": -3615203597342615600,
"line_mean": 39.7073170732,
"line_max": 121,
"alpha_frac": 0.6725584182,
"autogenerated": false,
"ratio": 4.456608811748999,
"co... |
from enum import Enum
import glob
import logging
import serial
from serial.serialutil import SerialException
import time
class NotificationTypes(Enum):
"""
Used to identify a TiLDA notification type.
"""
TICKET = 0
BUILD = 1
CALENDAR = 2
EMAIL = 3
GITHUB = 4
IRC = 5
class Bitmap... | {
"repo_name": "DanNixon/Sakuya",
"path": "pc_client/sakuyaclient/sinks/TiLDADriver.py",
"copies": "1",
"size": "5447",
"license": "apache-2.0",
"hash": 2639568116923147300,
"line_mean": 24.8151658768,
"line_max": 104,
"alpha_frac": 0.5608591885,
"autogenerated": false,
"ratio": 3.8907142857142856... |
from enum import Enum
import hashlib
class HashSumType(Enum):
no_hash = 0
md5 = 1
sha1 = 2
ripemd160 = 3
sha224 = 4
sha256 = 5
sha384 = 6
sha512 = 7
whirlpool = 8
def hashsum(hash_sum_type, message):
if (hash_sum_type.name in hashlib.algorithms_available):
h = hashlib.new(hash_sum_type.name)
h.update(st... | {
"repo_name": "opentelega/OpenTelega",
"path": "fileserver/HashCalc.py",
"copies": "1",
"size": "1417",
"license": "mit",
"hash": 6941973506906572000,
"line_mean": 26.2692307692,
"line_max": 64,
"alpha_frac": 0.7198306281,
"autogenerated": false,
"ratio": 2.800395256916996,
"config_test": false... |
from enum import Enum
import igraph
from synthetic.consts import (DEFAULT_BINS, DEFAULT_MAX_DIST,
DEFAULT_NORM_SAMPLES, SMALL_VALUE)
from synthetic.stats import StatType, DistanceType, StatsSet
DEFAULT_UNDIRECTED = ((StatType.DEGREES, DistanceType.EARTH_MOVER),
(Sta... | {
"repo_name": "telmomenezes/synthetic",
"path": "synthetic/distances.py",
"copies": "1",
"size": "3665",
"license": "mit",
"hash": 8880346302706998000,
"line_mean": 38.8369565217,
"line_max": 79,
"alpha_frac": 0.5727148704,
"autogenerated": false,
"ratio": 3.575609756097561,
"config_test": fals... |
from enum import Enum
import ipaddress
from pymongo import MongoClient
import json
from bridge.bridge import Bridge
class HostProtocol(Enum):
GET = 0
POST = 1
PUT = 2
DELETE = 3
OPTION = 4
HEADER = 5
class LesserWork():
__hostAddr = ipaddress.ip_address('127.0.0.1')
__hostPort = 80... | {
"repo_name": "hoonkim/Lesser",
"path": "receiver/bamboo.py",
"copies": "1",
"size": "2120",
"license": "mit",
"hash": 5339733065297595000,
"line_mean": 26.1794871795,
"line_max": 177,
"alpha_frac": 0.5622641509,
"autogenerated": false,
"ratio": 3.933209647495362,
"config_test": false,
"has_n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.