text stringlengths 0 1.05M | meta dict |
|---|---|
__all__ = [
'ManySlicesAlongPoints',
'ManySlicesAlongAxis',
'SlideSliceAlongPoints',
'SliceThroughTime',
]
__displayname__ = 'Slicing'
import numpy as np
import vtk
from vtk.numpy_interface import dataset_adapter as dsa
import pyvista as pv
from .. import _helpers
from ..base import FilterBase
cla... | {
"repo_name": "banesullivan/ParaViewGeophysics",
"path": "PVGeo/filters/slicing.py",
"copies": "1",
"size": "16114",
"license": "bsd-3-clause",
"hash": 5952381445426068000,
"line_mean": 33.285106383,
"line_max": 88,
"alpha_frac": 0.5752761574,
"autogenerated": false,
"ratio": 3.9621342512908777,
... |
__all__ = (
"MDRenderer",
"LOGGER",
"RenderTreeNode",
"DEFAULT_RENDERERS",
"RenderContext",
"WRAP_POINT",
)
import logging
from types import MappingProxyType
from typing import Any, Dict, Mapping, MutableMapping, Sequence, Tuple
from markdown_it.common.normalize_url import unescape_string
from... | {
"repo_name": "executablebooks/mdformat",
"path": "mdformat/renderer/__init__.py",
"copies": "1",
"size": "3886",
"license": "mit",
"hash": -662770030172442800,
"line_mean": 32.5,
"line_max": 85,
"alpha_frac": 0.5748841997,
"autogenerated": false,
"ratio": 4.436073059360731,
"config_test": fals... |
__all__ = [
'Measurement',
'make_counter',
'make_rater',
'make_timer',
]
import collections
import functools
import time
Measurement = collections.namedtuple('Measurement', 'when value duration')
def make_counter(metry, name):
return functools.partial(count, metry.measure, name)
def make_rate... | {
"repo_name": "clchiou/garage",
"path": "py/garage/garage/metry/measures.py",
"copies": "1",
"size": "1769",
"license": "mit",
"hash": 5084450176349412000,
"line_mean": 21.3924050633,
"line_max": 74,
"alpha_frac": 0.6082532504,
"autogenerated": false,
"ratio": 3.8456521739130434,
"config_test":... |
__all__ = [
'MessageBuffer',
'Message',
'Socket',
'BindEndpoint',
'ConnectEndpoint',
'device',
'terminate',
# Extend with constants and errors.
]
import ctypes
import enum
from collections import OrderedDict
from functools import partial
from . import _nanomsg as _nn
from . import cons... | {
"repo_name": "clchiou/garage",
"path": "py/nanomsg/nanomsg/__init__.py",
"copies": "1",
"size": "19665",
"license": "mit",
"hash": 4961633630013615000,
"line_mean": 29.4411764706,
"line_max": 79,
"alpha_frac": 0.5745741165,
"autogenerated": false,
"ratio": 3.843072112565957,
"config_test": fal... |
__all__ = [
'MessageBuilder',
'MessageReader',
'DynamicEnum',
'DynamicList',
'DynamicStruct',
'AnyPointer',
]
import collections
import collections.abc
import enum
import os
from . import bases
from . import io
from . import native
from .schemas import Schema
from .schemas import Type
clas... | {
"repo_name": "clchiou/garage",
"path": "py/capnp/capnp/dynamics.py",
"copies": "1",
"size": "26626",
"license": "mit",
"hash": 7664514991665679000,
"line_mean": 29.8171296296,
"line_max": 78,
"alpha_frac": 0.5724104259,
"autogenerated": false,
"ratio": 4.075616102862391,
"config_test": false,
... |
__all__ = [
'MessageReader',
'MessageBuilder',
]
from g1.bases.assertions import ASSERT
from . import _capnp
# pylint: disable=c-extension-no-member
from . import bases
from . import dynamics
from . import schemas
class _Array(bases.BaseResource):
_raw_type = (_capnp._Array_byte, _capnp._Array_word)
... | {
"repo_name": "clchiou/garage",
"path": "py/g1/third-party/capnp/capnp/messages.py",
"copies": "1",
"size": "3245",
"license": "mit",
"hash": -8060624536851185000,
"line_mean": 26.974137931,
"line_max": 79,
"alpha_frac": 0.6326656394,
"autogenerated": false,
"ratio": 3.8356973995271866,
"config... |
__all__ = [
'MockSession',
'MockResponse',
'fake_sleep',
]
import requests
class MockSession:
"""Mock of requests.Session."""
def __init__(self, req_to_rep):
self._req_to_rep = req_to_rep
self._logs = []
def head(self, url, **kwargs):
return self.send(requests.Reques... | {
"repo_name": "clchiou/garage",
"path": "py/garage/tests/http/mocks.py",
"copies": "1",
"size": "1493",
"license": "mit",
"hash": 9166253557696931000,
"line_mean": 25.1929824561,
"line_max": 75,
"alpha_frac": 0.5941058272,
"autogenerated": false,
"ratio": 3.847938144329897,
"config_test": false... |
__all__ = [
'NanomsgError',
# Extend in _create_errors().
]
from . import _nanomsg as _nn
from .constants import Error
_ERRORS = {}
class NanomsgError(Exception):
"""Base exception class."""
@staticmethod
def make(error):
exc_class = _ERRORS.get(error)
if exc_class is None:
... | {
"repo_name": "clchiou/garage",
"path": "py/nanomsg/nanomsg/errors.py",
"copies": "1",
"size": "1309",
"license": "mit",
"hash": -8686524670731796000,
"line_mean": 21.5689655172,
"line_max": 78,
"alpha_frac": 0.5691367456,
"autogenerated": false,
"ratio": 3.5961538461538463,
"config_test": fals... |
__all__ = []
class _MetaAnnotations:
annotations = list()
def annotation_iterator(self):
return self.annotations.iterator() # TBD
def clear_annotations(self):
self.annotations = list()
def add_annotation(self, annotation):
self.annotations.append(annotation)
def remove_a... | {
"repo_name": "telukir/PubMed2Go",
"path": "BioC_export/bioc/meta/_bioc_meta.py",
"copies": "2",
"size": "1358",
"license": "isc",
"hash": 3285053936477041000,
"line_mean": 22.4137931034,
"line_max": 65,
"alpha_frac": 0.6200294551,
"autogenerated": false,
"ratio": 3.8361581920903953,
"config_te... |
__all__ = []
def export(value):
__all__.append(value.__name__)
return value
import sys
module = sys.modules[__name__]
class Context(object):
level = 0
indent = ' '
def __enter__(self):
self.level += 1
return self.__lshift__
def __exit__(self, type_, value, btrace):
... | {
"repo_name": "kostyll/usb-flash-network-monitor",
"path": "server/html.py",
"copies": "2",
"size": "4657",
"license": "mit",
"hash": 6395835275988908000,
"line_mean": 24.3097826087,
"line_max": 98,
"alpha_frac": 0.5086965858,
"autogenerated": false,
"ratio": 3.6669291338582677,
"config_test": ... |
__all__ = (
'NetElement',
'NamedNetElement',
)
from .errors import NetError
class NetElement(object):
def __init__(self, *, net=None):
self._net = net
def bind(self, net):
print("*** bind:", self, net)
if self._net is not None and self._net is not net:
raise NetEr... | {
"repo_name": "simone-campagna/petra",
"path": "petra/net_element.py",
"copies": "1",
"size": "1069",
"license": "apache-2.0",
"hash": -368822919237587600,
"line_mean": 23.2954545455,
"line_max": 92,
"alpha_frac": 0.5285313377,
"autogenerated": false,
"ratio": 3.7118055555555554,
"config_test":... |
__all__ = (
'Net',
)
import builtins
import collections
import itertools
from .errors import InternalError, NodeError
from .marking import Marking
from .net_element import NamedNetElement
from .node import Node
from .place import Place
from .transition import Transition
class Net(NamedNetElement):
__dict_f... | {
"repo_name": "simone-campagna/petra",
"path": "petra/net.py",
"copies": "1",
"size": "7080",
"license": "apache-2.0",
"hash": 3576607404941713400,
"line_mean": 29.6493506494,
"line_max": 101,
"alpha_frac": 0.5638418079,
"autogenerated": false,
"ratio": 4.257366205652436,
"config_test": false,
... |
__all__ = [
'newaxis', 'ufunc',
'asarray', 'asanyarray', 'base_repr',
'array_repr', 'array_str', 'set_string_function',
'array_equal', 'outer', 'vdot', 'identity', 'little_endian',
'Inf', 'inf', 'infty', 'Infinity', 'nan', 'NaN', 'False_', 'True_',
'sete... | {
"repo_name": "bussiere/pypyjs",
"path": "website/demo/home/rfk/repos/pypy/lib_pypy/numpypy/core/numeric.py",
"copies": "2",
"size": "17709",
"license": "mit",
"hash": -6345664618002090000,
"line_mean": 27.6090468498,
"line_max": 83,
"alpha_frac": 0.5619741374,
"autogenerated": false,
"ratio": 3.... |
__all__ = [
'new_deque',
'Deque',
'new_queue',
'Queue',
'new_stack',
'Stack',
'new_heap',
'Heap',
'new_max_heap',
'new_min_heap',
'new_priority_queue',
'PriorityQueue',
'new_suffix_array',
'new_tree_node',
'TreeNode',
]
from typing import Any
from typing impo... | {
"repo_name": "rlishtaba/py-algorithms",
"path": "py_algorithms/data_structures/__init__.py",
"copies": "1",
"size": "3556",
"license": "mit",
"hash": -9074130887530045000,
"line_mean": 23.8671328671,
"line_max": 85,
"alpha_frac": 0.6212035996,
"autogenerated": false,
"ratio": 3.320261437908497,
... |
__all__ = []
import asyncio
from .log import logger
from .events import send_event, eventhandler
from .common import mpstr
from .exceptions import XMLRPCError
_MAXREADLIST = 300
class Player():
def __init__(self, server, login, is_spectator, nickname):
self.server = server
self.login = login
... | {
"repo_name": "juergenz/pie",
"path": "src/pie/players.py",
"copies": "1",
"size": "2878",
"license": "mit",
"hash": -724746819172537500,
"line_mean": 23.1932773109,
"line_max": 82,
"alpha_frac": 0.6445448228,
"autogenerated": false,
"ratio": 3.277904328018223,
"config_test": false,
"has_no_k... |
__all__ = []
import concurrent.futures._base
import reprlib
from . import events
Error = concurrent.futures._base.Error
CancelledError = concurrent.futures.CancelledError
TimeoutError = concurrent.futures.TimeoutError
class InvalidStateError(Error):
"""The operation is not allowed in this state."""
# States ... | {
"repo_name": "mindbender-studio/setup",
"path": "bin/windows/python36/Lib/asyncio/base_futures.py",
"copies": "6",
"size": "2074",
"license": "mit",
"hash": 1523392539046361300,
"line_mean": 28.2112676056,
"line_max": 71,
"alpha_frac": 0.5964320154,
"autogenerated": false,
"ratio": 3.92803030303... |
__all__ = []
import pygame, sys, os
from pygame.locals import *
import cafeinagame
from cafeinagame import *
from .cafeinarobot import CafeinaRobot
cr = None
# ENGLISH DEFINITIONS
def create(world, robot_direction, robot_velocity, out_X=0, out_Y=0):
global cr
cr = cafeinarobot.CafeinaRobot(world, robot_di... | {
"repo_name": "dacanizares/CafeinaRobot",
"path": "robot/__init__.py",
"copies": "1",
"size": "1156",
"license": "mit",
"hash": -392269223487442300,
"line_mean": 15.0555555556,
"line_max": 88,
"alpha_frac": 0.6479238754,
"autogenerated": false,
"ratio": 2.7990314769975786,
"config_test": false,... |
__all__ = ()
import reprlib
from . import format_helpers
# States for Future.
_PENDING = 'PENDING'
_CANCELLED = 'CANCELLED'
_FINISHED = 'FINISHED'
def isfuture(obj):
"""Check for a Future.
This returns True when obj is a Future instance or is advertising
itself as duck-type compatible by setting _asyn... | {
"repo_name": "batermj/algorithm-challenger",
"path": "code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Lib/asyncio/base_futures.py",
"copies": "10",
"size": "1822",
"license": "apache-2.0",
"hash": -361225579306819600,
"line_mean": 28.868852459,
"line_max": 71,
"alpha_f... |
__all__ = []
import sys
def _load_models():
from collections import OrderedDict, namedtuple
import pkg_resources
from scripting import error, status
from .framework.bmi_bridge import bmi_factory
models = OrderedDict()
failed = []
for entry_point in pkg_resources.iter_entry_points(grou... | {
"repo_name": "csdms/coupling",
"path": "pymt/models.py",
"copies": "1",
"size": "1150",
"license": "mit",
"hash": -7370293149420776000,
"line_mean": 22.4693877551,
"line_max": 83,
"alpha_frac": 0.6052173913,
"autogenerated": false,
"ratio": 3.9383561643835616,
"config_test": false,
"has_no_k... |
__all__ = [
'NinjaRule',
'write_header_to',
]
import iga.context
import iga.precond
from iga.registry import RegistryMixin
RULE_VARS_1_0 = frozenset((
'command',
'depfile',
'description',
'generator',
'in',
'in_newline',
'out',
'restat',
'rspfile',
'rspfile_content',
))... | {
"repo_name": "clchiou/iga",
"path": "iga/ninja.py",
"copies": "1",
"size": "3320",
"license": "mit",
"hash": 1482156187257140000,
"line_mean": 22.7142857143,
"line_max": 73,
"alpha_frac": 0.5686746988,
"autogenerated": false,
"ratio": 3.543223052294557,
"config_test": false,
"has_no_keywords... |
__all__ = []
class _MetaAnnotations:
annotations = list()
def annotation_iterator(self):
return self.annotations.iterator() # TBD
def clear_annotations(self):
self.annotations = list()
def add_annotation(self, annotation):
self.annotations.append(annotation)
def remove... | {
"repo_name": "SuLab/PyBioC",
"path": "src/bioc/meta/_bioc_meta.py",
"copies": "1",
"size": "1368",
"license": "bsd-2-clause",
"hash": -3610146353767016400,
"line_mean": 20.375,
"line_max": 65,
"alpha_frac": 0.615497076,
"autogenerated": false,
"ratio": 3.8,
"config_test": false,
"has_no_keyw... |
__all__ = [
'NN_MSG',
# Extend in _load().
]
from collections import defaultdict, namedtuple
from ctypes import byref, sizeof
import enum
from . import _nanomsg as _nn
NN_MSG = -1
NanomsgVersion = namedtuple('NanomsgVersion', 'current revision age')
#
# Instead of using a plain int object as enum member... | {
"repo_name": "clchiou/garage",
"path": "py/nanomsg/nanomsg/constants.py",
"copies": "1",
"size": "5562",
"license": "mit",
"hash": 3039016849730825000,
"line_mean": 29.5604395604,
"line_max": 79,
"alpha_frac": 0.5649047105,
"autogenerated": false,
"ratio": 3.822680412371134,
"config_test": fal... |
__all__ = [
'nn_symbol_properties',
'nn_iovec',
'nn_msghdr',
'nn_pollfd',
# Extend in _load()
]
import ctypes
from ctypes import POINTER, c_char_p, c_int, c_short, c_size_t, c_void_p
_LIBNANOMSG = ctypes.cdll.LoadLibrary('libnanomsg.so')
# NOTE: Definitions below are targeting nanomsg 1.0.0.
... | {
"repo_name": "clchiou/garage",
"path": "py/nanomsg/nanomsg/_nanomsg.py",
"copies": "1",
"size": "3161",
"license": "mit",
"hash": 1343539544182363400,
"line_mean": 28.820754717,
"line_max": 72,
"alpha_frac": 0.538753559,
"autogenerated": false,
"ratio": 2.88675799086758,
"config_test": false,
... |
__all__ = (
'Node',
'BasePlace',
'BaseTransition',
'Arc',
'InputArc',
'OutputArc',
)
import abc
import collections
import itertools
from .annotation import InputAnnotation, OutputAnnotation
from .errors import NodeError, ArcError
from .net_element import NetElement, NamedNetElement
from .seque... | {
"repo_name": "simone-campagna/petra",
"path": "petra/node.py",
"copies": "1",
"size": "6061",
"license": "apache-2.0",
"hash": 1848341055591178000,
"line_mean": 29.9234693878,
"line_max": 93,
"alpha_frac": 0.6069955453,
"autogenerated": false,
"ratio": 4.089743589743589,
"config_test": false,
... |
__all__ = []
__private__ = [ # anything not in __all__ must be in __private__
'BadPermutationError', 'block_perm_and_perms_within_blocks',
'check_permutation', 'compose_permutations', 'concatenate_permutations',
'full_block_perm', 'invert_permutation',
'permutation_from_block_permutations', 'permutati... | {
"repo_name": "mabuchilab/QNET",
"path": "src/qnet/utils/permutations.py",
"copies": "1",
"size": "11312",
"license": "mit",
"hash": 6770833422324667000,
"line_mean": 35.2564102564,
"line_max": 150,
"alpha_frac": 0.6440063649,
"autogenerated": false,
"ratio": 3.7870773351188483,
"config_test": ... |
__all__ = [
'ReleaseRepo',
'PodInstruction',
'SimpleInstruction',
'execute_instructions',
'get_git_stamp',
'get_hg_stamp',
]
from pathlib import Path
import datetime
import logging
import tempfile
import yaml
from foreman import Label
from garage import scripts
from garage.assertions impor... | {
"repo_name": "clchiou/garage",
"path": "shipyard/shipyard/release.py",
"copies": "1",
"size": "22372",
"license": "mit",
"hash": -4448393955289626000,
"line_mean": 34.4548335975,
"line_max": 79,
"alpha_frac": 0.5573484713,
"autogenerated": false,
"ratio": 4.1087235996326905,
"config_test": fal... |
__all__ = [
'OADao',
'OADbTransaction'
]
import binascii
import os
import psycopg2
import psycopg2.extras
import psycopg2.extensions
from textwrap import dedent as td
from ._env import oactx, oalog
from openarc.exception import OAGraphStorageError
## Exportable classes
class OADao(object):
... | {
"repo_name": "kchoudhu/openarc",
"path": "openarc/_dao.py",
"copies": "1",
"size": "4840",
"license": "bsd-3-clause",
"hash": 2727870853440922000,
"line_mean": 31.4832214765,
"line_max": 96,
"alpha_frac": 0.5495867769,
"autogenerated": false,
"ratio": 4.1261722080136405,
"config_test": false,
... |
__all__ = [
'OAG_RootNode',
'OAG_RootD',
'OAG_RpcDiscoverable'
]
import attrdict
import datetime
import hashlib
import inflection
import inspect
import os
import signal
import socket
import sys
from ._db import *
from ._env import *
from ._rdf import *
from ._rpc import reqcls, RpcTransaction, RpcPro... | {
"repo_name": "kchoudhu/openarc",
"path": "openarc/_graph.py",
"copies": "1",
"size": "18621",
"license": "bsd-3-clause",
"hash": 1393845554706332200,
"line_mean": 30.5076142132,
"line_max": 122,
"alpha_frac": 0.5389613877,
"autogenerated": false,
"ratio": 4.00968992248062,
"config_test": false... |
__all__ = [
'OAuthToken',
]
class OAuthToken(object):
"""OAuth credentials base-class. Several implementations are available:
this class:
provides crawler what is require to authenticate against sources
via OAuth.
"""
def __init__(self, access_token, refresh_token=None,
... | {
"repo_name": "LilliJane/docido-python-sdk",
"path": "docido_sdk/oauth/api.py",
"copies": "1",
"size": "2123",
"license": "apache-2.0",
"hash": 9063012606218279000,
"line_mean": 29.3285714286,
"line_max": 79,
"alpha_frac": 0.6241168158,
"autogenerated": false,
"ratio": 4.5853131749460045,
"conf... |
__all__ = [
# OcTree
'OcTreeReader',
'OcTreeAppender',
]
__displayname__ = 'OcTree Mesh'
import vtk
from vtk.util import numpy_support as nps
from .. import _helpers, interface
from .two_file_base import ModelAppenderBase, ubcMeshReaderBase
with _helpers.HiddenPrints():
import discretize
class OcT... | {
"repo_name": "banesullivan/ParaViewGeophysics",
"path": "PVGeo/ubc/octree.py",
"copies": "1",
"size": "8435",
"license": "bsd-3-clause",
"hash": 5094223481506190000,
"line_mean": 37.3409090909,
"line_max": 92,
"alpha_frac": 0.6033195021,
"autogenerated": false,
"ratio": 4.126712328767123,
"con... |
__all__ = ['Node', 'BinaryTree']
class Node():
def __init__(self, val, left=None, right=None):
self.val = val
self.left = left
self.right = right
class BinaryTree():
"""
5
/ \
2 3
/ \ / \
-1 4 2 0
"""
def __init__(self):
self.root = No... | {
"repo_name": "euccas/CodingPuzzles-Python",
"path": "leet/source/binarytree/lib_binary_tree.py",
"copies": "1",
"size": "1857",
"license": "mit",
"hash": -3876208416940346400,
"line_mean": 24.8055555556,
"line_max": 51,
"alpha_frac": 0.5519655358,
"autogenerated": false,
"ratio": 3.2636203866432... |
__all__ = ['Node']
import math
import uuid
import time
import struct
import random
import socket
import asyncio
import marshal
from print_colors import PrintColors
from contact import Contact
from routing_table import RoutingTable
from protocol_command import ProtocolCommand
from ping_protocol_command import PingProt... | {
"repo_name": "mtasic85/routingtable",
"path": "node.py",
"copies": "1",
"size": "8212",
"license": "mit",
"hash": 3484754578402063000,
"line_mean": 33.6497890295,
"line_max": 141,
"alpha_frac": 0.6109352168,
"autogenerated": false,
"ratio": 3.710799819249887,
"config_test": false,
"has_no_ke... |
__all__ = ["node", "remove_tail", "remove_head"]
class node(object):
"""Class representing single-linked list"""
__slots__ = ["data", "next", "previous"]
def __init__(self, data=None, next=None):
self.data = data
self.next = next
def __repr__(self):
if self.next is None:
... | {
"repo_name": "vyzyv/university",
"path": "python/Zestaw9/node.py",
"copies": "1",
"size": "1264",
"license": "apache-2.0",
"hash": -1451620853688562200,
"line_mean": 24.28,
"line_max": 78,
"alpha_frac": 0.5189873418,
"autogenerated": false,
"ratio": 3.482093663911846,
"config_test": false,
"... |
# All nodes are of the form [path1, child1, path2, child2]
# or <value>
from ethereum import utils
from ethereum.db import EphemDB, ListeningDB
import rlp, sys
import copy
hashfunc = utils.sha3
HASHLEN = 32
# 0100000101010111010000110100100101001001 -> ASCII
def decode_bin(x):
return ''.join([chr(int(x[i:i+8],... | {
"repo_name": "harlantwood/pyethereum",
"path": "ethereum/tests/bintrie.py",
"copies": "7",
"size": "8038",
"license": "mit",
"hash": 8548760521041949000,
"line_mean": 26.8131487889,
"line_max": 81,
"alpha_frac": 0.5051007713,
"autogenerated": false,
"ratio": 3.132501948558067,
"config_test": f... |
__all__ = [
'OMFReader',
]
import omf
import omfvista
import vtk
from .. import _helpers
from ..base import ReaderBaseBase
class OMFReader(ReaderBaseBase):
"""Handles reading an OMF Project"""
__displayname__ = 'OMF Project Reader'
__category__ = 'reader'
extensions = 'omf'
description = 'P... | {
"repo_name": "banesullivan/ParaViewGeophysics",
"path": "PVGeo/gmggroup/reader.py",
"copies": "1",
"size": "3555",
"license": "bsd-3-clause",
"hash": 7241441361133668000,
"line_mean": 34.55,
"line_max": 100,
"alpha_frac": 0.6129395218,
"autogenerated": false,
"ratio": 4.086206896551724,
"confi... |
"""All non private names (no leading underscore) here are part of the tox API.
They live in the tox namespace and can be accessed as tox.[NAMESPACE.]NAME
"""
import os
import re
import sys
_THIS_FILE = os.path.realpath(os.path.abspath(__file__))
class PYTHON:
PY_FACTORS_RE = re.compile("^(?!py$)(py|pypy|jython)... | {
"repo_name": "gaborbernat/tox",
"path": "src/tox/constants.py",
"copies": "2",
"size": "1972",
"license": "mit",
"hash": -1714734453821942500,
"line_mean": 29.3384615385,
"line_max": 88,
"alpha_frac": 0.5978701826,
"autogenerated": false,
"ratio": 3.175523349436393,
"config_test": false,
"ha... |
"""All non private names (no leading underscore) here are part of the tox API.
They live in the tox namespace and can be accessed as tox.[NAMESPACE.]NAME
"""
import re
import sys
def _construct_default_factors(cpython_versions, pypy_versions, other_interpreters):
default_factors = {"py": sys.executable, "py2": "... | {
"repo_name": "Avira/tox",
"path": "src/tox/constants.py",
"copies": "1",
"size": "2525",
"license": "mit",
"hash": -3817310658239025700,
"line_mean": 31.3717948718,
"line_max": 92,
"alpha_frac": 0.575049505,
"autogenerated": false,
"ratio": 3.3938172043010755,
"config_test": false,
"has_no_k... |
__all__ = [
'openvpn',
]
from pathlib import Path
import logging
from garage import apps
from garage import scripts
LOG = logging.getLogger(__name__)
@apps.with_prog('copy-client')
@apps.with_help('copy generated client data')
@apps.with_argument('cadir', type=Path, help='provide easy-rsa cadir')
@apps.with_a... | {
"repo_name": "clchiou/garage",
"path": "py/ops/ops/mob/openvpn.py",
"copies": "1",
"size": "3445",
"license": "mit",
"hash": -1464552997948908300,
"line_mean": 28.9565217391,
"line_max": 76,
"alpha_frac": 0.6040638607,
"autogenerated": false,
"ratio": 3.4142715559960357,
"config_test": false,
... |
__all__ = (
'OrionClient',
)
import json, logging, os, re, requests, socket, time, warnings
from datetime import datetime
__verify__=False
try:
import certifi
__verify__ = certifi.where(), # Path to the Certifi bundle.
except:
if os.path.isfile("/etc/ssl/certs/ca-certificates.crt"... | {
"repo_name": "openath/orion-python-client",
"path": "src/orionclient.py",
"copies": "1",
"size": "14597",
"license": "apache-2.0",
"hash": -2659943635836631000,
"line_mean": 35.9544303797,
"line_max": 139,
"alpha_frac": 0.4996232102,
"autogenerated": false,
"ratio": 4.365131578947368,
"config_... |
__all__ = ['normalize_baseline',
'normalize_spikes',
'moving_average']
import numpy as np
def normalize_baseline(signals, beta=1, epsilon=0.01,
mode='online', function=None):
if function is None:
function = np.sum
if mode == 'online':
norm_signals... | {
"repo_name": "norbert/hearsay",
"path": "hearsay/normalizations.py",
"copies": "1",
"size": "1348",
"license": "mit",
"hash": 2889178657685772000,
"line_mean": 28.9555555556,
"line_max": 84,
"alpha_frac": 0.5979228487,
"autogenerated": false,
"ratio": 3.613941018766756,
"config_test": false,
... |
__all__ = ('Notification')
from datetime import datetime
from pocketthrone.entities.enum import MessageImportancy, NotificationCategory
class Notification:
_id = -1
# properties defining unset type & category of this notification
importancy = None
category = None
# title & message content
title = "<untitled>... | {
"repo_name": "herrschr/prey-game",
"path": "pocketthrone/entities/notification.py",
"copies": "2",
"size": "1162",
"license": "bsd-2-clause",
"hash": 1006579319018396700,
"line_mean": 25.4090909091,
"line_max": 137,
"alpha_frac": 0.7375215146,
"autogenerated": false,
"ratio": 3.5753846153846154,... |
"""All notifications."""
ERR_NO_LOGIN = 0
NOTIF_LOGIN_STAFF = 1
NOTIF_LOGIN_STUDENT = 2
NOTIF_SETTING_UPDATED = 3
NOTIF_SETTING_ONE_TYPE = 4
NOTIF_INQUIRY_PLACED = 5
NOTIF_HELP_DONE = 6
notifications = {
ERR_NO_LOGIN: 'You are attempting to <b>disable both login methods</b> - '
'Google login and Default login... | {
"repo_name": "alvinwan/quupod",
"path": "quupod/notifications.py",
"copies": "2",
"size": "1166",
"license": "apache-2.0",
"hash": 6732502609909076000,
"line_mean": 42.1851851852,
"line_max": 78,
"alpha_frac": 0.6981132075,
"autogenerated": false,
"ratio": 3.303116147308782,
"config_test": fal... |
__all__ = ['Notifier']
# #############################################################################
# ########## Libraries #############
# ##################################
# standard library
from ctypes import *
# 3rd party module
from win10toast import ToastNotifier
# ##########################################... | {
"repo_name": "arunkumarpalaniappan/win10batteryoptimizer",
"path": "win10batteryoptimizer/__init__.py",
"copies": "1",
"size": "1927",
"license": "mit",
"hash": -6732947108844285000,
"line_mean": 34.0363636364,
"line_max": 88,
"alpha_frac": 0.5256875973,
"autogenerated": false,
"ratio": 4.566350... |
__all__ = [
'OutlineContinents',
'GlobeSource',
]
import numpy as np
import pyvista as pv
import vtk
from .. import interface
from ..base import AlgorithmBase
class OutlineContinents(AlgorithmBase):
"""A simple data source to produce a ``vtkEarthSource`` outlining the
Earth's continents. This works ... | {
"repo_name": "banesullivan/ParaViewGeophysics",
"path": "PVGeo/model_build/earth.py",
"copies": "1",
"size": "5033",
"license": "bsd-3-clause",
"hash": 3898846965213843000,
"line_mean": 32.7785234899,
"line_max": 86,
"alpha_frac": 0.5827538248,
"autogenerated": false,
"ratio": 3.700735294117647,... |
__all__ = (
'override_settings',
)
try:
from django.test.utils import override_settings
except ImportError:
# Back-port override_settings from Django 1.4
# https://github.com/django/django/blob/stable/1.4.x/django/test/utils.py
from django.conf import settings, UserSettingsHolder
from django.u... | {
"repo_name": "simpleenergy/djsailthru",
"path": "djsailthru/tests/utils.py",
"copies": "1",
"size": "2785",
"license": "mit",
"hash": -7606871024102275000,
"line_mean": 38.7857142857,
"line_max": 90,
"alpha_frac": 0.5587073609,
"autogenerated": false,
"ratio": 4.595709570957096,
"config_test":... |
__all__ = [
'PackedBinariesReader',
'MadagascarReader',
]
__displayname__ = 'Binary/Serialized File I/O'
import warnings
import numpy as np
import vtk
from .. import _helpers, interface
from ..base import ReaderBase
class PackedBinariesReader(ReaderBase):
"""This reads in float or double data that is ... | {
"repo_name": "banesullivan/ParaViewGeophysics",
"path": "PVGeo/readers/binaries.py",
"copies": "1",
"size": "7433",
"license": "bsd-3-clause",
"hash": -9131626530113603000,
"line_mean": 37.1179487179,
"line_max": 110,
"alpha_frac": 0.6056773846,
"autogenerated": false,
"ratio": 4.015667206915181... |
__all__ = [
'Parser',
'LineParser',
]
class Parser(object):
"""Abstract data parser"""
done = False
cache = ''
def clear(self):
"""Clears and returns current cache"""
data, self.cache = self.cache, ''
return data
def prepend(self, data):
"""Prepend ... | {
"repo_name": "snaury/kitsu.http",
"path": "kitsu/http/parsers.py",
"copies": "1",
"size": "2477",
"license": "mit",
"hash": -9059625923754811000,
"line_mean": 26.5222222222,
"line_max": 82,
"alpha_frac": 0.5151392814,
"autogenerated": false,
"ratio": 4.503636363636364,
"config_test": false,
... |
__all__ = [
'patch_getaddrinfo',
]
import functools
import socket
import threading
# Make an alias because we will monkey-patch it.
from socket import getaddrinfo as _getaddrinfo
from garage.collections import LruCache
class CachedGetaddrinfo:
"""Cache getaddrinfo result for a certain number for queries.""... | {
"repo_name": "clchiou/garage",
"path": "py/garage/garage/sockets.py",
"copies": "1",
"size": "1599",
"license": "mit",
"hash": 1472404502663211800,
"line_mean": 27.0526315789,
"line_max": 71,
"alpha_frac": 0.5428392745,
"autogenerated": false,
"ratio": 4.28686327077748,
"config_test": false,
... |
__all__ = [
'PJS'
]
def escape_value(value):
if type(value) in [str, unicode]:
value = '"{0}"'.format(value)
return value
class Attr(dict):
def __str__(self):
if self['namespace']:
return u'{namespace}.{attr_name}'.format(**self)
else:
return self... | {
"repo_name": "veeloox/ramen",
"path": "ramen/pjs.py",
"copies": "1",
"size": "4180",
"license": "apache-2.0",
"hash": 8469163223985016000,
"line_mean": 25.125,
"line_max": 122,
"alpha_frac": 0.5397129187,
"autogenerated": false,
"ratio": 3.7965485921889193,
"config_test": false,
"has_no_keyw... |
__all__ = [
'pods',
]
from pathlib import Path
import json
import logging
from garage import apps
from garage import scripts
from garage.assertions import ASSERT
from ops import models
from . import deps
from . import repos
LOG = logging.getLogger(__name__)
# Note that
# deploy_copy
# deploy_create_pod_m... | {
"repo_name": "clchiou/garage",
"path": "py/ops/ops/onboard/pods.py",
"copies": "1",
"size": "22475",
"license": "mit",
"hash": -3201115213704644000,
"line_mean": 29.6616643929,
"line_max": 77,
"alpha_frac": 0.6001779755,
"autogenerated": false,
"ratio": 3.727197346600332,
"config_test": false,... |
__all__ = [
'pods',
]
from pathlib import Path
import json
from garage import apps
from ops import models
@apps.with_prog('read-tag')
@apps.with_help('read tag in pod file')
@apps.with_argument(
'--suitable-for-filename', action='store_true',
help='transform tag value to be suitable for filename',
)
@a... | {
"repo_name": "clchiou/garage",
"path": "py/ops/ops/mob/pods.py",
"copies": "1",
"size": "1030",
"license": "mit",
"hash": -4897685150875935000,
"line_mean": 24.1219512195,
"line_max": 78,
"alpha_frac": 0.6524271845,
"autogenerated": false,
"ratio": 3.149847094801223,
"config_test": false,
"h... |
__all__ = [
'Poller',
'Polls',
# Poller implementations.
#
# TODO: Only epoll is supported as cross-platform is not priority.
'Epoll',
]
import enum
import errno
import math
import select
import threading
from typing import Sequence, Tuple, Union
from g1.bases.assertions import ASSERT
class ... | {
"repo_name": "clchiou/garage",
"path": "py/g1/asyncs/kernels/g1/asyncs/kernels/pollers.py",
"copies": "1",
"size": "3423",
"license": "mit",
"hash": -8486900153026107000,
"line_mean": 26.1666666667,
"line_max": 79,
"alpha_frac": 0.5889570552,
"autogenerated": false,
"ratio": 3.8986332574031892,
... |
__all__ = [
'POS_INF',
'NEG_INF',
'BoundType',
'IntegerInterval',
'parse',
]
import re
from enum import Enum
from garage.assertions import ASSERT
POS_INF = float('+inf')
NEG_INF = float('-inf')
class BoundType(Enum):
OPEN = 'OPEN'
CLOSED = 'CLOSED'
def __invert__(self):
if... | {
"repo_name": "clchiou/garage",
"path": "py/garage/garage/intervals.py",
"copies": "1",
"size": "4014",
"license": "mit",
"hash": 6651482846127976000,
"line_mean": 26.1216216216,
"line_max": 79,
"alpha_frac": 0.5742401594,
"autogenerated": false,
"ratio": 3.7867924528301886,
"config_test": fals... |
__all__ = (
"pre_init",
"post_init",
"pre_save",
"pre_save_post_validation",
"post_save",
"pre_delete",
"post_delete",
)
signals_available = False
try:
from blinker import Namespace
signals_available = True
except ImportError:
class Namespace:
def signal(self, name, do... | {
"repo_name": "MongoEngine/mongoengine",
"path": "mongoengine/signals.py",
"copies": "1",
"size": "1789",
"license": "mit",
"hash": 6367641472977445000,
"line_mean": 29.3220338983,
"line_max": 80,
"alpha_frac": 0.6193404136,
"autogenerated": false,
"ratio": 3.863930885529158,
"config_test": fal... |
__all__ = [
"ProtocolError",
"LocalProtocolError",
"RemoteProtocolError",
"validate",
"make_sentinel",
"bytesify",
]
class ProtocolError(Exception):
"""Exception indicating a violation of the HTTP/1.1 protocol.
This as an abstract base class, with two concrete base classes:
:exc:`... | {
"repo_name": "python-hyper/h11",
"path": "h11/_util.py",
"copies": "1",
"size": "4387",
"license": "mit",
"hash": 6638147678113622000,
"line_mean": 34.9590163934,
"line_max": 78,
"alpha_frac": 0.6838386141,
"autogenerated": false,
"ratio": 4.115384615384615,
"config_test": false,
"has_no_key... |
__all__ = [
'Publisher',
]
import logging
import nng
import nng.asyncs
from g1.asyncs.bases import queues
from g1.bases import classes
LOG = logging.getLogger(__name__)
class Publisher:
def __init__(self, queue, wiredata, *, drop_when_full=True):
self._queue = queue
self._wiredata = wired... | {
"repo_name": "clchiou/garage",
"path": "py/g1/messaging/g1/messaging/pubsub/publishers.py",
"copies": "1",
"size": "2045",
"license": "mit",
"hash": -5538128058392402000,
"line_mean": 27.8028169014,
"line_max": 74,
"alpha_frac": 0.5422982885,
"autogenerated": false,
"ratio": 4.081836327345309,
... |
__all__ = [
'PVGeoError',
'ErrorObserver',
'HiddenPrints',
]
import os
import re
import sys
class PVGeoError(Exception):
"""This is a custom error class for handling errors when proccessing on the
VTK pipeline. It makes the error messages easy to decipher in ParaView and
cleans the messages w... | {
"repo_name": "banesullivan/ParaViewGeophysics",
"path": "PVGeo/_helpers/errors.py",
"copies": "1",
"size": "3859",
"license": "bsd-3-clause",
"hash": 7504543315171796000,
"line_mean": 30.8925619835,
"line_max": 105,
"alpha_frac": 0.6079295154,
"autogenerated": false,
"ratio": 4.028183716075157,
... |
__all__ = [
'Q'
]
def operand_maker(operand):
def func(self, value):
return self.value({operand: value})
return func
def list_maker(operand):
def func(self, q):
if not isinstance(q, Query):
raise TypeError('Expected Query object, got: {}'.format(q))
return Query({op... | {
"repo_name": "veeloox/ramen",
"path": "ramen/db/query.py",
"copies": "1",
"size": "2713",
"license": "apache-2.0",
"hash": 3460813710402306000,
"line_mean": 27.2604166667,
"line_max": 126,
"alpha_frac": 0.5503133063,
"autogenerated": false,
"ratio": 3.6811397557666212,
"config_test": false,
... |
__all__ = [
'reader', 'writer',
]
from migrator_csv import CSVReader, CSVWriter
from migrator_json import JSONReader, JSONWriter
from migrator_couchdb import CouchdbReader, CouchdbWriter
from migrator_couchbase import CouchbaseReader, CouchbaseWriter
from migrator_dir import DirReader, DirWriter
from migrator_zip ... | {
"repo_name": "TOTVS/mdmpublic",
"path": "couchbase-cli/lib/python/couchbase/migrator/__init__.py",
"copies": "1",
"size": "1784",
"license": "bsd-2-clause",
"hash": 125794568742709490,
"line_mean": 29.2372881356,
"line_max": 63,
"alpha_frac": 0.6978699552,
"autogenerated": false,
"ratio": 3.3533... |
__all__ = [
'recvfile',
]
import contextlib
import http.client
import logging
import re
import socket
from g1.asyncs.bases import adapters
from g1.bases import loggings
from g1.bases import pools
from g1.bases.assertions import ASSERT
LOG = logging.getLogger(__name__)
_CHUNK_SIZE = 8192
_BUFFER_POOL = pools.Tim... | {
"repo_name": "clchiou/garage",
"path": "py/g1/http/clients/g1/http/clients/recvfiles.py",
"copies": "1",
"size": "7242",
"license": "mit",
"hash": -448979069576053700,
"line_mean": 28.3198380567,
"line_max": 76,
"alpha_frac": 0.5691797846,
"autogenerated": false,
"ratio": 4.063973063973064,
"c... |
__all__ = [
'register',
'type_strategy',
'new_registry',
]
import lollipop.types as lt
import lollipop.validators as lv
import lollipop.utils as lu
import hypothesis.strategies as hs
import hypothesis.extra.datetime as hsd
import inspect
import six
try:
import hypothesis_regex
except ImportError:
... | {
"repo_name": "maximkulkin/lollipop-hypothesis",
"path": "lollipop_hypothesis/strategy.py",
"copies": "1",
"size": "9474",
"license": "mit",
"hash": -4621665009658123000,
"line_mean": 31.7820069204,
"line_max": 84,
"alpha_frac": 0.6476673,
"autogenerated": false,
"ratio": 3.980672268907563,
"co... |
__all__ = [
'RegistryMixin',
'get',
'reset',
]
import logging
from collections import defaultdict
from iga.core import WriteOnceDict
from iga.error import IgaError
LOG = logging.getLogger(__name__)
LOG.addHandler(logging.NullHandler())
_REGISTRY = defaultdict(WriteOnceDict)
def get(namespace):
r... | {
"repo_name": "clchiou/iga",
"path": "iga/registry.py",
"copies": "1",
"size": "1132",
"license": "mit",
"hash": 792481317270191200,
"line_mean": 19.962962963,
"line_max": 63,
"alpha_frac": 0.6422261484,
"autogenerated": false,
"ratio": 3.5709779179810726,
"config_test": false,
"has_no_keywor... |
__all__ = [
'repr_object',
'str_value',
'get_schema_id',
'camel_to_lower_snake',
'camel_to_upper_snake',
'snake_to_lower_camel',
'dicts_get',
]
import re
from . import native
def repr_object(obj):
"""The default __repr__ implementation."""
cls = obj.__class__
return (
... | {
"repo_name": "clchiou/garage",
"path": "py/capnp/capnp/bases.py",
"copies": "1",
"size": "3113",
"license": "mit",
"hash": -4218830512741482500,
"line_mean": 25.6068376068,
"line_max": 77,
"alpha_frac": 0.6186957918,
"autogenerated": false,
"ratio": 3.2494780793319413,
"config_test": false,
... |
__all__ = [
'Request',
'RequestParser',
]
import re
from kitsu.http.errors import *
from kitsu.http.headers import Headers
from kitsu.http.parsers import LineParser
class Request(object):
def __init__(self, method="GET", target="/", version=(1,1), headers=(), body=None):
self.method = method
... | {
"repo_name": "snaury/kitsu.http",
"path": "kitsu/http/request.py",
"copies": "1",
"size": "2667",
"license": "mit",
"hash": -5490158163749073000,
"line_mean": 31.5243902439,
"line_max": 102,
"alpha_frac": 0.5519310086,
"autogenerated": false,
"ratio": 4.096774193548387,
"config_test": false,
... |
__all__ = [
'Response',
'ResponseParser',
]
from kitsu.http.errors import *
from kitsu.http.headers import Headers
from kitsu.http.parsers import LineParser
class Response(object):
def __init__(self, version=(1,1), code=200, phrase='OK', headers=(), body=None):
self.version = version
self.... | {
"repo_name": "snaury/kitsu.http",
"path": "kitsu/http/response.py",
"copies": "1",
"size": "2717",
"license": "mit",
"hash": -1713036753206793000,
"line_mean": 31.734939759,
"line_max": 105,
"alpha_frac": 0.5483989695,
"autogenerated": false,
"ratio": 4.043154761904762,
"config_test": false,
... |
__all__=[]
_rgb_files = [open('/tmp/rgb_debug.txt','w')]
import sys, time
_rgb_auto_flush=1
def rgb_time(offs=1):
t = time.time()
if offs: return t-_rgb_t0
return t
_rgb_t0=rgb_time(0)
def rgb_debug(*msg,**kwds):
msg = ' '.join(map(str,msg)) + '\n'
for f in _rgb_files:
f.write(msg)
i... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/576381_mad_debugging_using_builtin/recipe-576381.py",
"copies": "1",
"size": "3168",
"license": "mit",
"hash": 7865288659716538000,
"line_mean": 27.8,
"line_max": 93,
"alpha_frac": 0.5596590909,
"autogenerated": false,
"ratio": 3.078717201... |
__all__ = [
'RpcConnectionError',
'RpcError',
'Connector',
]
import contextlib
import functools
import logging
import pickle
from multiprocessing.connection import Client
from garage.assertions import ASSERT
LOG = logging.getLogger(__name__)
class RpcError(Exception):
pass
class RpcConnectionEr... | {
"repo_name": "clchiou/garage",
"path": "py/garage/garage/multiprocessing/client.py",
"copies": "1",
"size": "5176",
"license": "mit",
"hash": 6295408970142538000,
"line_mean": 28.4090909091,
"line_max": 79,
"alpha_frac": 0.5459814529,
"autogenerated": false,
"ratio": 4.150761828388132,
"config... |
__all__ = [
'RpcConnectionError',
'RpcError',
'python',
]
import contextlib
import logging
import os
import os.path
import random
import shutil
import subprocess
import tempfile
import time
import garage.multiprocessing.server
from garage.multiprocessing.client import Connector
from garage.multiprocessin... | {
"repo_name": "clchiou/garage",
"path": "py/garage/garage/multiprocessing/__init__.py",
"copies": "1",
"size": "2456",
"license": "mit",
"hash": 3500680503647709000,
"line_mean": 26.2888888889,
"line_max": 75,
"alpha_frac": 0.6486156352,
"autogenerated": false,
"ratio": 3.8922345483359746,
"con... |
__all__ = [
'Rule',
'RuleData',
'RuleFunc',
'RuleType',
]
import logging
from collections import namedtuple
import iga.context
import iga.filetype
import iga.precond
from iga.core import KeyedSets
from iga.fargparse import FuncArgsParser
from iga.registry import RegistryMixin
LOG = logging.getLogger... | {
"repo_name": "clchiou/iga",
"path": "iga/rule.py",
"copies": "1",
"size": "3714",
"license": "mit",
"hash": -2099060486041543000,
"line_mean": 25.5285714286,
"line_max": 68,
"alpha_frac": 0.584006462,
"autogenerated": false,
"ratio": 3.9892588614393127,
"config_test": false,
"has_no_keywords... |
__all__ = [
"Schedule",
"Season",
"Team",
"team_from_str"
]
class Season(object):
"""Data model of types of seasons"""
POST = 'POST'
PRE = 'PRE'
PRO = 'PRO'
REGULAR = 'REG'
class Schedule(object):
"""Data model of a season's week's schedule"""
def __init__(self, season, we... | {
"repo_name": "YuHChen/fantasy-football-picker",
"path": "ffpicker/data/models.py",
"copies": "1",
"size": "2101",
"license": "mit",
"hash": -3838611471386020000,
"line_mean": 22.3444444444,
"line_max": 82,
"alpha_frac": 0.5173726797,
"autogenerated": false,
"ratio": 2.9675141242937855,
"config... |
__all__ = [
'schema_cp2k_general_settings', 'schema_derivative_couplings', 'schema_single_points',
'schema_distribute_absorption_spectrum',
'schema_distribute_derivative_couplings',
'schema_distribute_single_points',
'schema_absorption_spectrum']
from numbers import Real
from schema import (And, O... | {
"repo_name": "felipeZ/nonAdiabaticCoupling",
"path": "nac/workflows/schemas.py",
"copies": "1",
"size": "7466",
"license": "mit",
"hash": -484774629108433100,
"line_mean": 28.864,
"line_max": 93,
"alpha_frac": 0.6707741763,
"autogenerated": false,
"ratio": 3.6348588120740017,
"config_test": fa... |
__all__ = [
'SchemaLoader',
]
import logging
from g1.bases import classes
from g1.bases import labels
from g1.bases.assertions import ASSERT
from . import _capnp
# pylint: disable=c-extension-no-member
from . import bases
#
# TODO: We expose classes and methods as needed for now; so don't expect
# them to be c... | {
"repo_name": "clchiou/garage",
"path": "py/g1/third-party/capnp/capnp/schemas.py",
"copies": "1",
"size": "13293",
"license": "mit",
"hash": 6981049713775603000,
"line_mean": 28.1513157895,
"line_max": 79,
"alpha_frac": 0.5884300008,
"autogenerated": false,
"ratio": 3.356818181818182,
"config_... |
__all__ = [
"serialize",
"deserialize"
]
__doc__ = "Interaction between Optizelle with JSON formatted files"
import numpy
import Optizelle.Exception
from Optizelle.Properties import *
class Extendable(object):
"""Allows a function to be extended"""
def __init__(self, fn):
self.fns = {}
... | {
"repo_name": "OptimoJoe/Optizelle",
"path": "src/python/Optizelle/json/Serialization.py",
"copies": "1",
"size": "2316",
"license": "bsd-2-clause",
"hash": -5691979469940897000,
"line_mean": 26.5714285714,
"line_max": 77,
"alpha_frac": 0.6424870466,
"autogenerated": false,
"ratio": 3.51975683890... |
__all__ = [
'Server',
]
import dataclasses
import logging
import nng
import nng.asyncs
from g1.bases import classes
from g1.bases.assertions import ASSERT
from . import utils
LOG = logging.getLogger(__name__)
class Server:
"""Expose an (asynchronous) application object on a socket.
This is a fairly ... | {
"repo_name": "clchiou/garage",
"path": "py/g1/messaging/g1/messaging/reqrep/servers.py",
"copies": "1",
"size": "5491",
"license": "mit",
"hash": -5754546632971647000,
"line_mean": 31.6845238095,
"line_max": 99,
"alpha_frac": 0.5760335094,
"autogenerated": false,
"ratio": 4.253292021688614,
"c... |
__all__ = [
'Session',
]
from . import bases
class Session:
"""Session.
For most use cases, this is your go-to choice. It supports local
cache, rate limit, retry, and priority (when given a priority
executor).
"""
def __init__(
self,
*,
executor=None,
nu... | {
"repo_name": "clchiou/garage",
"path": "py/g1/http/clients/g1/http/clients/clients.py",
"copies": "1",
"size": "1129",
"license": "mit",
"hash": -6673328851724814000,
"line_mean": 23.5434782609,
"line_max": 70,
"alpha_frac": 0.5987599646,
"autogenerated": false,
"ratio": 3.9337979094076654,
"c... |
__all__ = [
'Session',
'SessionError',
'Stream',
'StreamClosed',
# HTTP/2 entities
'Request',
'Response',
# HTTP/2 entity properties
'Method',
'Scheme',
'Status',
# Helpers
'get_library_version',
'make_ssl_context',
]
from http import HTTPStatus as Status # Rena... | {
"repo_name": "clchiou/garage",
"path": "py/http2/http2/__init__.py",
"copies": "1",
"size": "28903",
"license": "mit",
"hash": 7926566957729146000,
"line_mean": 33.4493444577,
"line_max": 83,
"alpha_frac": 0.5701484275,
"autogenerated": false,
"ratio": 3.940959912735206,
"config_test": false,
... |
__all__ = [
'set_storage',
'scalar',
]
import core
dtypes = ("float", "double", "int32", "int64")
def IM(dir, mode="read", msecs=500):
im = core.Im()
READ = "read"
WRITE = "write"
if mode == READ:
im.start_read_service(dir, msecs)
else:
im.start_write_service(dir, msecs)
... | {
"repo_name": "VisualDL/VisualDL",
"path": "visualdl/python/summary.py",
"copies": "1",
"size": "2418",
"license": "apache-2.0",
"hash": -5370777447925581000,
"line_mean": 22.0285714286,
"line_max": 72,
"alpha_frac": 0.5421836228,
"autogenerated": false,
"ratio": 3.680365296803653,
"config_test... |
__all__ = [
'SGeMSGridReader',
'WriteImageDataToSGeMS',
]
__displayname__ = 'SGeMS File I/O'
import re
import numpy as np
import pandas as pd
import vtk
from .. import _helpers, interface
from ..base import WriterBase
from .gslib import GSLibReader
class SGeMSGridReader(GSLibReader):
"""Generates ``vt... | {
"repo_name": "banesullivan/ParaViewGeophysics",
"path": "PVGeo/gslib/sgems.py",
"copies": "1",
"size": "6547",
"license": "bsd-3-clause",
"hash": -1227308266124074500,
"line_mean": 35.1712707182,
"line_max": 88,
"alpha_frac": 0.5904994654,
"autogenerated": false,
"ratio": 3.6822272215973,
"con... |
__all__ = [
'SignalQueue',
'uninstall_handlers',
]
import contextlib
import errno
import logging
import os
import signal
import struct
import threading
from garage.assertions import ASSERT
from garage.collections import SingletonMeta
from . import queues
from . import utils
LOG = logging.getLogger(__name__... | {
"repo_name": "clchiou/garage",
"path": "py/garage/garage/threads/signals.py",
"copies": "1",
"size": "4283",
"license": "mit",
"hash": -7653047591992971000,
"line_mean": 24.494047619,
"line_max": 76,
"alpha_frac": 0.5605883726,
"autogenerated": false,
"ratio": 4.0790476190476195,
"config_test"... |
__all__ = [
'SignalSource',
]
import signal
import socket
import threading
from g1.bases.assertions import ASSERT
from g1.bases.classes import SingletonMeta
from . import adapters
class SignalSource(metaclass=SingletonMeta):
"""Signal queue.
Python runtime implements a UNIX signal handler that writes ... | {
"repo_name": "clchiou/garage",
"path": "py/g1/asyncs/bases/g1/asyncs/bases/signals.py",
"copies": "1",
"size": "2630",
"license": "mit",
"hash": 1999074594452012000,
"line_mean": 33.1558441558,
"line_max": 71,
"alpha_frac": 0.6342205323,
"autogenerated": false,
"ratio": 3.7733142037302727,
"co... |
__all__ = [
'SlackHookHandler',
'EmailHandler',
'get_logger',
'log_exception',
'get_timed_rotating_logger',
'get_timed_rotating_file_handler',
'get_slack_hook_handler',
'get_email_handler',
'set_root_logger',
]
import logging
import functools
import logging.handlers
import autos.no... | {
"repo_name": "hans-t/autos",
"path": "autos/utils/logging.py",
"copies": "1",
"size": "3895",
"license": "mit",
"hash": 4417282178819656700,
"line_mean": 20.7597765363,
"line_max": 82,
"alpha_frac": 0.5833119384,
"autogenerated": false,
"ratio": 4.027921406411582,
"config_test": false,
"has_... |
__all__ = [
'Socket',
'device',
'terminate',
]
import curio
import curio.traps
from . import (
SocketBase,
errors,
terminate as _terminate,
)
from .constants import (
AF_SP,
AF_SP_RAW,
NN_DONTWAIT,
)
async def device(sock1, sock2=None):
"""Re-implement nn_device without threa... | {
"repo_name": "clchiou/garage",
"path": "py/nanomsg/nanomsg/curio.py",
"copies": "1",
"size": "5176",
"license": "mit",
"hash": -28893090306039348,
"line_mean": 26.0994764398,
"line_max": 79,
"alpha_frac": 0.5654945904,
"autogenerated": false,
"ratio": 3.7808619430241053,
"config_test": false,
... |
__all__ = [
'Socket',
]
import asyncio
from . import SocketBase
from . import errors
from .constants import AF_SP, NN_DONTWAIT
class FileDescriptorManager:
def __init__(self, fd, cb, add_watcher, remove_watcher):
self.fd = fd
self.cb = cb
self.add_watcher = add_watcher
self.... | {
"repo_name": "clchiou/garage",
"path": "py/nanomsg/nanomsg/asyncio.py",
"copies": "1",
"size": "3092",
"license": "mit",
"hash": 7563371100689004000,
"line_mean": 30.5510204082,
"line_max": 79,
"alpha_frac": 0.5352522639,
"autogenerated": false,
"ratio": 3.8601747815230962,
"config_test": fals... |
__all__ = [
'SocketServer',
]
import errno
import logging
from g1.asyncs.bases import servers
from g1.asyncs.bases import tasks
LOG = logging.getLogger(__name__)
LOG.addHandler(logging.NullHandler())
class SocketServer:
def __init__(self, socket, handler, max_connections=0):
self._socket = socket
... | {
"repo_name": "clchiou/garage",
"path": "py/g1/networks/servers/g1/networks/servers/__init__.py",
"copies": "1",
"size": "1686",
"license": "mit",
"hash": 3545811214640131600,
"line_mean": 29.1071428571,
"line_max": 69,
"alpha_frac": 0.5225385528,
"autogenerated": false,
"ratio": 4.41361256544502... |
__all__ = [
'split',
'mkNonce',
'checkTimestamp',
]
from openid import cryptutil
from time import strptime, strftime, gmtime, time
from calendar import timegm
import string
NONCE_CHARS = string.ascii_letters + string.digits
# Keep nonces for five hours (allow five hours for the combination of
# reque... | {
"repo_name": "harshita-gupta/Harvard-FRSEM-Catalog-2016-17",
"path": "flask/lib/python2.7/site-packages/openid/store/nonce.py",
"copies": "180",
"size": "2843",
"license": "mit",
"hash": 5846635125210840000,
"line_mean": 28.0102040816,
"line_max": 70,
"alpha_frac": 0.6581076328,
"autogenerated": f... |
__all__ = [
'split',
'mkNonce',
'checkTimestamp',
]
from openid import cryptutil
from time import strptime, strftime, gmtime, time
from calendar import timegm
import string
NONCE_CHARS = string.ascii_letters + string.digits
# Keep nonces for five hours (allow five hours for the combination of
# request t... | {
"repo_name": "arantebillywilson/python-snippets",
"path": "microblog/flask/lib/python3.5/site-packages/openid/store/nonce.py",
"copies": "5",
"size": "2843",
"license": "mit",
"hash": 1085158578616329100,
"line_mean": 27.1485148515,
"line_max": 70,
"alpha_frac": 0.6581076328,
"autogenerated": fals... |
__all__ = (
"StatusLine",
)
def prepare_text(text, max_len, elide_string, elide_point):
stext, _, _ = str(text).partition("\n")
stext = stext.replace("\t", " ")
if len(stext) > max_len:
lead_len = int(0.5 + elide_point * max_len - len(elide_string))
return "%s%s%s" % (
... | {
"repo_name": "yellcorp/dupescan",
"path": "dupescan/console.py",
"copies": "1",
"size": "1267",
"license": "mit",
"hash": -7575415903441616000,
"line_mean": 27.1555555556,
"line_max": 94,
"alpha_frac": 0.5414364641,
"autogenerated": false,
"ratio": 3.1994949494949494,
"config_test": false,
"... |
__all__ = (
'StreamReader', 'StreamWriter', 'StreamReaderProtocol',
'open_connection', 'start_server')
import socket
import sys
import warnings
import weakref
if hasattr(socket, 'AF_UNIX'):
__all__ += ('open_unix_connection', 'start_unix_server')
from . import coroutines
from . import events
from . impor... | {
"repo_name": "batermj/algorithm-challenger",
"path": "code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Lib/asyncio/streams.py",
"copies": "1",
"size": "27342",
"license": "apache-2.0",
"hash": -1643118778630089000,
"line_mean": 35.0712401055,
"line_max": 79,
"alpha_frac... |
__all__ = [
'Subscriber',
]
import logging
import nng
import nng.asyncs
from g1.asyncs.bases import queues
from g1.bases import classes
LOG = logging.getLogger(__name__)
class Subscriber:
def __init__(self, message_type, queue, wiredata, *, drop_when_full=True):
self._message_type = message_type
... | {
"repo_name": "clchiou/garage",
"path": "py/g1/messaging/g1/messaging/pubsub/subscribers.py",
"copies": "1",
"size": "2171",
"license": "mit",
"hash": 4826260640066627000,
"line_mean": 29.5774647887,
"line_max": 78,
"alpha_frac": 0.513127591,
"autogenerated": false,
"ratio": 4.215533980582524,
... |
__all__ = [
'supervisor',
]
import logging
from concurrent import futures
from garage.assertions import ASSERT
from garage.threads import actors
LOG = logging.getLogger(__name__)
@actors.OneShotActor.from_func
def supervisor(num_actors, start_new_actor):
"""A supervisor will always keep num_actors long-ru... | {
"repo_name": "clchiou/garage",
"path": "py/garage/garage/threads/supervisors.py",
"copies": "1",
"size": "1909",
"license": "mit",
"hash": -3202491229331243000,
"line_mean": 30.2950819672,
"line_max": 78,
"alpha_frac": 0.5683603981,
"autogenerated": false,
"ratio": 4.0020964360587,
"config_tes... |
__all__ = [
'TableToTimeGrid',
'ReverseImageDataAxii',
'TranslateGridOrigin',
]
__displayname__ = 'Transform'
import numpy as np
import vtk
from vtk.numpy_interface import dataset_adapter as dsa
from .. import _helpers, interface
from ..base import FilterBase
############################################... | {
"repo_name": "banesullivan/ParaViewGeophysics",
"path": "PVGeo/grids/transform.py",
"copies": "1",
"size": "14373",
"license": "bsd-3-clause",
"hash": -4742312895279404000,
"line_mean": 33.3031026253,
"line_max": 89,
"alpha_frac": 0.5238989772,
"autogenerated": false,
"ratio": 3.8256587702954485... |
__all__ = [
'Task',
]
import inspect
import logging
import sys
from g1.bases import classes
from g1.bases.assertions import ASSERT
from . import errors
from . import traps
LOG = logging.getLogger(__name__)
# Python 3.4 implements PEP 442 for safe ``__del__``.
ASSERT.greater_or_equal(sys.version_info, (3, 4))
... | {
"repo_name": "clchiou/garage",
"path": "py/g1/asyncs/kernels/g1/asyncs/kernels/tasks.py",
"copies": "1",
"size": "6511",
"license": "mit",
"hash": -5474747346646265000,
"line_mean": 32.0507614213,
"line_max": 77,
"alpha_frac": 0.5986791583,
"autogenerated": false,
"ratio": 4.343562374916611,
"... |
__all__ = [
'TaskQueue',
'tasklet',
]
import logging
from garage.assertions import ASSERT
from garage.threads import actors
from garage.threads import queues
LOG = logging.getLogger(__name__)
class TaskQueue(queues.ForwardingQueue):
"""A task queue (vs executor) is for scenarios that the number of
... | {
"repo_name": "clchiou/garage",
"path": "py/garage/garage/threads/tasklets.py",
"copies": "1",
"size": "2796",
"license": "mit",
"hash": -6043468516729608000,
"line_mean": 32.686746988,
"line_max": 72,
"alpha_frac": 0.6512875536,
"autogenerated": false,
"ratio": 4.1117647058823525,
"config_test... |
__all__ = [
'ballsave',
'ballsearch',
'drops'
'replay',
'scoredisplay',
'trough',
'osc'
]
from ballsave import *
from ballsearch import *
from drops import *
from replay import *
from scoredisplay import *
from trough import *
from osc import *
from ..game import Mode
class TransitionOutHelperMode(Mode):
def ... | {
"repo_name": "Curbfeeler/PinbotFromES",
"path": "procgame/modes/__init__.py",
"copies": "1",
"size": "1868",
"license": "mit",
"hash": 7331265064062237000,
"line_mean": 29.1290322581,
"line_max": 96,
"alpha_frac": 0.7184154176,
"autogenerated": false,
"ratio": 3.2318339100346023,
"config_test"... |
__all__ = [
"CLOEXEC",
"NONBLOCK",
"TIMER_ABSTIME",
"CLOCK_REALTIME",
"CLOCK_MONOTONIC",
"bufsize",
"timespec",
"itimerspec",
"create",
"settime",
"gettime",
"unpack",
]
import ctypes
import ctypes.util
import math
import os
import struct
CLOEXEC = 0o02000000
NONBLOCK = 0o00004000
TIM... | {
"repo_name": "tsavola/pytimerfd",
"path": "timerfd/__init__.py",
"copies": "1",
"size": "3092",
"license": "mit",
"hash": -3192443325448086500,
"line_mean": 21.4057971014,
"line_max": 116,
"alpha_frac": 0.680465718,
"autogenerated": false,
"ratio": 2.753339269813001,
"config_test": false,
"h... |
__all__ = (
'ConnectionLostError',
'RemoteAmpError',
'TooLongError',
'UnhandledCommandError',
'UnknownRemoteError',
)
class AmpError(Exception):
pass
class ConnectionLostError(Exception):
""" Connection Lost. """
def __init__(self, exc):
self.exception = exc
class RemoteAmpError(AmpError):
def __init... | {
"repo_name": "jonathanslenders/asyncio-amp",
"path": "asyncio_amp/exceptions.py",
"copies": "1",
"size": "1147",
"license": "bsd-2-clause",
"hash": 6254469819584584000,
"line_mean": 21.94,
"line_max": 77,
"alpha_frac": 0.6748038361,
"autogenerated": false,
"ratio": 3.688102893890675,
"config_t... |
__all__ = [
"Connection",
"ProtocolError",
"receive",
"send",
]
import asyncio
import gc
import struct
from . import core
class ProtocolError(Exception):
pass
class Connection:
def __init__(self, reader, writer):
self._peer = core.Peer()
self._reader = reader
self._writer = writer
def __enter__(self)... | {
"repo_name": "tsavola/tap",
"path": "tap/io.py",
"copies": "1",
"size": "1226",
"license": "bsd-2-clause",
"hash": 1131255553685374000,
"line_mean": 16.0277777778,
"line_max": 52,
"alpha_frac": 0.6688417618,
"autogenerated": false,
"ratio": 2.9400479616306954,
"config_test": false,
"has_no_k... |
__all__ = [
'Terminated',
'Unavailable',
'client',
'server',
]
import logging
import time
import curio
import nanomsg as nn
from garage import asyncs
from garage.assertions import ASSERT
from garage.asyncs import futures
from garage.asyncs import queues
LOG = logging.getLogger(__name__)
class Te... | {
"repo_name": "clchiou/garage",
"path": "py/garage/garage/asyncs/messaging/reqrep.py",
"copies": "1",
"size": "8257",
"license": "mit",
"hash": 4210575404394658300,
"line_mean": 32.4291497976,
"line_max": 76,
"alpha_frac": 0.5917403415,
"autogenerated": false,
"ratio": 4.480195333695062,
"confi... |
__all__ = [
'HTML5TreeBuilder',
]
import warnings
from bs4.builder import (
PERMISSIVE,
HTML,
HTML_5,
HTMLTreeBuilder,
)
from bs4.element import NamespacedAttribute
import html5lib
from html5lib.constants import namespaces
from bs4.element import (
Comment,
Doctype,
NavigableString,
Tag,
)
class HTML5Tree... | {
"repo_name": "colobas/gerador-horarios",
"path": "bs4/builder/_html5lib.py",
"copies": "1",
"size": "6730",
"license": "mit",
"hash": -246184191534504060,
"line_mean": 29.3153153153,
"line_max": 150,
"alpha_frac": 0.7230312036,
"autogenerated": false,
"ratio": 3.2829268292682925,
"config_test"... |
__all__ = [
'LXMLTreeBuilderForXML',
'LXMLTreeBuilder',
]
from io import BytesIO
from StringIO import StringIO
import collections
from lxml import etree
from bs4.element import Comment, Doctype, NamespacedAttribute
from bs4.builder import (
FAST,
HTML,
HTMLTreeBuilder,
PERMISSIVE,
TreeBuilder,
XML)
from bs4.d... | {
"repo_name": "colobas/gerador-horarios",
"path": "bs4/builder/_lxml.py",
"copies": "1",
"size": "6043",
"license": "mit",
"hash": 1043003929548628500,
"line_mean": 29.3668341709,
"line_max": 76,
"alpha_frac": 0.7099122952,
"autogenerated": false,
"ratio": 3.2212153518123667,
"config_test": fal... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.