text stringlengths 0 1.05M | meta dict |
|---|---|
from enum import Enum
from collections import namedtuple
WtiUser = namedtuple('WtiUser', ['id', 'email', 'role'])
WtiProject = namedtuple('WtiProject', ['id', 'name', 'master_locale', 'filename', 'content_type'])
WtiString = namedtuple('WtiString', ['id', 'locale', 'text', 'status', 'updated_at', 'plural'])
ZendeskIt... | {
"repo_name": "KeepSafe/translation-real-time-validaton",
"path": "notifier/model.py",
"copies": "1",
"size": "3093",
"license": "apache-2.0",
"hash": 5857624889350494000,
"line_mean": 28.179245283,
"line_max": 116,
"alpha_frac": 0.6210798577,
"autogenerated": false,
"ratio": 3.575722543352601,
... |
from enum import Enum
from collections import OrderedDict
from graphene.storage.base.array import Array
from graphene.storage.base.general_type import GeneralType
from graphene.storage.base.general_type_type import GeneralTypeType
from graphene.storage.base.string import String
from graphene.storage.base.node import N... | {
"repo_name": "PHB-CS123/graphene",
"path": "graphene/storage/defrag/reference_map.py",
"copies": "1",
"size": "6680",
"license": "apache-2.0",
"hash": 4079169274764761600,
"line_mean": 30.214953271,
"line_max": 80,
"alpha_frac": 0.6056886228,
"autogenerated": false,
"ratio": 3.5139400315623357,
... |
from enum import Enum
from color import Color
from observable import Observable
ACCELERATION = 4
FRICTION = 0.25
class Direction(Enum):
LEFT = 0
RIGHT = 1
class Paddle(Observable):
def __init__(self, max_x):
super().__init__()
self.width = max_x // 5
self.max_x = max_x - self.widt... | {
"repo_name": "pmana/breakout",
"path": "paddle.py",
"copies": "1",
"size": "1762",
"license": "mit",
"hash": -8666862857812287000,
"line_mean": 27.4193548387,
"line_max": 71,
"alpha_frac": 0.5737797957,
"autogenerated": false,
"ratio": 3.5668016194331984,
"config_test": false,
"has_no_keywor... |
from enum import Enum
from .container import Container
from .path import Path
from .value import ListValue
class StackType(Enum):
FUNCTION = 0
TUNNEL = 1
class Element:
def __init__(self, stack_type, container, content_idx, in_expr_eval=False):
self.container = container
self.content_idx... | {
"repo_name": "facelesspanda/inkpy",
"path": "inkpy/_runtime/callstack.py",
"copies": "1",
"size": "5996",
"license": "mit",
"hash": 6952229925141138000,
"line_mean": 29.1306532663,
"line_max": 79,
"alpha_frac": 0.5588725817,
"autogenerated": false,
"ratio": 3.756892230576441,
"config_test": fa... |
from enum import Enum
from copper.core.vmath import Vector3
class primType(Enum):
Unknown = 0
Custom = 1
Agent = 2
AlembicRef = 3
BezierCurve = 4
BezierSurface = 5
Circle = 6
Mesh = 7
Metaball = 8
NURBSCurve = 9
NURBSSurface = 10
PackedFragment = 11
PackedGeometry =12
PackedPrim = 13
ParticleSystem = 14... | {
"repo_name": "cinepost/Copperfield_FX",
"path": "copper/core/data/geometry_data/primitive.py",
"copies": "1",
"size": "4008",
"license": "unlicense",
"hash": -6482665450716428000,
"line_mean": 21.6327683616,
"line_max": 80,
"alpha_frac": 0.6877184224,
"autogenerated": false,
"ratio": 2.987322893... |
from enum import Enum
from cow_mq.util import Util
class BlueprintRouteState(Enum):
NONE = 0
ADD = 1
DEL = 2
CLEAR = 3
class Blueprint:
name = None
import_name = None
rule_fun_dic = None
route_change_cb = None
def __init__(self, name, import_name):
self.name = name
... | {
"repo_name": "duncanHsu/CowMQ-Python",
"path": "cow_mq/blueprint.py",
"copies": "1",
"size": "1845",
"license": "apache-2.0",
"hash": 2856443248713222000,
"line_mean": 24.2739726027,
"line_max": 71,
"alpha_frac": 0.5658536585,
"autogenerated": false,
"ratio": 3.7962962962962963,
"config_test":... |
from enum import Enum
from ctypes import *
from abc import ABCMeta
import saltchannel.util as util
from ..exceptions import BadPeer as BadPeer
class PacketType(Enum):
"""Packet type constants."""
TYPE_M1 = 1
TYPE_M2 = 2
TYPE_M3 = 3
TYPE_M4 = 4
TYPE_APP_PACKET = 5
TYPE_ENCRYPTED_PACKET = 6... | {
"repo_name": "assaabloy-ppi/salt-channel-python",
"path": "saltchannel/util/packets.py",
"copies": "1",
"size": "2683",
"license": "mit",
"hash": -2068218319088684300,
"line_mean": 27.8602150538,
"line_max": 92,
"alpha_frac": 0.5929929184,
"autogenerated": false,
"ratio": 3.8328571428571427,
"... |
from enum import Enum
from ctypes import POINTER, c_int, c_double, byref
from eqs_wrapper import libeqs
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot')
def plotTH(t, acc, vel, dsp, title="Time History Curves"):
plt.figure(title,(8,6))
plt.subplot(3,1,1)
plt.plot(t,acc)
plt.... | {
"repo_name": "Panchatantra/EQSignal",
"path": "libeqs/eqspy.py",
"copies": "1",
"size": "7675",
"license": "mit",
"hash": -6644376047107338000,
"line_mean": 28.1863117871,
"line_max": 78,
"alpha_frac": 0.541237785,
"autogenerated": false,
"ratio": 2.7459749552772807,
"config_test": false,
"h... |
from enum import Enum
from dataclasses import dataclass, asdict, fields
import dataclasses
from itertools import chain
import json
from pathlib import Path
import toml
from typing import List, Any, Dict, Type
def _custom_dataclass_init(self, *args, **kwargs):
# print(self.__class__.__name__, "__init__")
names... | {
"repo_name": "exercism/python",
"path": "bin/data.py",
"copies": "1",
"size": "9667",
"license": "mit",
"hash": 8452795034479790000,
"line_mean": 25.7783933518,
"line_max": 113,
"alpha_frac": 0.5799110376,
"autogenerated": false,
"ratio": 3.8376339817387852,
"config_test": true,
"has_no_keyw... |
from enum import Enum
from datetime import datetime
from json_serializable import JsonSerializable
class Category(Enum):
technology = 1
life = 2
class BlogPost(JsonSerializable):
def __init__(self, title="", category=Category.technology, date=None, content=""):
super().__init__()
self.t... | {
"repo_name": "icoxfog417/json_serializable",
"path": "json_serializable/test/demo.py",
"copies": "1",
"size": "1091",
"license": "mit",
"hash": -160242812132630600,
"line_mean": 32.0606060606,
"line_max": 128,
"alpha_frac": 0.6379468378,
"autogenerated": false,
"ratio": 3.6125827814569536,
"co... |
from enum import Enum
from datetime import datetime
from sqlalchemy import create_engine, MetaData, Table, Column, String, join, Integer, ForeignKey, select
from sqlalchemy.orm import mapper, sessionmaker
from sqlalchemy import exc as sql_exceptions
import settings
from shared import IO, debugException, hostToIP
if set... | {
"repo_name": "khorsmann/dsiprouter",
"path": "gui/database/__init__.py",
"copies": "1",
"size": "13079",
"license": "apache-2.0",
"hash": -3416438599799965700,
"line_mean": 29.9928909953,
"line_max": 157,
"alpha_frac": 0.6206131967,
"autogenerated": false,
"ratio": 3.6189817376867737,
"config_... |
from enum import Enum
from datetime import datetime
class DiceOutcome(Enum):
One=1
Two=2
Three=3
Four=4
Five=5
Six=6
class GameType(Enum):
GroupInitiated = 1
PrivateInitiated = 2
class Player:
def __init__(self, player_id, player_name):
self._play_id = player_id
s... | {
"repo_name": "daedaluschan/telegram_liars_dice",
"path": "liars_dice_game.py",
"copies": "1",
"size": "2011",
"license": "cc0-1.0",
"hash": -6274360154339661000,
"line_mean": 19.7319587629,
"line_max": 54,
"alpha_frac": 0.5907508702,
"autogenerated": false,
"ratio": 3.5280701754385966,
"config... |
from enum import Enum
from datetime import datetime
from infosystem.database import db
DATE_FMT = '%Y-%m-%d'
DATETIME_FMT = '%Y-%m-%dT%H:%M:%S.%fZ'
class Entity(object):
attributes = ['id', 'active', 'created_at', 'created_by',
'updated_at', 'updated_by', 'tag']
id = db.Column(db.CHAR(32... | {
"repo_name": "samueldmq/infosystem",
"path": "infosystem/common/subsystem/entity.py",
"copies": "1",
"size": "4252",
"license": "apache-2.0",
"hash": 8726393292057106000,
"line_mean": 33.8524590164,
"line_max": 76,
"alpha_frac": 0.4960018815,
"autogenerated": false,
"ratio": 4.631808278867102,
... |
#from enum import Enum
from datetime import datetime
# http://www.homepages.mcb.net/bones/SBS/Article/Barebones42_Socket_Data.htm
def _parse_datetime(datestr, timestr):
date = datetime.strptime(datestr, '%Y/%m/%d')
timestr, separator, millisstr = timestr.rpartition('.')
time = datetime.strptime(timestr, '%H:%M:%S'... | {
"repo_name": "tpainter/adsb_range",
"path": "py1090/message.py",
"copies": "1",
"size": "10296",
"license": "apache-2.0",
"hash": -3638704871326168000,
"line_mean": 35.7714285714,
"line_max": 142,
"alpha_frac": 0.6317987568,
"autogenerated": false,
"ratio": 3.3309608540925266,
"config_test": f... |
from enum import Enum
from django.core.exceptions import ImproperlyConfigured
from django.http import JsonResponse
class PopupValidAction(Enum):
new_form = 0
close = 1
reload = 2
redirect = 3
class PopupFormMixin(object):
form_valid_action = PopupValidAction.reload
template_name = 'dcbase/f... | {
"repo_name": "tctimmeh/dc-django-base",
"path": "dcbase/views/generic/popupFormView.py",
"copies": "1",
"size": "2084",
"license": "mit",
"hash": 20427245590645256,
"line_mean": 26.4210526316,
"line_max": 56,
"alpha_frac": 0.6151631478,
"autogenerated": false,
"ratio": 3.7482014388489207,
"con... |
from enum import Enum
from django.db import models
from django.db.models import Q
from django.contrib.auth.models import User
class Enumm(Enum):
@classmethod
def choices(cls):
choices = []
for i in cls:
choices.append((i.value, i.name))
return tuple(choices)
class FoosBa... | {
"repo_name": "smartfoosball/fooscloud",
"path": "smartfoosball/models.py",
"copies": "1",
"size": "4842",
"license": "mit",
"hash": -7918043110497501000,
"line_mean": 33.0985915493,
"line_max": 125,
"alpha_frac": 0.6106980587,
"autogenerated": false,
"ratio": 3.5112400290065264,
"config_test":... |
from enum import Enum
from django.shortcuts import redirect
from members.models import Membership
from .forms import *
# During the application process we store data posted from each of the forms
# in session variables
class ApplicationType(Enum):
ADULT_MEMBER = 1
CHILD_MEMBER = 2
NON_MEMBER = 3
def cl... | {
"repo_name": "ianastewart/cwltc-admin",
"path": "public/session.py",
"copies": "1",
"size": "8342",
"license": "mit",
"hash": -2087862033331108000,
"line_mean": 27.3741496599,
"line_max": 110,
"alpha_frac": 0.6000959003,
"autogenerated": false,
"ratio": 3.90177736202058,
"config_test": false,
... |
from enum import Enum
from django.utils import timezone as datetime
from datetime import timedelta
from pastebin.models import Duration, Paste
class PasteDates:
def __init__(self):
super().__init__()
def is_expired(self, paste:Paste):
now = self.now()
expiry = add_to_date(paste.creatio... | {
"repo_name": "johannessarpola/django-pastebin",
"path": "pastebin/core/paste_dates.py",
"copies": "1",
"size": "1733",
"license": "mit",
"hash": -1347266562906941000,
"line_mean": 24.5,
"line_max": 83,
"alpha_frac": 0.6295441431,
"autogenerated": false,
"ratio": 3.6794055201698512,
"config_tes... |
# from enum import Enum
from enum import Enum
from typing import Dict, NewType, cast, Union, List, Any, Set, TYPE_CHECKING
if TYPE_CHECKING:
from src.model.Sort import Sort
# from Sort import Sort
# Data = Union[int, float, TimeInt] # later maybe Tuple[Data] and str
Data = Any # later maybe Tuple[Data] and st... | {
"repo_name": "legalese-io/legalese-compiler",
"path": "L4/pyL4/src/constants_and_defined_types.py",
"copies": "2",
"size": "6825",
"license": "apache-2.0",
"hash": 9013784633378935000,
"line_mean": 34.1968911917,
"line_max": 119,
"alpha_frac": 0.6102767962,
"autogenerated": false,
"ratio": 3.249... |
from enum import Enum
from enum import unique
# encoding=utf-8
__author__ = 'Hinsteny'
def test_enum():
Month = Enum('Month', ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'))
print(Month.Jan, " = ",Month.Jan.value)
for name, member in Month.__members__.items():
... | {
"repo_name": "InverseLina/python-practice",
"path": "Base/TestEnum.py",
"copies": "1",
"size": "1073",
"license": "apache-2.0",
"hash": 3795667926701543000,
"line_mean": 19.8431372549,
"line_max": 111,
"alpha_frac": 0.5606773283,
"autogenerated": false,
"ratio": 2.872972972972973,
"config_test... |
from enum import Enum
from .errors import JujuError
from urllib.parse import urlparse
class Schema(Enum):
LOCAL = "local"
CHARM_STORE = "cs"
CHARM_HUB = "ch"
def matches(self, potential):
return self.value == potential
def __str__(self):
return self.value
class URL:
def __i... | {
"repo_name": "juju/python-libjuju",
"path": "juju/url.py",
"copies": "1",
"size": "3839",
"license": "apache-2.0",
"hash": -2062718062915882500,
"line_mean": 27.2279411765,
"line_max": 86,
"alpha_frac": 0.555613441,
"autogenerated": false,
"ratio": 3.652711703139867,
"config_test": false,
"h... |
from enum import Enum
from .errors import JujuError
class Source(Enum):
"""Source defines a origin source. Providing a hint to the controller about
what the charm identity is from the URL and origin source.
"""
LOCAL = "local"
CHARM_STORE = "charm-store"
CHARM_HUB = "charm-hub"
def __str... | {
"repo_name": "juju/python-libjuju",
"path": "juju/origin.py",
"copies": "1",
"size": "5514",
"license": "apache-2.0",
"hash": 6935629695455299000,
"line_mean": 27.8691099476,
"line_max": 124,
"alpha_frac": 0.5627493653,
"autogenerated": false,
"ratio": 4.069372693726938,
"config_test": false,
... |
from enum import Enum
from flask import request, current_app
from flask import jsonify
from functools import wraps
import sys
from bson.json_util import dumps
class RPCHandler:
"""
Handles RPC methods
"""
def _call_method(self, method, *args, **kwargs):
"""
Class the method on the cl... | {
"repo_name": "drFabio/flask_json_rpc2",
"path": "json_rpc.py",
"copies": "1",
"size": "5466",
"license": "mit",
"hash": -3364025447766809600,
"line_mean": 27.3264248705,
"line_max": 90,
"alpha_frac": 0.5870837907,
"autogenerated": false,
"ratio": 3.9723837209302326,
"config_test": false,
"ha... |
from enum import Enum
from functools import lru_cache
from rekt.utils import snake_case_to_camel_case, read_only_dict
_EXCEPTION_CLASS_NAME_FMT = '{}Error'
exceptions_by_status = {}
class Status(Enum):
ok = 'OK'
unknown_error = 'UNKNOWN_ERROR'
zero_results = 'ZERO_RESULTS'
over_query_limit = 'OVERY_Q... | {
"repo_name": "vengefuldrx/rekt-googlecore",
"path": "rekt_googlecore/errors.py",
"copies": "1",
"size": "1825",
"license": "apache-2.0",
"hash": -5832327065962724000,
"line_mean": 30.4655172414,
"line_max": 133,
"alpha_frac": 0.6575342466,
"autogenerated": false,
"ratio": 3.5714285714285716,
"... |
from enum import Enum
from functools import partial
from typing import Any, Callable # noqa: F401
import six
from django import forms
from django.db import models
from django.utils.encoding import force_text
from django.utils.translation import ugettext
from django_enumfield.exceptions import InvalidStatusOperationE... | {
"repo_name": "5monkeys/django-enumfield",
"path": "django_enumfield/db/fields.py",
"copies": "1",
"size": "6237",
"license": "mit",
"hash": -2514877292847742500,
"line_mean": 34.8448275862,
"line_max": 89,
"alpha_frac": 0.5844155844,
"autogenerated": false,
"ratio": 4.414012738853503,
"config_... |
from enum import Enum
from functools import partial
import pandas as pd
import pyqtgraph as pg
from PyQt5 import QtGui, QtWidgets
from graphysio import ui
from graphysio.algorithms.filters import savgol
from graphysio.algorithms.waveform import findPOIGreedy
from graphysio.plotwidgets import PlotWidget
from graphysio... | {
"repo_name": "jaj42/GraPhysio",
"path": "graphysio/plotwidgets/poiselector.py",
"copies": "1",
"size": "5191",
"license": "isc",
"hash": -6206682229030730000,
"line_mean": 34.8,
"line_max": 88,
"alpha_frac": 0.6362935851,
"autogenerated": false,
"ratio": 3.6920341394025606,
"config_test": fals... |
from enum import Enum
from functools import partial
import pandas as pd
import pyqtgraph as pg
from PyQt5 import QtWidgets, QtGui
from graphysio import ui
from graphysio.writedata import exporter
from graphysio.structures import PlotData
from graphysio.plotwidgets import PlotWidget
from graphysio.algorithms.filters... | {
"repo_name": "jaj42/dyngraph",
"path": "graphysio/plotwidgets/poiselector.py",
"copies": "1",
"size": "5149",
"license": "isc",
"hash": 2960939543277306400,
"line_mean": 35.006993007,
"line_max": 105,
"alpha_frac": 0.6414837833,
"autogenerated": false,
"ratio": 3.6673789173789175,
"config_test... |
from enum import Enum
from functools import reduce
from ..util.method_decorator import method_decorator
from ..util import load_many_instance_dicts, EntityDictWrapper
from ..util import model_primary_key_columns_and_names, entity_dict_has_primary_key
from ..query import MongoQuery
from ..util.history_proxy import Mod... | {
"repo_name": "kolypto/py-mongosql",
"path": "mongosql/crud/crudview.py",
"copies": "1",
"size": "26215",
"license": "bsd-2-clause",
"hash": 5188943791804696000,
"line_mean": 41.2822580645,
"line_max": 135,
"alpha_frac": 0.6273888995,
"autogenerated": false,
"ratio": 4.456817409044542,
"config_... |
from enum import Enum
from functools import total_ordering
from operator import attrgetter
from utils.enum import OrderedEnum
from . import templates
class DisplayPriority(OrderedEnum):
NotSet = -1
NoData = 0 # no data fill area pattern
Group1 = 1 # S57 group 1 filled areas
Area1 = 2 # superimpose... | {
"repo_name": "LarsSchy/SMAC-M",
"path": "chart-installation/generate_map_files/mapgen/layer.py",
"copies": "1",
"size": "5563",
"license": "mit",
"hash": 3621425256239590000,
"line_mean": 29.7348066298,
"line_max": 75,
"alpha_frac": 0.5538378573,
"autogenerated": false,
"ratio": 4.22078907435508... |
from enum import Enum
from functools import total_ordering
import logging
from eva_cttv_pipeline.trait_mapping.ols import get_ontology_label_from_ols, is_current_and_in_efo, is_in_efo
from eva_cttv_pipeline.trait_mapping.utils import json_request
logger = logging.getLogger(__package__)
@total_ordering
class ZoomaC... | {
"repo_name": "EBIvariation/eva-cttv-pipeline",
"path": "eva_cttv_pipeline/trait_mapping/zooma.py",
"copies": "1",
"size": "6312",
"license": "apache-2.0",
"hash": 8741406366356510000,
"line_mean": 37.7239263804,
"line_max": 110,
"alpha_frac": 0.6357731305,
"autogenerated": false,
"ratio": 3.5480... |
from enum import Enum
from functools import wraps
import importlib
import os
from .log import logger
plugins = {}
cmds = {}
lstnrs = {}
class OutputType(Enum):
Message = 'message'
Action = 'action'
class Output:
def __init__(self, msg_type, msg):
self.msg_type = msg_type
self.msg = self... | {
"repo_name": "archangelic/pinhook",
"path": "pinhook/plugin.py",
"copies": "1",
"size": "4945",
"license": "mit",
"hash": 7374376055996118000,
"line_mean": 27.2571428571,
"line_max": 181,
"alpha_frac": 0.6173913043,
"autogenerated": false,
"ratio": 3.6902985074626864,
"config_test": false,
"... |
from enum import Enum
from functools import wraps
from shared import GlobalVariables
from shared import GlobalConstants
from shared import State
from CLI import PrintCore
from CLI import Printer
SOURCE = "DEBUG"
def can_call(func):
@wraps(func)
def respond_depending_on_state(*args):
klass = args[0]
... | {
"repo_name": "DerekYu177/ExpenseManager",
"path": "modules/debug.py",
"copies": "1",
"size": "4659",
"license": "mit",
"hash": -6352336249957420000,
"line_mean": 27.5828220859,
"line_max": 112,
"alpha_frac": 0.6181584031,
"autogenerated": false,
"ratio": 3.6313328137178487,
"config_test": fals... |
from enum import Enum
from functools import wraps, singledispatch
from warnings import warn
from packaging import version
import h5py
from .._core.sparse_dataset import SparseDataset
# For allowing h5py v3
# https://github.com/theislab/anndata/issues/442
H5PY_V3 = version.parse(h5py.__version__).major >= 3
# ------... | {
"repo_name": "theislab/anndata",
"path": "anndata/_io/utils.py",
"copies": "1",
"size": "7305",
"license": "bsd-3-clause",
"hash": 2229223280120867000,
"line_mean": 27.1969111969,
"line_max": 102,
"alpha_frac": 0.5416951938,
"autogenerated": false,
"ratio": 4.039269911504425,
"config_test": fa... |
from enum import Enum
from geopy import point
time_column = 'time_slice'
lon_column = 'lon'
lat_column = 'lat'
weight_column = 'sl_weight'
category_column_prefix = 'sl_category_'
default_category = 'main'
default_option = 'all'
class DateFormat(Enum):
datestring = 0
timestamp = 1
timestamp_ms = 2
class... | {
"repo_name": "Habidatum/slayer",
"path": "slayer/constants.py",
"copies": "1",
"size": "1455",
"license": "mit",
"hash": 407142721326161860,
"line_mean": 26.9807692308,
"line_max": 77,
"alpha_frac": 0.5621993127,
"autogenerated": false,
"ratio": 3.88,
"config_test": false,
"has_no_keywords":... |
from enum import Enum
from gi.repository import Pango
class FontFamily(Enum):
''' Font families '''
NORMAL = 'normal'
SANS = 'sans'
SERIF = 'serif'
MONOSPACE = 'monospace'
class FontWeight(Enum):
''' Font weights '''
ULTRA_LIGHT = 'ultralight'
LIGHT = 'light'
NORMAL = 'normal'
... | {
"repo_name": "Felipe-Aquino/podcast-gtk",
"path": "font.py",
"copies": "1",
"size": "2473",
"license": "mit",
"hash": 7790261952390790000,
"line_mean": 22.1121495327,
"line_max": 86,
"alpha_frac": 0.5733926405,
"autogenerated": false,
"ratio": 3.642120765832106,
"config_test": false,
"has_no... |
from enum import Enum
from inspect import signature, Parameter
import threading
from weakref import WeakValueDictionary
class RegistrationUsage(Enum):
temporal = "New instance for every resolve",
singleton = "Only one instance ever, lazy constructed",
weak_reference = "Similar to singleton but object inst... | {
"repo_name": "careerfamily/simpleioc",
"path": "src/main/python/simpleioc.py",
"copies": "1",
"size": "5272",
"license": "apache-2.0",
"hash": 3151245235590672400,
"line_mean": 36.928057554,
"line_max": 79,
"alpha_frac": 0.6392261002,
"autogenerated": false,
"ratio": 4.552677029360967,
"config... |
from enum import Enum
from io import BytesIO
from decimal import Decimal
from calendar import timegm
from datetime import datetime
from struct import pack, unpack, error
from typing import Iterable, Tuple, Union
__all__ = ['FrameType', 'load', 'parse_protocol_header', 'parse_frames',
'dump', 'dump_protocol_... | {
"repo_name": "malinoff/amqproto",
"path": "amqproto/serialization.py",
"copies": "1",
"size": "11444",
"license": "apache-2.0",
"hash": -7288928662244827000,
"line_mean": 30.6132596685,
"line_max": 79,
"alpha_frac": 0.5252534079,
"autogenerated": false,
"ratio": 3.708360337005833,
"config_test... |
from enum import Enum
from io import BytesIO
from itertools import zip_longest
from types import SimpleNamespace
import pygments.style
from PIL.ImageColor import getrgb
from pygments import highlight
from pygments.formatters import find_formatter_class
from pygments.formatters.img import FontNotFound
from pygments.lex... | {
"repo_name": "mesenev/top_bot_lyceum",
"path": "methods/style.py",
"copies": "1",
"size": "6479",
"license": "mit",
"hash": 8859008641154006000,
"line_mean": 33.5056179775,
"line_max": 79,
"alpha_frac": 0.6159231521,
"autogenerated": false,
"ratio": 3.4103275957801222,
"config_test": false,
... |
from enum import Enum;
from io import IOBase;
from io import SEEK_CUR;
from io import SEEK_SET;
from struct import unpack;
import sys;
try:
from OgreStringUtils import OgreStringUtils
except ImportError as e:
directory = os.path.dirname(os.path.realpath(__file__));
print("Import error: " + str(e) + " manua... | {
"repo_name": "lamogui/ogre_blender_importer",
"path": "OgreSerializer.py",
"copies": "1",
"size": "9431",
"license": "mit",
"hash": -5242439833925505000,
"line_mean": 37.6516393443,
"line_max": 121,
"alpha_frac": 0.5811684869,
"autogenerated": false,
"ratio": 3.9149024491490243,
"config_test":... |
from enum import Enum
from io import open
import re
import sys
import os
def printMaterialSerializerUsage():
print("usage: blender --python OgreMaterialSerializer.py -- file.material");
try:
import bpy;
except ImportError:
print("You need to execute this script using blender");
printMaterialSerialize... | {
"repo_name": "lamogui/ogre_blender_importer",
"path": "OgreMaterialSerializer.py",
"copies": "1",
"size": "19311",
"license": "mit",
"hash": 2564734336271686000,
"line_mean": 40.7084233261,
"line_max": 143,
"alpha_frac": 0.63595878,
"autogenerated": false,
"ratio": 3.9915254237288136,
"config_... |
from enum import Enum
from io import StringIO
from itertools import chain
from .. import iterutils
from .. import path
from .. import safe_str
from ..shell import posix as pshell
Syntax = Enum('Syntax', ['variable', 'shell'])
class Writer:
def __init__(self, stream):
self.stream = stream
def write_... | {
"repo_name": "jimporter/bfg9000",
"path": "bfg9000/shell/syntax.py",
"copies": "1",
"size": "2345",
"license": "bsd-3-clause",
"hash": -5381880440436405000,
"line_mean": 27.2530120482,
"line_max": 76,
"alpha_frac": 0.5897654584,
"autogenerated": false,
"ratio": 3.8632619439868203,
"config_test... |
from enum import Enum
from itertools import chain
from src.independent.util import indent, todo_once, castid
from src.independent.util_for_str import mapjoin
from src.constants_and_defined_types import *
from src.independent.typing_imports import *
from src.model.Term import Term
T = TypeVar('T')
rule_param_to_ind_c... | {
"repo_name": "legalese-io/legalese-compiler",
"path": "L4/pyL4/src/model/EventRule.py",
"copies": "2",
"size": "6992",
"license": "apache-2.0",
"hash": 226650968129152000,
"line_mean": 36.1968085106,
"line_max": 119,
"alpha_frac": 0.6046910755,
"autogenerated": false,
"ratio": 3.320037986704653,... |
from enum import Enum
from itertools import takewhile
from grid import Grid, Point
import grid_utils
class DiscState(Enum):
empty = 0
red = 1
black = 2
class Game(object):
def __init__(self, initial_grid=None):
self.restart(initial_grid)
def restart(self, initial_grid=None):
if initial_grid is N... | {
"repo_name": "misterwilliam/connect-four",
"path": "game.py",
"copies": "1",
"size": "3034",
"license": "mit",
"hash": -7085630105497525000,
"line_mean": 28.7450980392,
"line_max": 85,
"alpha_frac": 0.6166776533,
"autogenerated": false,
"ratio": 3.3194748358862145,
"config_test": false,
"has... |
from enum import Enum
from ..java import opcodes as JavaOpcodes
class ArgType(Enum):
POSITIONAL_OR_KEYWORD = 1
VAR_POSITIONAL = 2
KEYWORD_ONLY = 3
VAR_KEYWORD = 4
class OpcodePosition(Enum):
START = 'start_op'
END = 'end_op'
NEXT = 'next_op'
YIELD = 'yield_op'
#####################... | {
"repo_name": "cflee/voc",
"path": "voc/python/structures.py",
"copies": "7",
"size": "20861",
"license": "bsd-3-clause",
"hash": -5339325989072444000,
"line_mean": 33.7683333333,
"line_max": 98,
"alpha_frac": 0.5912468242,
"autogenerated": false,
"ratio": 4.11703177422538,
"config_test": false... |
from enum import Enum
from lipyc.Cache import ARCCache
import hashlib
import os
THUMBNAIL_HEIGHT = 128
THUMBNAIL_WIDTH = 128
DISPLAY_HEIGHT = 720
DISPLAY_WIDTH = 720
BORDER_THUMB = 4
class Action(Enum):
pagination = 0
pagination_albums = 1
pagination_files = 2
display_file = 3
pagination_simila... | {
"repo_name": "severus21/LiPyc",
"path": "src/config.py",
"copies": "1",
"size": "1375",
"license": "apache-2.0",
"hash": 5503059339427354000,
"line_mean": 25.4423076923,
"line_max": 82,
"alpha_frac": 0.6610909091,
"autogenerated": false,
"ratio": 3.062360801781737,
"config_test": false,
"has... |
from enum import Enum
from livefyre.src.exceptions import LivefyreException
from livefyre.src.utils import pyver
try:
import simplejson as json
except ImportError:
import json
class Subscription(object):
def __init__(self, to, by, sub_type, created_at=None):
self.to = to
self.by = by
... | {
"repo_name": "Livefyre/livefyre-python-utils",
"path": "livefyre/src/dto/subscription.py",
"copies": "1",
"size": "1507",
"license": "mit",
"hash": -7733572253459788000,
"line_mean": 26.4181818182,
"line_max": 92,
"alpha_frac": 0.5520902455,
"autogenerated": false,
"ratio": 4.1287671232876715,
... |
from enum import Enum
from logging import Logger
from string import ascii_letters, digits
from random import choice
from hashlib import md5
from Game import Game
from Util import post
def _random_string(length=16, pool=ascii_letters + digits):
return ''.join(choice(pool) for _ in range(length))
class ScreenId(E... | {
"repo_name": "Mechazawa/WordOn-HD-Bot",
"path": "wordonhd/Session.py",
"copies": "1",
"size": "3603",
"license": "bsd-2-clause",
"hash": 2081106586284038000,
"line_mean": 27.832,
"line_max": 83,
"alpha_frac": 0.5517624202,
"autogenerated": false,
"ratio": 3.733678756476684,
"config_test": fals... |
from enum import Enum
from lxml import etree
def getter_setter_gen(name, type_):
def getter(self):
return getattr(self, "__" + name)
def setter(self, value):
if value is not None and not isinstance(value, type_):
raise TypeError("%s attribute must be set to an instance of %s" % (n... | {
"repo_name": "thusser/rtml-parse",
"path": "rtmlparse/elements/misc.py",
"copies": "1",
"size": "3077",
"license": "mit",
"hash": -1987084267471183000,
"line_mean": 27.2293577982,
"line_max": 106,
"alpha_frac": 0.6685082873,
"autogenerated": false,
"ratio": 3.9048223350253806,
"config_test": f... |
from enum import Enum
from mapperpy.one_way_mapper import OneWayMapper
__author__ = 'lgrech'
class MappingDirection(Enum):
left_to_right = 1
right_to_left = 2
class ObjectMapper(object):
def __init__(self, from_left_mapper, from_right_mapper):
"""
:param from_left_mapper:
:type... | {
"repo_name": "lgrech/MapperPy",
"path": "mapperpy/object_mapper.py",
"copies": "1",
"size": "6895",
"license": "bsd-3-clause",
"hash": -3637145272958098000,
"line_mean": 38.6264367816,
"line_max": 116,
"alpha_frac": 0.635097897,
"autogenerated": false,
"ratio": 3.9649223691776885,
"config_test... |
from enum import Enum
from marshmallow.fields import Field
class EnumField(Field):
default_error_messages = {
'by_name': 'Invalid enum member {name}',
'by_value': 'Invalid enum value {value}'
}
def __init__(self, enum, by_value=False, *args, **kwargs):
self.enum = enum
sel... | {
"repo_name": "SambaDemon/python_vantiv",
"path": "vantiv/request/enums.py",
"copies": "1",
"size": "6718",
"license": "mit",
"hash": -1393921483292358100,
"line_mean": 15.3058252427,
"line_max": 64,
"alpha_frac": 0.418130396,
"autogenerated": false,
"ratio": 2.422646952758745,
"config_test": f... |
from enum import Enum
#from math import abs
class Move (Enum) :
No = 0
Up = 1
Right = 2
Down = 4
Left = 8
Forward = 16
Back = 32
class ObjectTracker :
lastX = None
lastY = None
lastR = None
epsilon = 80
r_epsilon = 250
moveTo = Move.No
def __init__(self, x, y,... | {
"repo_name": "linduine/RobotVYE",
"path": "Test/PyQtTest/ObjectTracker.py",
"copies": "1",
"size": "1576",
"license": "mit",
"hash": 4614474296837841000,
"line_mean": 22.5223880597,
"line_max": 79,
"alpha_frac": 0.5120558376,
"autogenerated": false,
"ratio": 3.2765072765072767,
"config_test": ... |
from enum import Enum
#from math import abs
class Move (Enum) :
No = 0
Up = 1
Right = 2
Down = 4
Left = 8
Forward = 16
Back = 32
class SimpleObjectTracker :
def __init__(self, x, y, r) :
self.lastX = None
self.lastY = None
self.lastR = None
self.epsilon... | {
"repo_name": "tavplubix/RobotVYE",
"path": "ComputerVision/ObjectTracking/SimpleObjectTracker.py",
"copies": "1",
"size": "1782",
"license": "mit",
"hash": 7589506798170362000,
"line_mean": 24.4571428571,
"line_max": 79,
"alpha_frac": 0.4910213244,
"autogenerated": false,
"ratio": 3.644171779141... |
from enum import Enum
from math import cos, sin, pi, floor
from Data import get_uids
from Data.Areas import CompositeArea, EdgeLoopArea, AreaType, Edge
from Data.Edges import EdgeType
from Data.Events import ChangeEvent
from Data.Objects import IdObject, NamedObservableObject, MetaDataObject
from Data.Parameters impor... | {
"repo_name": "pracedru/PracedruDesign",
"path": "Data/Proformer.py",
"copies": "1",
"size": "18177",
"license": "bsd-3-clause",
"hash": 7903850835286893000,
"line_mean": 33.8905950096,
"line_max": 167,
"alpha_frac": 0.6795950927,
"autogenerated": false,
"ratio": 2.858018867924528,
"config_test... |
from enum import Enum
from math import floor, ceil
import click
class TableStyle(Enum):
Compact = 'compact'
Borderless = 'borderless'
Unicode = 'unicode'
Default = 'default'
class TableSeparator(object):
def __len__(self):
return 0
class TableBorder(object):
crossing_char = "+"
... | {
"repo_name": "vedosis/tablebuilder-python",
"path": "tablebuilder/__init__.py",
"copies": "1",
"size": "11913",
"license": "apache-2.0",
"hash": -4401940030686437400,
"line_mean": 37.5533980583,
"line_max": 148,
"alpha_frac": 0.6092503987,
"autogenerated": false,
"ratio": 3.988282557750251,
"c... |
from enum import Enum
from math import pi
from Data.Events import *
from Data.Objects import *
from Data.Vertex import Vertex
class FeatureType(Enum):
ExtrudeFeature = 0
RevolveFeature = 1
FilletFeature = 2
PlaneFeature = 3
SketchFeature = 4
NurbsSurfaceFeature = 5
class Feature(NamedObservableObject, IdObje... | {
"repo_name": "pracedru/PracedruDesign",
"path": "Data/Feature.py",
"copies": "1",
"size": "8059",
"license": "bsd-3-clause",
"hash": 3986537555110734000,
"line_mean": 31.3694779116,
"line_max": 110,
"alpha_frac": 0.6982255863,
"autogenerated": false,
"ratio": 2.912540657752078,
"config_test": ... |
from enum import Enum
from math import sqrt
class State(Enum):
running = "running"
won = "won"
lost = "lost"
paused = "paused"
quit = "quit"
class Game:
def __init__(self, field):
self.field = field
self.init_game_variables()
def init_game_variables(self):
self._... | {
"repo_name": "hristy93/FallingRocks",
"path": "gameplay/game.py",
"copies": "1",
"size": "4146",
"license": "mit",
"hash": 701203993459196400,
"line_mean": 24.9125,
"line_max": 78,
"alpha_frac": 0.5684997588,
"autogenerated": false,
"ratio": 3.8893058161350846,
"config_test": false,
"has_no_... |
from enum import Enum
from math import sqrt, pi, cos, fabs, exp, log
from constants import SOLAR_MASS_IN_GRAMS, SUN_MASS_IN_EARTH_MASSES
from math import inf as INCREDIBLY_LARGE_NUMBER
# Universal constants
from constants import GRAV_CONSTANT
from constants import MOLAR_GAS_CONST
# Import conversion factors
from con... | {
"repo_name": "Zomega/garnets",
"path": "enviroment.py",
"copies": "1",
"size": "30417",
"license": "mit",
"hash": 8399283987640807000,
"line_mean": 35.2107142857,
"line_max": 276,
"alpha_frac": 0.6048591248,
"autogenerated": false,
"ratio": 3.1710800667222685,
"config_test": false,
"has_no_k... |
from enum import Enum
from menu import Menu
class MenuStatus(Enum):
Okay = 1
Exit = 2
# master game state and flow manager
# updates and draws the topmost menu from a stack of menus
class MenuManager:
def __init__(self, start_menu):
self.menus=[]
self.menus.append(start_menu)
# update loop for menus
# also... | {
"repo_name": "RCIX/RogueP",
"path": "logic/menu_manager.py",
"copies": "1",
"size": "1580",
"license": "mit",
"hash": 3462969893923903000,
"line_mean": 33.3695652174,
"line_max": 154,
"alpha_frac": 0.7075949367,
"autogenerated": false,
"ratio": 3.5585585585585586,
"config_test": false,
"has_... |
from enum import Enum
from MTG import mana
from MTG import play
from MTG import gameobject
# TODO: integrate with Spell.py?
# TODO: unify __init__ from diff kinds of ability & class hierarchies
class Ability(gameobject.GameObject):
def __init__(self, card, effect, target_criterias=None,
prompts=N... | {
"repo_name": "wanqizhu/mtg-python-engine",
"path": "MTG/abilities.py",
"copies": "1",
"size": "2442",
"license": "mit",
"hash": -1117835538002633000,
"line_mean": 29.9113924051,
"line_max": 103,
"alpha_frac": 0.6048321048,
"autogenerated": false,
"ratio": 4.023064250411862,
"config_test": fals... |
from enum import Enum
from multiprocessing import Process, Manager
import RPi.GPIO as GPIO
import breathe_equations
class BreatheState(Enum):
calm = 1
erratic = 2
def pulse_light(light, pulse_generator):
for value in pulse_generator:
light.ChangeDutyCycle(value)
def breathe_calm(light):
pu... | {
"repo_name": "tipsqueal/duwamish-lighthouse",
"path": "breathe.py",
"copies": "2",
"size": "1901",
"license": "mit",
"hash": 911531091238278300,
"line_mean": 24.6891891892,
"line_max": 86,
"alpha_frac": 0.6075749605,
"autogenerated": false,
"ratio": 3.5138632162661736,
"config_test": false,
... |
from enum import Enum
from net_deserializer import util
from net_deserializer.node import Node, LeafNode
from net_deserializer.primitives import read_primitive, PrimitiveType
class CorruptDataError(RuntimeError):
pass
class RecordType(Enum):
# pylint: disable=bad-whitespace
SerializedStreamHeader ... | {
"repo_name": "rr-/net_deserializer",
"path": "net_deserializer/records.py",
"copies": "1",
"size": "14081",
"license": "mit",
"hash": 9216859758916004000,
"line_mean": 36.5493333333,
"line_max": 90,
"alpha_frac": 0.6447695476,
"autogenerated": false,
"ratio": 3.6803450078410873,
"config_test":... |
from enum import Enum
from net_deserializer import util
class PrimitiveType(Enum):
# pylint: disable=bad-whitespace
Invalid = 0
Boolean = 1
Byte = 2
Char = 3
Decimal = 5
Double = 6
Int16 = 7
Int32 = 8
Int64 = 9
SByte = 10
Single = 11
TimeSp... | {
"repo_name": "rr-/net_deserializer",
"path": "net_deserializer/primitives.py",
"copies": "1",
"size": "1858",
"license": "mit",
"hash": 8784778165787680000,
"line_mean": 29.9666666667,
"line_max": 81,
"alpha_frac": 0.5979547901,
"autogenerated": false,
"ratio": 3.1018363939899833,
"config_test... |
from enum import Enum
from numbers import Real
from xml.etree import ElementTree as ET
import numpy as np
import h5py
import openmc.checkvalue as cv
from openmc.stats.multivariate import UnitSphere, Spatial
from openmc.stats.univariate import Univariate
from ._xml import get_text
class Source:
"""Distribution o... | {
"repo_name": "paulromano/openmc",
"path": "openmc/source.py",
"copies": "2",
"size": "8965",
"license": "mit",
"hash": 4064447669327436300,
"line_mean": 27.1918238994,
"line_max": 82,
"alpha_frac": 0.6003346347,
"autogenerated": false,
"ratio": 4.316321617717862,
"config_test": false,
"has_n... |
from enum import Enum
from numpy.linalg import norm as np_norm
class EndBehaviour(Enum):
LIMIT_POINT = 0
LIMIT_CYCLE = 1
INFINITY = 2
STRANGE_ATTRACTOR = 3
DEFAULD_CONFIDENCE_COUNT = 20
DEFAULT_CLOSE_DISTANCE = 0.001
def determine_end_behaviour(time_series,
norm=np_norm... | {
"repo_name": "harry-tallbelt/limit-cycle-search",
"path": "tsanalysis.py",
"copies": "1",
"size": "5210",
"license": "mit",
"hash": -6017580840070900000,
"line_mean": 36.2142857143,
"line_max": 74,
"alpha_frac": 0.5898272553,
"autogenerated": false,
"ratio": 4.060795011691348,
"config_test": f... |
from enum import Enum
from .object import Object
class CmdType(Enum):
NOT_SET = -1
EVAL_START = 0
EVAL_OUTPUT = 1
EVAL_END = 2
DUPLICATE = 3
POP_VALUE = 4
POP_FUN = 5
POP_TUNNEL = 6
BEGIN_STR = 7
END_STR = 8
NO_OP = 9
CHOICE_COUNT = 10
TURNS_SINCE = 11
READ_COUN... | {
"repo_name": "facelesspanda/inkpy",
"path": "inkpy/_runtime/cmd.py",
"copies": "1",
"size": "2533",
"license": "mit",
"hash": -3556422476559694300,
"line_mean": 18.1893939394,
"line_max": 47,
"alpha_frac": 0.5862613502,
"autogenerated": false,
"ratio": 3.4369063772048847,
"config_test": false,... |
from enum import Enum
from operator import attrgetter
from typing import Any, Dict, List, NamedTuple, Union, cast
from ..language import print_ast, visit, ObjectValueNode, Visitor
from ..pyutils import inspect, FrozenList, Undefined
from ..type import (
GraphQLEnumType,
GraphQLField,
GraphQLList,
Graph... | {
"repo_name": "graphql-python/graphql-core",
"path": "src/graphql/utilities/find_breaking_changes.py",
"copies": "1",
"size": "21096",
"license": "mit",
"hash": -3383217148003826000,
"line_mean": 32.4326465927,
"line_max": 88,
"alpha_frac": 0.5906806978,
"autogenerated": false,
"ratio": 3.8377296... |
from enum import Enum
from operator import le
__all__ = [
'EnumSet',
]
class EnumTypeMode(Enum):
NONE = 1
ALL = 2
class EnumSetMeta(type):
def none_of(cls, enum_type):
return cls._create_enum_set(enum_type, EnumTypeMode.NONE)
def all_of(cls, enum_type):
return cls._create_enu... | {
"repo_name": "t2y/extenum",
"path": "extenum/enumset.py",
"copies": "1",
"size": "2329",
"license": "apache-2.0",
"hash": 3459712977917805600,
"line_mean": 27.0602409639,
"line_max": 78,
"alpha_frac": 0.5680549592,
"autogenerated": false,
"ratio": 3.644757433489828,
"config_test": false,
"ha... |
from enum import Enum
from paraview.simple import (
Render,
SaveScreenshot
)
class Palette(Enum):
Current = ""
TransparentBackground = "TransparentBackground"
BlackBackground = "BlackBackground"
DefaultBackground = "DefaultBackground"
GradientBackground = "GradientBackground"
GrayBackg... | {
"repo_name": "OpenChemistry/tomviz",
"path": "tomviz/python/tomviz/state/_views.py",
"copies": "1",
"size": "4965",
"license": "bsd-3-clause",
"hash": -4964032695024025000,
"line_mean": 27.8662790698,
"line_max": 80,
"alpha_frac": 0.5959718026,
"autogenerated": false,
"ratio": 4.147869674185464,... |
from enum import Enum
from .Partition import Partition
from .abstracts import Mountable
class DiskType(Enum):
ssd = "ssd"
hdd = "hdd"
nvme = "nvme"
archive = "archive"
cdrom = 'cdrom'
class Disks:
"""Subobject to list disks"""
def __init__(self, node):
self.node = node
@pro... | {
"repo_name": "zero-os/0-orchestrator",
"path": "pyclient/zeroos/orchestrator/sal/Disk.py",
"copies": "2",
"size": "5186",
"license": "apache-2.0",
"hash": -4689662151573644000,
"line_mean": 27.4945054945,
"line_max": 74,
"alpha_frac": 0.5291168531,
"autogenerated": false,
"ratio": 4.212835093419... |
from enum import Enum
from pathlib import Path
from typing import Optional, List, Callable
from booru_toolkit import errors
from booru_toolkit.plugin import Safety
def box_to_ui(text: str) -> str:
return text.replace("_", " ")
def unbox_from_ui(text: str) -> str:
return text.replace(" ", "_")
class TagSou... | {
"repo_name": "rr-/dotfiles",
"path": "opt/booru-toolkit/booru_toolkit/upload/common.py",
"copies": "1",
"size": "2077",
"license": "mit",
"hash": 503606847762662000,
"line_mean": 24.3292682927,
"line_max": 74,
"alpha_frac": 0.5729417429,
"autogenerated": false,
"ratio": 3.6566901408450705,
"co... |
from enum import Enum
from pathlib import Path
from OpenGL.GL import *
class ShaderType(Enum):
VERTEX = GL_VERTEX_SHADER
GEOMETRY = GL_GEOMETRY_SHADER
FRAGMENT = GL_FRAGMENT_SHADER
class ShaderProgram(object):
def __init__(self):
self._uniforms = {}
self._program_id = None
def ... | {
"repo_name": "maxfish/mgl2d",
"path": "mgl2d/graphics/shader_program.py",
"copies": "1",
"size": "4014",
"license": "mit",
"hash": 4047449517714775000,
"line_mean": 32.731092437,
"line_max": 97,
"alpha_frac": 0.6494768311,
"autogenerated": false,
"ratio": 3.530343007915567,
"config_test": fals... |
from enum import Enum
from protobuf3.fields import *
from protobuf3.message import Message
class UninterpretedOption(Message):
class NamePart(Message):
name_part = StringField(field_number=1, required=True)
is_extension = BoolField(field_number=2, required=True)
name = MessageField(field_numb... | {
"repo_name": "Pr0Ger/protobuf3",
"path": "protobuf3/compiler/plugin_api.py",
"copies": "1",
"size": "8935",
"license": "mit",
"hash": 8497762312197433000,
"line_mean": 36.7004219409,
"line_max": 99,
"alpha_frac": 0.7104644656,
"autogenerated": false,
"ratio": 3.757359125315391,
"config_test": ... |
from enum import Enum
from pyMathBitPrecise.bit_utils import set_bit_range
# deassign_xyz_mux;
ARITHMETIC_MODES_DRC_deassign_xyz_mux = [
# 0bxxx0101010
* [set_bit_range(0b0000101010, 7, 3, i) for i in range(8)],
0b0000000000,
0b0000011000,
0b0000011010,
0b0000101000,
0b0001000000,
0b000... | {
"repo_name": "Nic30/hwtLib",
"path": "hwtLib/xilinx/primitive/dsp48e1_constants.py",
"copies": "1",
"size": "6843",
"license": "mit",
"hash": -2572418944722156500,
"line_mean": 19.7303030303,
"line_max": 87,
"alpha_frac": 0.6130682649,
"autogenerated": false,
"ratio": 2.382793451758969,
"confi... |
from enum import Enum
from PyQt4.Qt import QObject
from PyQt4 import QtCore
from math import floor
class AbstractInterpreter(QObject):
publish_infos_sig = QtCore.pyqtSignal(list)
def __init__(self, export_options=False, file_path=False, env_spec=None):
QObject.__init__(self)
self.e... | {
"repo_name": "PhilippMundhenk/IVNS",
"path": "ECUSimulation/io_processing/result_interpreter/abst_result_interpreter.py",
"copies": "1",
"size": "2147",
"license": "mit",
"hash": 6031912579232281000,
"line_mean": 30.115942029,
"line_max": 122,
"alpha_frac": 0.5891942245,
"autogenerated": false,
... |
from enum import Enum
from PyQt5.QtCore import *
class DiscreteNotes(Enum):
C0 = 0
Cs0 = 1
D0 = 2
Ds0 = 3
E0 = 4
F0 = 5
Fs0 = 6
G0 = 7
Gs0 = 8
A0 = 9
As0 = 10
B0 = 11
C1 = 12
Cs1 = 13
D1 = 14
Ds1 = 15
E1 = 16
F1 = 17
... | {
"repo_name": "killalea/digital-keyboard",
"path": "constants.py",
"copies": "1",
"size": "2637",
"license": "mit",
"hash": -1141686530167059600,
"line_mean": 24.3653846154,
"line_max": 57,
"alpha_frac": 0.5578308684,
"autogenerated": false,
"ratio": 2.5726829268292684,
"config_test": false,
... |
from enum import Enum
from pyravendb.custom_exceptions.exceptions import *
from pyravendb.data.indexes import IndexQuery
from pyravendb.tools.utils import Utils
from datetime import timedelta
import sys
import time
import re
class EscapeQueryOptions(Enum):
EscapeAll = 0
AllowPostfixWildcard = 1
AllowAllWi... | {
"repo_name": "IdanHaim/RavenDB-Python-Client",
"path": "pyravendb/store/session_query.py",
"copies": "1",
"size": "15982",
"license": "mit",
"hash": 6717549894842006000,
"line_mean": 40.72845953,
"line_max": 117,
"alpha_frac": 0.5922913277,
"autogenerated": false,
"ratio": 4.071847133757962,
"... |
from enum import Enum
from queue import Queue, Empty # TODO(python 3.7+): use SimpleQueue
from threading import Thread
from urllib.parse import ParseResult as URL, urlunparse
import asyncio
import json
import traceback
import websockets
from websockets.client import WebSocketClientProtocol
from rlbot.utils.logging_u... | {
"repo_name": "drssoccer55/RLBot",
"path": "src/main/python/rlbot/matchcomms/client.py",
"copies": "1",
"size": "3589",
"license": "mit",
"hash": 8656081384576292000,
"line_mean": 37.1808510638,
"line_max": 102,
"alpha_frac": 0.6179994427,
"autogenerated": false,
"ratio": 4.101714285714285,
"co... |
from enum import Enum
from queue import Queue
import sys
import time
import requests
from app.common.cluster_service import ClusterService
from app.project_type.project_type import SetupFailureError
from app.slave.subjob_executor import SubjobExecutor
from app.util import analytics, log, util
from app.util.exceptions... | {
"repo_name": "nickzuber/ClusterRunner",
"path": "app/slave/cluster_slave.py",
"copies": "1",
"size": "15963",
"license": "apache-2.0",
"hash": 8087154993244885000,
"line_mean": 45.4040697674,
"line_max": 120,
"alpha_frac": 0.6461817954,
"autogenerated": false,
"ratio": 4.143005450298468,
"conf... |
from enum import Enum
from random import randint
from orient import Orientation
from position import Position
class TunnelType(Enum):
none, horizontal, vertical = range(3)
class Tunnel(object):
def __init__(self, pos_row, pos_col, length=1, orient=Orientation.right):
self.pos = Position(pos_row, po... | {
"repo_name": "f0lie/RogueGame",
"path": "src/tunnel.py",
"copies": "1",
"size": "3187",
"license": "mit",
"hash": 42833030819175890,
"line_mean": 32.5473684211,
"line_max": 77,
"alpha_frac": 0.5506746156,
"autogenerated": false,
"ratio": 3.8818514007308162,
"config_test": false,
"has_no_keyw... |
from enum import Enum
from random import randint
import discord
from discord.ext import commands
from discord import ChannelType
class PlayerState(Enum):
STOPPED = 0 # When the player isn't playing anything
PLAYING = 1 # The player is actively playing music.
PAUSED = 2 # The player is paused on a son... | {
"repo_name": "jdeight/High-Noon-Bot",
"path": "module/voice.py",
"copies": "1",
"size": "7770",
"license": "mit",
"hash": -5143261908074536000,
"line_mean": 32.9301310044,
"line_max": 91,
"alpha_frac": 0.6091377091,
"autogenerated": false,
"ratio": 3.65819209039548,
"config_test": false,
"ha... |
from enum import Enum
from requests import Response
from urllib.parse import unquote
import json
class ApiErrorCode(Enum):
PHP_INVALID = 0
PHP_MISSING_PARAMS = 1
PHP_AUTH_FAILED = 2
PHP_NAME_INVALID = 4
PHP_USERNAME_INVALID = 5
PHP_USER_ALREADY_EXISTS = 6
PHP_PASSWORD_INVALID = 7
PHP_U... | {
"repo_name": "Mechazawa/WordOn-HD-Bot",
"path": "wordonhd/ApiException.py",
"copies": "1",
"size": "1937",
"license": "bsd-2-clause",
"hash": 9204123441154233000,
"line_mean": 27.5,
"line_max": 87,
"alpha_frac": 0.608673206,
"autogenerated": false,
"ratio": 3.1241935483870966,
"config_test": f... |
from enum import Enum
from s3.direction import Direction
from s3.lever import Lever, LeverError
from s3.track import Track, TrackError
class SignalError(Exception):
"""
Raised when an invalid operation is performed on a Signal.
"""
class Signal:
"""
An individual signal in a track layout. A color-light
signal... | {
"repo_name": "sammdot/S3",
"path": "s3/signal.py",
"copies": "1",
"size": "4280",
"license": "bsd-3-clause",
"hash": 2587831577966404000,
"line_mean": 27.3443708609,
"line_max": 84,
"alpha_frac": 0.6813084112,
"autogenerated": false,
"ratio": 3.158671586715867,
"config_test": false,
"has_no_... |
from enum import Enum
from s3.interlocking import Interlocking, InterlockingError
class LeverError(Exception):
"""
Raised when an invalid operation is performed on a Lever.
"""
class LeverState(Enum):
"""
A list of all possible (mutually exclusive) states of a lever.
Levers should only be locked in NORMAL or ... | {
"repo_name": "sammdot/S3",
"path": "s3/lever.py",
"copies": "1",
"size": "1986",
"license": "bsd-3-clause",
"hash": 6124090660065494000,
"line_mean": 23.825,
"line_max": 74,
"alpha_frac": 0.7089627392,
"autogenerated": false,
"ratio": 3.2880794701986753,
"config_test": false,
"has_no_keyword... |
from enum import Enum
from scapy.layers.bluetooth import *
from scapy.utils import mac2str, str2mac
class AddressType(Enum):
public = 0
random = 1
class Address(object):
@staticmethod
def from_packet(packet):
if packet.getlayer(HCI_LE_Meta_Connection_Complete) is not None:
return... | {
"repo_name": "pebble/pybluetooth",
"path": "pybluetooth/address.py",
"copies": "1",
"size": "1550",
"license": "mit",
"hash": -6823842687748922000,
"line_mean": 30,
"line_max": 72,
"alpha_frac": 0.6103225806,
"autogenerated": false,
"ratio": 3.708133971291866,
"config_test": false,
"has_no_k... |
from enum import Enum
from searchengine.evaluation.evaluation import Request
class InvalidRequest(Exception):
def __init__(self, pos, *args, **kwargs):
super()
self.pos = pos
def load_from_results_file(path):
"""
Parameter:
path (string) - path to the CACM results file
Return... | {
"repo_name": "Neki/searchengine",
"path": "searchengine/parser/result.py",
"copies": "1",
"size": "1412",
"license": "mit",
"hash": 1519769525255455700,
"line_mean": 24.6727272727,
"line_max": 71,
"alpha_frac": 0.5899433428,
"autogenerated": false,
"ratio": 3.386091127098321,
"config_test": fa... |
from enum import Enum
from simplads.simplad_monad.delta_type import DeltaType
from simplads.simplad_monad.namedtuples.bind_args import BindArgs
from simplads.simplad_monad.namedtuples.bound import Bound
from simplads.simplad_monad.namedtuples.delta_overwrite import DeltaOverwrite
from simplads.simplad_monad.namedtuples... | {
"repo_name": "Cogmob/simplads",
"path": "simplads/simplads/list_simplad.py",
"copies": "1",
"size": "2053",
"license": "mit",
"hash": -4030999718064310000,
"line_mean": 35.0175438596,
"line_max": 79,
"alpha_frac": 0.6867998052,
"autogenerated": false,
"ratio": 3.753199268738574,
"config_test":... |
from enum import Enum
from simplads.simplad_monad.delta_type import DeltaType
from simplads.simplad_monad.namedtuples.bind_args import BindArgs
from simplads.simplad_monad.namedtuples.delta_overwrite import DeltaOverwrite
from simplads.simplad_monad.simplad_base_helper import SimpladBaseHelper
from .namedtuples.error_r... | {
"repo_name": "Cogmob/simplads",
"path": "simplads/simplads/error_simplad.py",
"copies": "1",
"size": "1991",
"license": "mit",
"hash": 7693354165203250000,
"line_mean": 30.109375,
"line_max": 88,
"alpha_frac": 0.6750376695,
"autogenerated": false,
"ratio": 3.799618320610687,
"config_test": fal... |
from enum import Enum
from sqlalchemy import Column, Integer, String
from sqlalchemy.dialects.postgresql import JSONB, ARRAY
from sqlalchemy import and_, or_, cast
from scrapyproject.models import Session
from scrapyproject.models.models import DeclarativeBase
from scrapyproject.utils import ScreenUtils
class Cinema(... | {
"repo_name": "gas1121/JapanCinemaStatusSpider",
"path": "scrapyproject/models/cinema.py",
"copies": "1",
"size": "4125",
"license": "mit",
"hash": 1296757721950749700,
"line_mean": 40.6666666667,
"line_max": 76,
"alpha_frac": 0.6174545455,
"autogenerated": false,
"ratio": 3.8587464920486436,
"... |
from enum import enum
from struct import Struct
##############################################
## Parameters for the structure drawing ##
##############################################
TDP_LEN_LBL = 16
TBL_TYPES = enum(
itBASIC = 0,
itISOTOPIC = 1,
itSTEREO = 2,
TDP_NUM_PAR =3
)
TBL_LABELS = ... | {
"repo_name": "mnowotka/pyInChI",
"path": "pyInChI/ichidrp.py",
"copies": "1",
"size": "3119",
"license": "mit",
"hash": 2409861922279545300,
"line_mean": 24.5655737705,
"line_max": 92,
"alpha_frac": 0.6502084001,
"autogenerated": false,
"ratio": 3.2422037422037424,
"config_test": false,
"has... |
from enum import Enum
from struct import unpack_from
def _twoscomplement(x, bits):
if x >= (1 << (bits - 1)):
return x - (1 << bits)
return x
def _zigzag(x):
if x & 1:
return -1 - (x >> 1)
return x >> 1
class _Field(object):
def __init__(self, tag):
self.tag = tag
cla... | {
"repo_name": "tilezen/scoville",
"path": "scoville/pbf.py",
"copies": "1",
"size": "4389",
"license": "mit",
"hash": 2452805158775731000,
"line_mean": 22.1,
"line_max": 78,
"alpha_frac": 0.5472772841,
"autogenerated": false,
"ratio": 3.4916467780429596,
"config_test": false,
"has_no_keywords... |
from enum import Enum
from sys import stderr
from typing import List
class Side(Enum):
"""
Where should be printed the character?
"""
Left: int = 1
Right: int = 2
Both: int = 3
def get_vertical(character: str, spaces: int, side: Side) -> str:
"""
Prints twice the given character with... | {
"repo_name": "informaticienzero/CodinGame",
"path": "Communautaires/7-segment display.py",
"copies": "1",
"size": "3091",
"license": "mit",
"hash": -3444882955288403000,
"line_mean": 26.8468468468,
"line_max": 82,
"alpha_frac": 0.6091879651,
"autogenerated": false,
"ratio": 3.61943793911007,
"... |
from enum import Enum
from text_regonizer.inputs import ArbitaryInput, TimeInput, InputType, StringInput
from text_regonizer.common import any_result
class HandlerStatus(Enum):
DONE = 1
PROCESSING = 2
NOT_FOUND = 3
class Command:
structures = None
def matches(self, sentence):
i = any_re... | {
"repo_name": "Matt3o12/TextRegonizer",
"path": "text_regonizer/commands.py",
"copies": "1",
"size": "4287",
"license": "mit",
"hash": 6008384696425015000,
"line_mean": 32.7559055118,
"line_max": 82,
"alpha_frac": 0.578026592,
"autogenerated": false,
"ratio": 4.56063829787234,
"config_test": fa... |
from enum import Enum
from threading import Thread
from . import botapi
import mimetypes
from datetime import datetime
from abc import ABCMeta, abstractmethod
import collections
class Message:
def __init__(self):
self.id = None
self.flags = None
self.mention = None
self.out = None... | {
"repo_name": "datamachine/twx",
"path": "twx/twx.py",
"copies": "1",
"size": "29957",
"license": "mit",
"hash": -9081090018184110000,
"line_mean": 34.7897252091,
"line_max": 122,
"alpha_frac": 0.5992789424,
"autogenerated": false,
"ratio": 3.9866915091828585,
"config_test": false,
"has_no_ke... |
from enum import Enum
from threading import Thread, RLock
from time import sleep
from uuid import uuid4
from ..action import *
from ..bus import Bus
from ..bus.action_bus import ActionBus
from ..event import StopEvent
from ..utils import *
class WorkerState(Enum):
Initializing = 'Initializing'
Ready = 'Ready'... | {
"repo_name": "BlackLight/evesp",
"path": "evesp/worker/__init__.py",
"copies": "1",
"size": "3814",
"license": "apache-2.0",
"hash": -7897368974937092000,
"line_mean": 27.2518518519,
"line_max": 82,
"alpha_frac": 0.6046145779,
"autogenerated": false,
"ratio": 4.109913793103448,
"config_test": ... |
from enum import Enum
from threading import Timer, Event, Thread
from queue import Queue
def call_repeatedly(interval, func):
stopped = Event()
def loop():
while not stopped.wait(interval): # the first call is in `interval` secs
func()
Thread(target=loop).start()
return stopped.set
... | {
"repo_name": "chairman-of-the-bored/Zoo",
"path": "sim.py",
"copies": "1",
"size": "3714",
"license": "bsd-3-clause",
"hash": -850641291024593700,
"line_mean": 24.979020979,
"line_max": 87,
"alpha_frac": 0.5379644588,
"autogenerated": false,
"ratio": 3.644749754661433,
"config_test": false,
... |
from enum import Enum
from tilequeue.utils import format_stacktrace_one_line
import json
import logging
import sys
def int_if_exact(x):
try:
i = int(x)
return i if i == x else x
except ValueError:
# shouldn't practically happen, but prefer to just log the original
# instead of ... | {
"repo_name": "tilezen/tilequeue",
"path": "tilequeue/log.py",
"copies": "2",
"size": "15704",
"license": "mit",
"hash": -7194412414781854000,
"line_mean": 32.200845666,
"line_max": 79,
"alpha_frac": 0.5875573102,
"autogenerated": false,
"ratio": 3.716043539990535,
"config_test": false,
"has_... |
from enum import Enum
from time import sleep
from ._ingenialink import lib, ffi
from ._utils import cstr, pstr, raise_null, raise_err, to_ms
from .registers import REG_DTYPE
from .exceptions import *
import numpy as np
import socket
import struct
import binascii
import os
import ingenialogger
logger = ingenialogger.... | {
"repo_name": "ingeniamc/ingenialink-python",
"path": "ingenialink/net.py",
"copies": "1",
"size": "24979",
"license": "mit",
"hash": -8944919823255858000,
"line_mean": 25.516985138,
"line_max": 118,
"alpha_frac": 0.5440169743,
"autogenerated": false,
"ratio": 3.750037531902117,
"config_test": ... |
from enum import Enum
from time import sleep
from vcx.api.connection import Connection
from vcx.state import State
class BaseConnection:
def __init__(self):
self.connection_data = {}
self.active = True
self.thread = None
async def update_state(self):
connection_ = await Conn... | {
"repo_name": "Artemkaaas/indy-sdk",
"path": "vcx/wrappers/python3/aries-test-server/connection.py",
"copies": "1",
"size": "1667",
"license": "apache-2.0",
"hash": 6704617782113143000,
"line_mean": 28.2456140351,
"line_max": 93,
"alpha_frac": 0.6484703059,
"autogenerated": false,
"ratio": 4.4100... |
from enum import Enum
from tkinter import *
import subprocess as sp
import time
import json
import mediaPlayer as mediaPlayer
BACKGROUND_COLOR = "#2b2b2b"
FOREGROUND_COLOR = "#d9d9d9"
IMAGE_PATH = "images/"
LISTBOX_WIDTH = 25
Aap = Enum("Aap", "ALL ALBUM PLAYLIST ARTIST")
class RootApp:
use_defaults = True
... | {
"repo_name": "wesley5040/carPi",
"path": "pythonApp/app.py",
"copies": "1",
"size": "21128",
"license": "mit",
"hash": -4452722274885412400,
"line_mean": 46.0556792873,
"line_max": 229,
"alpha_frac": 0.6154392276,
"autogenerated": false,
"ratio": 3.345684877276326,
"config_test": false,
"has... |
from enum import Enum
from turtle import Turtle, Screen
import glob
import os
import sys
import math
import random
import Proyecto.Worms.Utilidades as Utilidades
import Proyecto.Worms.Excepciones as Excepciones
_ARCHIVO_RANKING = 'ranking.txt'
_RESFOLDERS = 'Resources'
_FUENTE = ("Helvetica", 10, "bold")
_TUMBAS = 0,... | {
"repo_name": "IhToN/DAW1-PRG",
"path": "Proyecto/Worms/WormsGame.py",
"copies": "1",
"size": "19610",
"license": "apache-2.0",
"hash": 6381020208186595000,
"line_mean": 34.380866426,
"line_max": 122,
"alpha_frac": 0.6009387276,
"autogenerated": false,
"ratio": 2.9640102827763495,
"config_test"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.