text
stringlengths
0
1.05M
meta
dict
"""All models for the extension.""" from django.conf import settings from django.dispatch import receiver from django.db import models from model_utils.models import StatusModel, TimeStampedModel from geokey.projects.models import Project from .base import STATUS, FORMAT from .managers import WebResourceManager c...
{ "repo_name": "ExCiteS/geokey-webresources", "path": "geokey_webresources/models.py", "copies": "1", "size": "1612", "license": "mit", "hash": 1488738725783795200, "line_mean": 27.2807017544, "line_max": 76, "alpha_frac": 0.6892059553, "autogenerated": false, "ratio": 4.133333333333334, "config...
"""All models for the extension.""" import sys import json import csv from osgeo import ogr from django.conf import settings from django.dispatch import receiver from django.db import models from django.template.defaultfilters import slugify from django.contrib.postgres.fields import ArrayField from django.contrib.g...
{ "repo_name": "ExCiteS/geokey-dataimports", "path": "geokey_dataimports/models.py", "copies": "1", "size": "11423", "license": "mit", "hash": -5647674630128379000, "line_mean": 33.406626506, "line_max": 80, "alpha_frac": 0.5383874639, "autogenerated": false, "ratio": 4.919465977605513, "config_...
"""All models for the queue. Important: Changes here need to be followed by `make refresh`. """ from sqlalchemy import asc from sqlalchemy import desc from flask import current_app from werkzeug.local import LocalProxy from flask_debugtoolbar import DebugToolbarExtension from flask_sqlalchemy import SQLAlchemy from s...
{ "repo_name": "alvinwan/quupod", "path": "quupod/models.py", "copies": "2", "size": "28166", "license": "apache-2.0", "hash": 2107427806458085400, "line_mean": 32.4910820452, "line_max": 79, "alpha_frac": 0.578392388, "autogenerated": false, "ratio": 3.927216954824317, "config_test": false, "...
"""All models for the WeGovNow extension.""" import os from django.db.models.signals import pre_save, post_save from django.dispatch import receiver from geokey.core.models import get_class_name, cross_check_fields from geokey_wegovnow.base import LOG_MODELS, WATCHED_FIELDS from geokey_wegovnow.logger import make_e...
{ "repo_name": "ExCiteS/geokey-wegovnow", "path": "geokey_wegovnow/models.py", "copies": "1", "size": "2468", "license": "mit", "hash": -4216709030191537000, "line_mean": 35.2941176471, "line_max": 80, "alpha_frac": 0.5490275527, "autogenerated": false, "ratio": 4.647834274952919, "config_test":...
""" all models shared in tests class names should be unique across whole project """ from mongoengine import ( Document, DynamicDocument, DynamicEmbeddedDocument, EmbeddedDocument, fields ) class DumbDocument(Document): name = fields.StringField() foo = fields.IntField() class IntIdDocument(Document...
{ "repo_name": "umutbozkurt/django-rest-framework-mongoengine", "path": "tests/models.py", "copies": "2", "size": "1374", "license": "mit", "hash": -7786634229698272000, "line_mean": 23.5357142857, "line_max": 73, "alpha_frac": 0.711790393, "autogenerated": false, "ratio": 3.9710982658959537, "c...
__all__ = ('ModManager') import os import json from pocketthrone.managers.filemanager import FileManager from pocketthrone.managers.unitmanager import UnitManager from pocketthrone.managers.eventmanager import EventManager from pocketthrone.entities.event import * from pocketthrone.managers.pipe import L from pocket...
{ "repo_name": "herrschr/pocket-throne", "path": "pocketthrone/managers/modmanager.py", "copies": "2", "size": "3388", "license": "bsd-2-clause", "hash": -7578796371876426000, "line_mean": 29.25, "line_max": 93, "alpha_frac": 0.7042502952, "autogenerated": false, "ratio": 3.1168353265869366, "co...
__all__ = "Mod" from pocketthrone.managers.filemanager import FileManager class Mod: # engine identifiers _id = -1 _tag = "[Mod] " basename = None # entity strings name = None desc = "" desc_de = "" author = "" # entity flags is_initialized = False is_disabled = False is_empty = False def __init__(se...
{ "repo_name": "herrschr/prey-game", "path": "pocketthrone/entities/mod.py", "copies": "2", "size": "2138", "license": "bsd-2-clause", "hash": 1407042309772149500, "line_mean": 23.0224719101, "line_max": 112, "alpha_frac": 0.6697848457, "autogenerated": false, "ratio": 3.2344931921331317, "confi...
__all__ = ["Mofa"] import numpy as np import matplotlib.pyplot as pl from scipy.cluster.vq import kmeans from scipy.linalg import inv from matplotlib.patches import Ellipse from . import _algorithms class Mofa(object): """ Mixture of Factor Analyzers calling arguments: [ROSS DOCUMENT HERE] in...
{ "repo_name": "rossfadely/mofa", "path": "mofa/mofa.py", "copies": "1", "size": "11258", "license": "mit", "hash": 8948368724834086000, "line_mean": 30.3593314763, "line_max": 81, "alpha_frac": 0.5037306804, "autogenerated": false, "ratio": 3.406354009077156, "config_test": false, "has_no_key...
__all__ = ['MongoBackend', 'CachedMongoBackend'] import string from copy import copy from ..utils import randutils from ..utils.cacheutils import memoize_with_expiry from base import BaseBackend class MongoBackend(BaseBackend): ''' Implements a collection using a mongo database backend. ''' idFiel...
{ "repo_name": "colevscode/quickdata", "path": "quickdata/backends/mongo.py", "copies": "1", "size": "3198", "license": "mit", "hash": 3956779924346384000, "line_mean": 26.5689655172, "line_max": 78, "alpha_frac": 0.5769230769, "autogenerated": false, "ratio": 3.99250936329588, "config_test": fa...
__all__ = ['Monitor', 'get_monitor_files', 'load_results'] from gym.core import Wrapper import time from glob import glob import csv import os.path as osp import json class Monitor(Wrapper): EXT = "monitor.csv" f = None def __init__(self, env, filename, allow_early_resets=False, reset_keywords=(), info_k...
{ "repo_name": "openai/baselines", "path": "baselines/bench/monitor.py", "copies": "1", "size": "5741", "license": "mit", "hash": 1770098491501087000, "line_mean": 34.2208588957, "line_max": 174, "alpha_frac": 0.5688904372, "autogenerated": false, "ratio": 3.87643484132343, "config_test": false,...
__all__ = ['Monitor', 'get_monitor_files', 'load_results'] import csv import json import os import time from glob import glob from typing import Tuple, Dict, Any, List, Optional import gym import pandas import numpy as np class Monitor(gym.Wrapper): """ A monitor wrapper for Gym environments, it is used to ...
{ "repo_name": "hill-a/stable-baselines", "path": "stable_baselines/bench/monitor.py", "copies": "1", "size": "7798", "license": "mit", "hash": 6931061600118927000, "line_mean": 36.4903846154, "line_max": 120, "alpha_frac": 0.5846370864, "autogenerated": false, "ratio": 4.067814293166406, "confi...
__all__ = ['Monitor', 'get_monitor_files', 'load_results'] import gym from gym.core import Wrapper from os import path import time from glob import glob try: import ujson as json # Not necessary for monitor writing, but very useful for monitor loading except ImportError: import json class Monitor(Wrapper): ...
{ "repo_name": "learnercys/baselines", "path": "baselines/bench/monitor.py", "copies": "3", "size": "5053", "license": "mit", "hash": 9182285160155120000, "line_mean": 33.6095890411, "line_max": 174, "alpha_frac": 0.5711458539, "autogenerated": false, "ratio": 3.7374260355029585, "config_test": ...
__all__ = ['Monitor', 'get_monitor_files', 'load_results'] import gym from gym.core import Wrapper import time from glob import glob import csv import os.path as osp import json class Monitor(Wrapper): EXT = "monitor.csv" f = None def __init__(self, env, filename, allow_early_resets=False, reset_keywords...
{ "repo_name": "brain-research/mirage-rl-bpttv", "path": "baselines/bench/monitor.py", "copies": "1", "size": "4553", "license": "mit", "hash": 4052522776231246000, "line_mean": 36.0243902439, "line_max": 174, "alpha_frac": 0.5695146058, "autogenerated": false, "ratio": 3.845439189189189, "confi...
__all__ = ['montage2d'] import numpy as np from .. import exposure EPSILON = 1e-6 def montage2d(arr_in, fill='mean', rescale_intensity=False, grid_shape=None): """Create a 2-dimensional 'montage' from a 3-dimensional input array representing an ensemble of equally shaped 2-dimensional images. For examp...
{ "repo_name": "SamHames/scikit-image", "path": "skimage/util/montage.py", "copies": "3", "size": "3204", "license": "bsd-3-clause", "hash": 1939502593469311700, "line_mean": 28.1272727273, "line_max": 77, "alpha_frac": 0.534019975, "autogenerated": false, "ratio": 3.204, "config_test": false, ...
__all__ = ['montage2d'] import numpy as np from .. import exposure EPSILON = 1e-6 def montage2d(arr_in, fill='mean', rescale_intensity=False): """Create a 2-dimensional 'montage' from a 3-dimensional input array representing an ensemble of equally shaped 2-dimensional images. For example, montage2d(arr...
{ "repo_name": "emmanuelle/scikits.image", "path": "skimage/util/montage.py", "copies": "2", "size": "2613", "license": "bsd-3-clause", "hash": -8174177404243759000, "line_mean": 26.21875, "line_max": 76, "alpha_frac": 0.5545350172, "autogenerated": false, "ratio": 3.270337922403004, "config_tes...
__all__ = ["MonthBoxOffice"] import tushare as ts from flask import request,json from flask_restful import Resource def get_month_boxoffice(month=None): if month == None: result = ts.month_boxoffice().to_json() else: try: result = ts.month_boxoffice(month).to_json() except ...
{ "repo_name": "FinaceInfo/Chinese-box-office-info", "path": "api/boxoffice/month_boxoffice.py", "copies": "1", "size": "1040", "license": "mit", "hash": -7809324577735618000, "line_mean": 22.2972972973, "line_max": 103, "alpha_frac": 0.6357308585, "autogenerated": false, "ratio": 2.45584045584045...
__all__ = ["MouseEvent", \ "TouchEvent", \ "KeyEvent", \ "kPressedMouseEventType", \ "kReleasedMouseEventType", \ "kMovedMouseEventType", \ "kLeftMouseButton", \ "kMiddleMouseButton", \ "kRightMouseButton", \ "kNoneMouseB...
{ "repo_name": "PeterWangIntel/crosswalk-webdriver-python", "path": "browser/ui_events.py", "copies": "1", "size": "2339", "license": "bsd-3-clause", "hash": 6284396824353492000, "line_mean": 27.1807228916, "line_max": 90, "alpha_frac": 0.6524155622, "autogenerated": false, "ratio": 3.485842026825...
__all__ = ['MPI_allocator'] import os import commands import logging from openmdao.main.mp_support import OpenMDAO_Manager, register from openmdao.main.resource import FactoryAllocator, \ HOME_DIRECTORY, WORKING_DIRECTORY from openmdao.main.objserverfactory import ObjServer from ope...
{ "repo_name": "fzahle/MPI_allocator", "path": "src/mpiallocator/mpiallocator.py", "copies": "1", "size": "9866", "license": "apache-2.0", "hash": 4613777893670449000, "line_mean": 30.2215189873, "line_max": 89, "alpha_frac": 0.5450030407, "autogenerated": false, "ratio": 4.3196147110332745, "co...
__all__ = ['MultiLabelsFeatureSelector'] from .labels import MultiLabelsClassifier from ..utils import get_class_from_module_path import numpy as np class MultiLabelsFeatureSelector(MultiLabelsClassifier): def __init__(self, score_func=None, **kwargs): super(MultiLabelsClassifier, self).__init__(**kwarg...
{ "repo_name": "skylander86/ycml", "path": "ycml/classifiers/feature_selector.py", "copies": "1", "size": "1124", "license": "apache-2.0", "hash": -9061495526740382000, "line_mean": 29.3783783784, "line_max": 87, "alpha_frac": 0.6387900356, "autogenerated": false, "ratio": 3.2769679300291545, "c...
__all__ = ['mvee'] import math import numpy as np try: from scipy.spatial import ConvexHull except ImportError: def _getConvexHull(points): return points else: def _getConvexHull(points): hull = ConvexHull(points) return points[np.unique(hull.simplices)] def mvee(points, tol=1.e-4, ...
{ "repo_name": "manodeep/yymao-helpers", "path": "helpers/mvee.py", "copies": "1", "size": "2395", "license": "mit", "hash": 1497706374908923400, "line_mean": 31.8082191781, "line_max": 126, "alpha_frac": 0.5949895616, "autogenerated": false, "ratio": 3.1806108897742362, "config_test": false, ...
__all__ = ["n3_bias_field_correction", "n3_bias_field_correction2", "n4_bias_field_correction", "abp_n4"] from . import process_args as pargs from .get_mask import get_mask from .iMath import iMath from ..core import ants_image as iio from .. import utils def n3_bias_field_correction(image, downsample_factor=3): ...
{ "repo_name": "ANTsX/ANTsPy", "path": "ants/utils/bias_correction.py", "copies": "1", "size": "8509", "license": "apache-2.0", "hash": -2783060727474430500, "line_mean": 27.6498316498, "line_max": 203, "alpha_frac": 0.6198143143, "autogenerated": false, "ratio": 3.567714884696017, "config_test"...
__all__ = [ 'AbortHandshake', 'ConnectionClosed', 'DuplicateParameter', 'InvalidHandshake', 'InvalidHeader', 'InvalidHeaderFormat', 'InvalidHeaderValue', 'InvalidMessage', 'InvalidOrigin', 'InvalidParameterName', 'InvalidParameterValue', 'InvalidState', 'InvalidStatusCode', 'InvalidUpgrade', 'Invali...
{ "repo_name": "gnmiller/craig-bot", "path": "craig-bot/lib/python3.6/site-packages/websockets/exceptions.py", "copies": "1", "size": "5325", "license": "mit", "hash": 6457262638596644000, "line_mean": 24.7246376812, "line_max": 79, "alpha_frac": 0.6264788732, "autogenerated": false, "ratio": 4.43...
__all__ = [ 'AddCellConnToPoints', 'PointsToTube', 'LonLatToUTM', 'RotatePoints', 'ExtractPoints', 'RotationTool', 'ExtractCellCenters', 'AppendCellCenters', 'IterateOverPoints', 'ConvertUnits', 'BuildSurfaceFromPoints', ] __displayname__ = 'Point/Line Sets' from datetime i...
{ "repo_name": "banesullivan/ParaViewGeophysics", "path": "PVGeo/filters/xyz.py", "copies": "1", "size": "36851", "license": "bsd-3-clause", "hash": -6156719771944934000, "line_mean": 34.7083333333, "line_max": 101, "alpha_frac": 0.5500529158, "autogenerated": false, "ratio": 3.76414708886619, "...
__all__ = [ 'add_if_not_exists_clause', 'exactly_one', 'executing', 'one_or_none', 'scalar', ] import contextlib import sqlalchemy.engine from sqlalchemy.schema import CreateIndex from g1.bases.assertions import ASSERT def add_if_not_exists_clause(index, connectable): """Add "IF NOT EXISTS"...
{ "repo_name": "clchiou/garage", "path": "py/g1/databases/g1/databases/utils.py", "copies": "1", "size": "1638", "license": "mit", "hash": 5760225149889764000, "line_mean": 26.7627118644, "line_max": 72, "alpha_frac": 0.6746031746, "autogenerated": false, "ratio": 3.9375, "config_test": false, ...
__all__ = [ "AdsClient", "AdsConnection", "AdsDatatype", "AdsDevice", "AdsException", "AdsState", "amspacket", "AmsPacket", "BinaryParser", "SymbolInfo", "HexBlock", "AdsIO", "ProcImage" ] from pyads.symbolinfo import * from pyads.adsdatatype import * from pyads.adse...
{ "repo_name": "chwiede/pyads", "path": "pyads/__init__.py", "copies": "1", "size": "1278", "license": "mit", "hash": 6288976157838024000, "line_mean": 23.5961538462, "line_max": 73, "alpha_frac": 0.607198748, "autogenerated": false, "ratio": 3.435483870967742, "config_test": false, "has_no_ke...
__all__ = [ 'Agent', 'Connector', ] import re import sys import errno import base64 import socket import urlparse try: import ssl except ImportError: # if import _ssl in sll fails, then subsequent # import ssl statements would succeed # workaround that, so other modules have # a chance to d...
{ "repo_name": "snaury/kitsu.http", "path": "kitsu/http/client.py", "copies": "1", "size": "16465", "license": "mit", "hash": -9048164586709878000, "line_mean": 35.1074561404, "line_max": 158, "alpha_frac": 0.5551776496, "autogenerated": false, "ratio": 4.365058324496289, "config_test": false, ...
__all__ = ['nagios', 'json'] from check_delivery.timer import Timer class Output(object): def __init__(self, *args, **kwargs): super(Output, self).__init__(*args, **kwargs) self._status = None self._message = None self._details = None self._step = None self._expe...
{ "repo_name": "Leryan/check_delivery", "path": "check_delivery/output/__init__.py", "copies": "1", "size": "1523", "license": "mit", "hash": -71533911434968330, "line_mean": 19.0526315789, "line_max": 70, "alpha_frac": 0.5528562049, "autogenerated": false, "ratio": 4.27808988764045, "config_tes...
__all__ = [ 'AlertApi', ] class AlertApi(object): """ DEPRECATED: Used the methods in `MonitorApi` instead. """ def alert(self, query, name=None, message=None, silenced=False, notify_no_data=None, timeout_h=None): """ Create a new metric alert for the given *query*. If *name* i...
{ "repo_name": "DataDog/dogapi", "path": "src/dogapi/http/alerts.py", "copies": "1", "size": "3555", "license": "bsd-3-clause", "hash": 3993802941278999600, "line_mean": 30.7410714286, "line_max": 103, "alpha_frac": 0.558931083, "autogenerated": false, "ratio": 3.868335146898803, "config_test": ...
__all__ = [ 'AlertApi', ] class AlertApi(object): def alert(self, query, name=None, message=None, silenced=False, notify_no_data=None, timeout_h=None): """ Create a new metric alert for the given *query*. If *name* is unset, the alert will be given a name based on the query...
{ "repo_name": "edx/dogapi", "path": "src/dogapi/http/alerts.py", "copies": "1", "size": "3391", "license": "bsd-3-clause", "hash": 7665095326831591000, "line_mean": 30.1100917431, "line_max": 103, "alpha_frac": 0.5552934238, "autogenerated": false, "ratio": 3.884306987399771, "config_test": fal...
__all__ = [ 'alerts', ] from collections import namedtuple from pathlib import Path import contextlib import datetime import enum import fcntl import json import logging import os import re import selectors import subprocess import sys import urllib.error import urllib.request from garage import apps from garage ...
{ "repo_name": "clchiou/garage", "path": "py/ops/ops/onboard/alerts.py", "copies": "1", "size": "12867", "license": "mit", "hash": -1643927742996718800, "line_mean": 28.1108597285, "line_max": 76, "alpha_frac": 0.5539752856, "autogenerated": false, "ratio": 4.03480714957667, "config_test": true,...
__all__ = [ 'AlgorithmBase', 'ReaderBaseBase', 'ReaderBase', 'FilterBase', 'FilterPreserveTypeBase', 'TwoFileReaderBase', 'WriterBase', 'InterfacedBaseReader', ] __displayname__ = 'Base Classes' import warnings # Outside Imports: import vtk # NOTE: This is the first import executed ...
{ "repo_name": "banesullivan/ParaViewGeophysics", "path": "PVGeo/base.py", "copies": "1", "size": "25248", "license": "bsd-3-clause", "hash": -1424093899177424100, "line_mean": 34.7620396601, "line_max": 118, "alpha_frac": 0.5944233207, "autogenerated": false, "ratio": 4.304859335038363, "config...
__all__ = [ 'Aligner', 'PrefixComparer', 'SuffixComparer', 'hamming_sphere', 'hamming_environment', 'edit_environment', 'edit_distance', ] from typing import Iterator, Tuple from cutadapt._align import Aligner, PrefixComparer, SuffixComparer # flags for global alignment # The interpretat...
{ "repo_name": "marcelm/cutadapt", "path": "src/cutadapt/align.py", "copies": "1", "size": "6234", "license": "mit", "hash": 7054827613049480000, "line_mean": 30.4747474747, "line_max": 88, "alpha_frac": 0.542843389, "autogenerated": false, "ratio": 3.594002306805075, "config_test": false, "ha...
__all__ = ( 'allow_tags', 'humanized', 'filter_class', 'filter_by', 'order_by', 'sorter_class', ) def allow_tags(func): """Allows HTML tags to be returned from resource without escaping""" if isinstance(func, property): func = func.fget func.allow_tags = True return fun...
{ "repo_name": "druids/django-pyston", "path": "pyston/utils/decorators.py", "copies": "1", "size": "1840", "license": "bsd-3-clause", "hash": -701576403707325700, "line_mean": 25.2857142857, "line_max": 76, "alpha_frac": 0.6092391304, "autogenerated": false, "ratio": 4.088888888888889, "config_...
__all__ = ['NameVerDetectionError', 'Artifact', 'LocalArtifact', 'LocalRpmArtifact', 'RemoteArtifact'] import six.moves.urllib.parse import itertools import re import os import logging logger = logging.getLogger(__name__) class ArtifactError(Exception): pass class NameVerDetectionError(ArtifactError): pass...
{ "repo_name": "packagemgmt/repositorytools", "path": "repositorytools/lib/artifact.py", "copies": "2", "size": "4777", "license": "apache-2.0", "hash": -1681071178715789800, "line_mean": 34.1323529412, "line_max": 120, "alpha_frac": 0.5897006489, "autogenerated": false, "ratio": 4.338782924613987...
__all__ = [ 'AnimateTBM', ] import vtk from ..base import AlgorithmBase class AnimateTBM(AlgorithmBase): """This filter analyzes a vtkTable containing position information about a Tunnel Boring Machine (TBM). This Filter iterates over each row of the table as a timestep and uses the XYZ coordinates of the t...
{ "repo_name": "banesullivan/ParaViewGeophysics", "path": "PVGeo/tunneling/animate.py", "copies": "1", "size": "3253", "license": "bsd-3-clause", "hash": -5531578759989260000, "line_mean": 36.8255813953, "line_max": 285, "alpha_frac": 0.5976022133, "autogenerated": false, "ratio": 3.68820861678004...
__all__ = ( 'Annotation', 'InputAnnotation', 'Vars', #'WrapsMixin', #'InputWraps', 'InputFlush', 'Test', 'Inhibitor', 'OutputAnnotation', 'Expr', #'OutputWraps', 'OutputFlush', 'Flush', ) import abc import collections import itertools from .black_token import BlackT...
{ "repo_name": "simone-campagna/petra", "path": "petra/annotation.py", "copies": "1", "size": "8637", "license": "apache-2.0", "hash": 7436855474642049000, "line_mean": 30.4072727273, "line_max": 147, "alpha_frac": 0.6274169272, "autogenerated": false, "ratio": 4.433778234086242, "config_test": ...
__all__ = [ 'Anomaly', 'Bandit', 'Burst', 'Classifier', 'Clustering', 'NearestNeighbor', 'Recommender', 'Regression', 'Stat', 'Graph', 'Weight', ] class _EmbeddedUnavailable(object): def __init__(self, *args, **kwargs): raise RuntimeError('Embedded Jubatus Python...
{ "repo_name": "jubatus/jubatus-python-client", "path": "jubatus/embedded.py", "copies": "1", "size": "1234", "license": "mit", "hash": 118139915532590820, "line_mean": 28.380952381, "line_max": 78, "alpha_frac": 0.7155591572, "autogenerated": false, "ratio": 4.269896193771626, "config_test": fa...
__all__ = [ 'Application', 'HttpError', 'Request', 'Response', 'ResponseClosed', ] import collections.abc import dataclasses import enum import logging import typing import urllib.parse from g1.asyncs.bases import locks from g1.asyncs.bases import queues from g1.asyncs.bases import servers from g1...
{ "repo_name": "clchiou/garage", "path": "py/g1/webs/g1/webs/wsgi_apps.py", "copies": "1", "size": "14211", "license": "mit", "hash": -5161332765299994000, "line_mean": 29.6271551724, "line_max": 76, "alpha_frac": 0.6064316375, "autogenerated": false, "ratio": 4.113169319826339, "config_test": f...
__all__ = [ 'ArchiveTypes', 'Compressors', 'assert_command_exist', 'check_command_exist', 'export_path', 'get_url_path', 'guess_archive_type', 'guess_compressor', 'remove_archive_suffix', ] import enum import logging import os import shutil import urllib.parse from pathlib import Pa...
{ "repo_name": "clchiou/garage", "path": "py/g1/scripts/g1/scripts/utils.py", "copies": "1", "size": "2637", "license": "mit", "hash": 2980067654430274600, "line_mean": 24.3557692308, "line_max": 79, "alpha_frac": 0.6533940083, "autogenerated": false, "ratio": 3.3464467005076144, "config_test": ...
__all__ = [ 'arguments', 'example', 'keyword', 'seealso', 'table', 'underline' ] class Parser: def __init__(self, pctxt): self.pctxt = pctxt def parse(self, line): return line class PContext: def __init__(self, templates = None): self.set_content_list([]) ...
{ "repo_name": "cbonte/haproxy-dconv", "path": "parser/__init__.py", "copies": "1", "size": "1941", "license": "apache-2.0", "hash": -5776088203086298000, "line_mean": 22.962962963, "line_max": 71, "alpha_frac": 0.561566203, "autogenerated": false, "ratio": 3.828402366863905, "config_test": fals...
__all__ = [ 'ArrayMath', 'NormalizeArray', 'PercentThreshold', 'ArraysToRGBA', ] __displayname__ = 'Math Operations' import numpy as np import vtk from vtk.numpy_interface import dataset_adapter as dsa import pyvista as pv from .. import _helpers, interface from ..base import FilterBase, FilterPrese...
{ "repo_name": "banesullivan/ParaViewGeophysics", "path": "PVGeo/filters/math.py", "copies": "1", "size": "27308", "license": "bsd-3-clause", "hash": 2288933896356771800, "line_mean": 34.1907216495, "line_max": 84, "alpha_frac": 0.5700527318, "autogenerated": false, "ratio": 3.9485251590514747, ...
__all__ = [ 'Array', 'Context', 'GlobalContext', 'HandleScope', 'Isolate', 'JavaScriptError', 'Object', 'Script', 'UNDEFINED', 'UndefinedType', 'Value', 'from_python', 'to_python', 'run', 'shutdown', ] import atexit import collections.abc import logging # Di...
{ "repo_name": "clchiou/garage", "path": "py/g1/third-party/v8/v8/__init__.py", "copies": "1", "size": "2800", "license": "mit", "hash": -1627891428961286100, "line_mean": 24.4545454545, "line_max": 70, "alpha_frac": 0.6475, "autogenerated": false, "ratio": 3.830369357045144, "config_test": fals...
__all__ = [ 'ASSERT', 'Assertions', ] class Assertions: def __init__(self, exc_type): self._exc_type = exc_type def __call__(self, cond, message, *args): if not cond: raise self._exc_type(message % args) return cond def fail(self, message, *args): rai...
{ "repo_name": "clchiou/garage", "path": "py/garage/garage/assertions.py", "copies": "1", "size": "2548", "license": "mit", "hash": 8132271697843178000, "line_mean": 27, "line_max": 79, "alpha_frac": 0.5784929356, "autogenerated": false, "ratio": 3.92, "config_test": false, "has_no_keywords": ...
__all__ = [ 'AtomicInt', 'AtomicSet', 'Priority', 'generate_names', 'make_get_thread_local', 'set_pthread_name', ] import collections.abc import functools import logging import threading from garage.assertions import ASSERT LOG = logging.getLogger(__name__) class AtomicInt: def __init...
{ "repo_name": "clchiou/garage", "path": "py/garage/garage/threads/utils.py", "copies": "1", "size": "4652", "license": "mit", "hash": 2057758160163037200, "line_mean": 27.1939393939, "line_max": 74, "alpha_frac": 0.5902837489, "autogenerated": false, "ratio": 3.8669991687448046, "config_test": ...
__all__ = [ '__author__', '__author_email__', '__classifiers__', '__desc__', '__license__', '__package_name__', '__scripts__', '__team__', '__url__', '__version__', ] __author__ = 'Luke Powers' __author_email__ = 'luke.powers@openx.com' __classifiers__ = ['Development Status :: 4 - Beta', 'E...
{ "repo_name": "luke-powers/triconf", "path": "src/triconf/__about__.py", "copies": "1", "size": "1153", "license": "bsd-3-clause", "hash": -3862259556438485000, "line_mean": 40.1785714286, "line_max": 107, "alpha_frac": 0.5394622723, "autogenerated": false, "ratio": 3.7679738562091503, "config_...
__all__ = [ '__author__', '__classifiers__', '__desc__', '__license__', '__package_name__', '__scripts__', '__url__', '__version__', ] __author__ = 'Luke Powers' __author_email__ = 'luke-powers@users.noreply.github.com' # For more classifiers, see http://goo.gl/zZQaZ __classifiers__ = [ 'Development Status...
{ "repo_name": "luke-powers/NSCollector", "path": "src/nscollector/__about__.py", "copies": "1", "size": "1147", "license": "apache-2.0", "hash": 2738054058965365000, "line_mean": 29.1842105263, "line_max": 86, "alpha_frac": 0.5693112467, "autogenerated": false, "ratio": 3.383480825958702, "conf...
__all__ = [ 'AutoInitAndCloseable', 'Disposable', 'NoReentrantContext', 'DisposableContext', ] class AutoInitAndCloseable(object): """ Classes with :meth:`init()` to initialize its internal states, and also :meth:`close()` to destroy these states. The :meth:`init()` method can be repe...
{ "repo_name": "korepwx/tfsnippet", "path": "tfsnippet/utils/concepts.py", "copies": "1", "size": "3955", "license": "mit", "hash": 5872066902974685000, "line_mean": 28.0808823529, "line_max": 79, "alpha_frac": 0.5716814159, "autogenerated": false, "ratio": 4.479048697621744, "config_test": fals...
__all__ = ["NavigationTracker"] from status import * from devtools_event_listener import DevToolsEventListener # Tracks the navigation state of the page. class NavigationTracker(DevToolsEventListener): kUnknown = 0 kLoading = 1 kNotLoading = 2 def __init__(self, client, known_state=0): self.client = cli...
{ "repo_name": "PeterWangIntel/crosswalk-webdriver-python", "path": "browser/navigation_tracker.py", "copies": "1", "size": "6720", "license": "bsd-3-clause", "hash": 7160231154555095000, "line_mean": 45.993006993, "line_max": 86, "alpha_frac": 0.6808035714, "autogenerated": false, "ratio": 4.0653...
__all__ = [ 'BadRequestException', 'BadStateException', 'CsrfException', 'DropboxOAuth2Flow', 'DropboxOAuth2FlowNoRedirect', 'NotApprovedException', 'ProviderException', ] import base64 import os import six import sys import urllib from .dropbox import Dropbox from .session import pinned_s...
{ "repo_name": "ewjoachim/dropbox-sdk-python", "path": "dropbox/oauth.py", "copies": "1", "size": "16593", "license": "mit", "hash": 6121741112827093000, "line_mean": 36.2040358744, "line_max": 88, "alpha_frac": 0.6071837522, "autogenerated": false, "ratio": 4.304280155642023, "config_test": fal...
__all__ = [ 'ballsave', 'ballsearch', 'drops' 'replay', 'scoredisplay', 'scoredisplayhd' 'service', 'trough', 'OSC', 'dmdhelper', 'attract', 'tilt', 'switchmonitor', 'rgbshow' ] from ballsave import * from ballsearch import * from drops import * from replay import...
{ "repo_name": "mjocean/PyProcGameHD-SkeletonGame", "path": "procgame/modes/__init__.py", "copies": "1", "size": "2381", "license": "mit", "hash": 2914828939698002000, "line_mean": 29.9220779221, "line_max": 105, "alpha_frac": 0.6442671147, "autogenerated": false, "ratio": 3.827974276527331, "co...
__all__ = [ 'BaseDatadog', ] import os import logging import re import socket import time from contextlib import contextmanager from pprint import pformat try: import simplejson as json except ImportError: import json http_log = logging.getLogger('dd.dogapi.http') log = logging.getLogger('dd.dogapi') fr...
{ "repo_name": "DataDog/dogapi", "path": "src/dogapi/http/base.py", "copies": "2", "size": "8358", "license": "bsd-3-clause", "hash": 2502027126064669000, "line_mean": 36.3125, "line_max": 202, "alpha_frac": 0.5516870065, "autogenerated": false, "ratio": 4.35539343408025, "config_test": false, ...
__all__ = ( 'BaseForm', 'Form', ) class BaseForm(object): """ Base Form Class. Provides core behaviour like field construction, validation, and data and error proxying. """ def __init__(self, fields, prefix=''): """ :param fields: A dict or sequence of 2-tuples...
{ "repo_name": "BarcampBangalore/Barcamp-Bangalore-Android-App", "path": "gcm_flask/wtforms/form.py", "copies": "15", "size": "10228", "license": "apache-2.0", "hash": -6870739214644900000, "line_mean": 34.2689655172, "line_max": 113, "alpha_frac": 0.5913179507, "autogenerated": false, "ratio": 4....
__all__ = [ 'BASE_IMAGE_RELEASE_CODE_NAME', # Pod. 'PodConfig', 'generate_machine_name', 'generate_pod_id', 'validate_pod_id', 'validate_pod_name', 'validate_pod_version', # XAR. 'validate_xar_name', # App. 'validate_app_name', # Image. 'validate_image_id', 'v...
{ "repo_name": "clchiou/garage", "path": "py/g1/containers/g1/containers/models.py", "copies": "1", "size": "5857", "license": "mit", "hash": -5538121317481386000, "line_mean": 25.1473214286, "line_max": 75, "alpha_frac": 0.6003073246, "autogenerated": false, "ratio": 3.3430365296803655, "config...
__all__ = ( 'BasePlace', 'Place', ) from .node import BasePlace from .token_list import TokenList class Place(BasePlace): def __init__(self, name, *, net=None, tokens=None, token_type=None): super().__init__(name=name, net=net) self._tokens = None self.update(tokens=tokens, token_t...
{ "repo_name": "simone-campagna/petra", "path": "petra/place.py", "copies": "1", "size": "1186", "license": "apache-2.0", "hash": -3807733241480469000, "line_mean": 27.9268292683, "line_max": 105, "alpha_frac": 0.5809443508, "autogenerated": false, "ratio": 3.694704049844237, "config_test": fals...
__all__ = [ 'BaseSession', 'Request', 'Response', 'Sender', ] import functools import itertools import json import logging import urllib.parse import lxml.etree import requests import requests.adapters import requests.cookies import urllib3.exceptions import urllib3.util.ssl_ from g1.asyncs.bases imp...
{ "repo_name": "clchiou/garage", "path": "py/g1/http/clients/g1/http/clients/bases.py", "copies": "1", "size": "16547", "license": "mit", "hash": 6069847564674486000, "line_mean": 32.5638945233, "line_max": 77, "alpha_frac": 0.5799238533, "autogenerated": false, "ratio": 4.398458266879319, "conf...
__all__ = ( 'BaseTransition', 'Transition', ) import collections import itertools from .errors import AnnotationError from .expression import make_expression from .iterable import Iterable from .node import BaseTransition from .token_list import TokenList class Substitution(collections.OrderedDict): pas...
{ "repo_name": "simone-campagna/petra", "path": "petra/transition.py", "copies": "1", "size": "3240", "license": "apache-2.0", "hash": 844382075591611800, "line_mean": 31.0792079208, "line_max": 113, "alpha_frac": 0.5978395062, "autogenerated": false, "ratio": 4.396200814111262, "config_test": f...
__all__ = [ 'binnig_update', 'binning', 'uniform_mapping', 'greedy_max_entropy_mapping', 'almost_uniform_mapping' ] import numpy as np from .special import COUNT_T, RGB_T, RAW_T, BIN_T from .special import binning_rgb from .special import binning_raw from .utils import wrong_dtype_exception def binnig_up...
{ "repo_name": "yandexdataschool/crayimage", "path": "crayimage/imgutils/binning.py", "copies": "1", "size": "3078", "license": "mit", "hash": 308721026403810750, "line_mean": 27.7663551402, "line_max": 109, "alpha_frac": 0.6452241715, "autogenerated": false, "ratio": 3.0235756385068764, "config...
__all__ = [ 'BufferHandler', 'DirHandler', 'FileHandler', 'make_buffer_handler', 'make_dir_handler', 'make_file_handler', # Context. 'LOCAL_PATH', ] import mimetypes from g1.bases import labels from .. import consts from .. import wsgi_apps from . import composers from . import etags...
{ "repo_name": "clchiou/garage", "path": "py/g1/webs/g1/webs/handlers/files.py", "copies": "1", "size": "6805", "license": "mit", "hash": 1321641003932177400, "line_mean": 29.7918552036, "line_max": 77, "alpha_frac": 0.6240999265, "autogenerated": false, "ratio": 3.8598979013045946, "config_test...
__all__ = [ 'build_image', ] import contextlib import dataclasses import json import logging import tempfile from pathlib import Path import foreman from g1 import scripts from g1.bases.assertions import ASSERT from g1.containers import models as ctr_models from g1.containers import scripts as ctr_scripts impor...
{ "repo_name": "clchiou/garage", "path": "shipyard2/shipyard2/rules/images/build_image.py", "copies": "1", "size": "6975", "license": "mit", "hash": 46870623332532470, "line_mean": 30.995412844, "line_max": 109, "alpha_frac": 0.592688172, "autogenerated": false, "ratio": 3.560490045941807, "conf...
__all__ = [ 'Cache', 'NULL_CACHE', ] import collections import contextlib import dataclasses import hashlib import io import logging import random import shutil import tempfile import threading from pathlib import Path import g1.files from g1.bases import timers from g1.bases.assertions import ASSERT LOG = l...
{ "repo_name": "clchiou/garage", "path": "py/g1/files/g1/files/caches.py", "copies": "1", "size": "10465", "license": "mit", "hash": -7733741168624707000, "line_mean": 29.1585014409, "line_max": 76, "alpha_frac": 0.5855709508, "autogenerated": false, "ratio": 3.760330578512397, "config_test": fa...
__all__ = [ '_calculate_time_range', 'update_time_steps', 'get_requested_time', 'get_input_time_steps', 'get_combined_input_time_steps', ] import collections import numpy as np def _calculate_time_range(nt, dt=1.0): """Discretizes time range accoridng to step size ``dt`` in seconds""" re...
{ "repo_name": "banesullivan/ParaViewGeophysics", "path": "PVGeo/_helpers/timeseries.py", "copies": "1", "size": "4533", "license": "bsd-3-clause", "hash": -3240956809086617600, "line_mean": 34.6929133858, "line_max": 99, "alpha_frac": 0.6463710567, "autogenerated": false, "ratio": 3.8513169073916...
__all__ = [ 'category', 'entry', 'sequence', 'HD_InitialEntryMode' ] from category import * from entry import * from sequence import * from hd_initialentry import * import time import locale from .. import dmd def generate_highscore_frames(categories, width, height): """Utility function t...
{ "repo_name": "mjocean/PyProcGameHD-SkeletonGame", "path": "procgame/highscore/__init__.py", "copies": "1", "size": "1835", "license": "mit", "hash": -7657306159784471000, "line_mean": 35.7, "line_max": 103, "alpha_frac": 0.629972752, "autogenerated": false, "ratio": 4.068736141906873, "config_...
__all__ = ( 'Category', ) class Category(tuple): """ This type acts as tuple with one key difference - two instances of it are equal only when they have the same type. This allows you to easily mitigate collisions when using common types (like string) in a dict or as a Wiring :term:`specificat...
{ "repo_name": "msiedlarek/wiring", "path": "wiring/categories.py", "copies": "1", "size": "1412", "license": "apache-2.0", "hash": 8547945390414328000, "line_mean": 24.6727272727, "line_max": 79, "alpha_frac": 0.540368272, "autogenerated": false, "ratio": 4.189910979228487, "config_test": false...
__all__ = [ 'check_numpy', ] __displayname__ = 'Version Verifier' try: from ._helpers import PVGeoError except ImportError: PVGeoError = RuntimeError def check_numpy(alert='print'): """A method to check the active environment's version of NumPy for compatibility with PVGeo. Args: al...
{ "repo_name": "banesullivan/ParaViewGeophysics", "path": "PVGeo/version.py", "copies": "1", "size": "1027", "license": "bsd-3-clause", "hash": 2440664839277276700, "line_mean": 27.5277777778, "line_max": 213, "alpha_frac": 0.6192794547, "autogenerated": false, "ratio": 3.7481751824817517, "conf...
__all__ = [ 'ClientBase', ] import capnp from garage.asyncs import futures from garage.asyncs import queues from garage.asyncs.messaging import reqrep class ClientBase: """Abstract base class for implementing reqrep client.""" def _parse_response(self, request, response_message): """Parse respo...
{ "repo_name": "clchiou/garage", "path": "py/garage/garage/asyncs/messaging/utils.py", "copies": "1", "size": "1471", "license": "mit", "hash": -1604131539618571500, "line_mean": 27.8431372549, "line_max": 69, "alpha_frac": 0.5927940177, "autogenerated": false, "ratio": 4.214899713467049, "confi...
__all__ = [ 'Client', 'ServerTimeoutError', ] import logging import nng import nng.asyncs from g1.bases import classes from g1.bases import collections from g1.bases.assertions import ASSERT from . import utils LOG = logging.getLogger(__name__) # This is just an alias for now. ServerTimeoutError = nng.err...
{ "repo_name": "clchiou/garage", "path": "py/g1/messaging/g1/messaging/reqrep/clients.py", "copies": "1", "size": "2550", "license": "mit", "hash": -6277805485287667000, "line_mean": 27.3333333333, "line_max": 78, "alpha_frac": 0.6137254902, "autogenerated": false, "ratio": 3.811659192825112, "c...
__all__ = [ "CLOEXEC", "NONBLOCK", "ACCESS", "MODIFY", "ATTRIB", "CLOSE_WRITE", "CLOSE_NOWRITE", "CLOSE", "OPEN", "MOVED_FROM", "MOVED_TO", "MOVE", "CREATE", "DELETE", "DELETE_SELF", "MOVE_SELF", "UNMOUNT", "Q_OVERFLOW", "IGNORED", "ONLYDI...
{ "repo_name": "tsavola/pyinotify-basic", "path": "inotify/__init__.py", "copies": "1", "size": "4503", "license": "mit", "hash": -4917993005044944000, "line_mean": 19.9441860465, "line_max": 115, "alpha_frac": 0.5782811459, "autogenerated": false, "ratio": 3.153361344537815, "config_test": fals...
__all__ = [ 'cloudinit', ] from pathlib import Path import logging # Prefer ruamel.yaml over PyYAML. try: from ruamel.yaml import YAML import io _YAML = YAML() def yaml_dump(data): with io.StringIO() as output: _YAML.dump(data, output) return output.getvalue() ...
{ "repo_name": "clchiou/garage", "path": "py/ops/ops/mob/cloudinit.py", "copies": "1", "size": "5364", "license": "mit", "hash": -5575308496075629000, "line_mean": 29.3050847458, "line_max": 74, "alpha_frac": 0.6137211037, "autogenerated": false, "ratio": 3.701863354037267, "config_test": false,...
__all__ = [ 'cmd_build', 'cmd_release', 'cmd_unrelease', ] import json import logging from pathlib import Path import foreman from g1 import scripts from g1.bases import argparses from g1.bases.assertions import ASSERT import shipyard2 from . import repos REPO_ROOT_PATH = Path(__file__).parent.parent....
{ "repo_name": "clchiou/garage", "path": "shipyard2/shipyard2/releases/build.py", "copies": "1", "size": "5770", "license": "mit", "hash": 4848672242771401000, "line_mean": 25.5898617512, "line_max": 75, "alpha_frac": 0.6116117851, "autogenerated": false, "ratio": 3.230683090705487, "config_test...
__all__ = [ 'cmd_cleanup', ] import collections import logging import foreman from g1.bases import argparses from g1.bases.assertions import ASSERT from . import repos LOG = logging.getLogger(__name__) @argparses.begin_parser( 'cleanup', **argparses.make_help_kwargs('clean up build artifacts'), ) @ar...
{ "repo_name": "clchiou/garage", "path": "shipyard2/shipyard2/releases/cleanup.py", "copies": "1", "size": "4640", "license": "mit", "hash": 7606659219471721000, "line_mean": 29.3267973856, "line_max": 74, "alpha_frac": 0.6439655172, "autogenerated": false, "ratio": 3.4808702175543886, "config_t...
__all__ = [ 'cmd_init', 'get_repo_path', # Command-line arguments. 'grace_period_arguments', 'make_grace_period_kwargs', # App-specific helpers. 'chown_app', 'chown_root', 'make_dir', 'rsync_copy', 'setup_file', ] import logging import shutil from pathlib import Path from g...
{ "repo_name": "clchiou/garage", "path": "py/g1/containers/g1/containers/bases.py", "copies": "1", "size": "2931", "license": "mit", "hash": 5028007680462324000, "line_mean": 23.0245901639, "line_max": 75, "alpha_frac": 0.6236779256, "autogenerated": false, "ratio": 3.485136741973841, "config_te...
__all__ = [ 'columnar_arguments', 'make_columnar_kwargs', ] from g1.bases import argparses from g1.bases import functionals from g1.bases.assertions import ASSERT from . import Formats def columnar_arguments(columns, default_columns): return functionals.compose( argparses.argument( '...
{ "repo_name": "clchiou/garage", "path": "py/g1/texts/g1/texts/columns/argparses.py", "copies": "1", "size": "1483", "license": "mit", "hash": 5087140734717455000, "line_mean": 26.9811320755, "line_max": 78, "alpha_frac": 0.5387727579, "autogenerated": false, "ratio": 4.2250712250712255, "config...
__all__ = ( 'Column', 'TextColumn', 'NumberColumn', ) class Column(object): """Represents a single column of a table. ``verbose_name`` defines a display name for this column used for output. ``name`` is the internal name of the column. Normally you don't need to specify this, as the attribute tha...
{ "repo_name": "icomms/wqmanager", "path": "apps/django_tables/columns.py", "copies": "3", "size": "3196", "license": "bsd-3-clause", "hash": -326920432366089400, "line_mean": 39.4683544304, "line_max": 80, "alpha_frac": 0.6736545682, "autogenerated": false, "ratio": 4.457461645746164, "config_t...
__all__ = [ 'CombineTables', 'ReshapeTable', 'ExtractArray', 'SplitTableOnArray', 'AppendTableToCellData', ] __displayname__ = 'Table Operations' import numpy as np import vtk from vtk.numpy_interface import dataset_adapter as dsa import pyvista as pv from .. import _helpers, interface from ..ba...
{ "repo_name": "banesullivan/ParaViewGeophysics", "path": "PVGeo/filters/tables.py", "copies": "1", "size": "15362", "license": "bsd-3-clause", "hash": 5322099062648182000, "line_mean": 34.1533180778, "line_max": 88, "alpha_frac": 0.5621663846, "autogenerated": false, "ratio": 4.150770062145366, ...
__all__ = [ 'Command', ] class Command(object): """A GTP command. A GTP command contains: - An optional sequence number (used for matching up responses with commands) - A command name, e.g. 'genmove' - One or more arguments to the command, e.g. 'black' """ def __init__(self, seq...
{ "repo_name": "maxpumperla/betago", "path": "betago/gtp/command.py", "copies": "1", "size": "1284", "license": "mit", "hash": -4506880383006361600, "line_mean": 25.2040816327, "line_max": 76, "alpha_frac": 0.5755451713, "autogenerated": false, "ratio": 3.7876106194690267, "config_test": false, ...
__all__ = [ 'ComponentStore', ] from pathlib import Path import copy import hashlib import json import logging import requests import tempfile from typing import Callable, Iterable from . import _components as comp from .structures import ComponentReference from ._key_value_store import KeyValueStore _COMPONENT_...
{ "repo_name": "kubeflow/pipelines", "path": "sdk/python/kfp/components/_component_store.py", "copies": "1", "size": "13085", "license": "apache-2.0", "hash": 6916295595545179000, "line_mean": 42.3278145695, "line_max": 183, "alpha_frac": 0.6022927016, "autogenerated": false, "ratio": 4.3028609010...
__all__ = [ 'ComponentStore', ] from pathlib import Path import copy import requests from typing import Callable from . import _components as comp from .structures import ComponentReference class ComponentStore: def __init__(self, local_search_paths=None, url_search_prefixes=None): self.local_search_p...
{ "repo_name": "kubeflow/kfp-tekton-backend", "path": "sdk/python/kfp/components/_component_store.py", "copies": "1", "size": "6197", "license": "apache-2.0", "hash": -1577578450024795600, "line_mean": 43.2642857143, "line_max": 183, "alpha_frac": 0.6496691948, "autogenerated": false, "ratio": 4.3...
__all__ = [ 'compute_etag', 'compute_etag_from_file', 'maybe_raise_304', ] import hashlib import logging import re from .. import consts from .. import wsgi_apps LOG = logging.getLogger(__name__) _CHUNK_SIZE = 8192 def compute_etag(content): hasher = hashlib.md5() hasher.update(content) re...
{ "repo_name": "clchiou/garage", "path": "py/g1/webs/g1/webs/handlers/etags.py", "copies": "1", "size": "1787", "license": "mit", "hash": -4296764127639388000, "line_mean": 23.4794520548, "line_max": 72, "alpha_frac": 0.5987688864, "autogenerated": false, "ratio": 3.4103053435114505, "config_tes...
__all__ = [ 'ConnectionManager', ] import collections import contextlib import logging from g1.asyncs.bases import locks from g1.asyncs.bases import timers from g1.bases import assertions from g1.bases.assertions import ASSERT from g1.operations.databases.bases import interfaces LOG = logging.getLogger(__name__)...
{ "repo_name": "clchiou/garage", "path": "py/g1/operations/databases/servers/g1/operations/databases/servers/connections.py", "copies": "1", "size": "5880", "license": "mit", "hash": -1977415965759700700, "line_mean": 31.3076923077, "line_max": 78, "alpha_frac": 0.5964285714, "autogenerated": false,...
__all__ = [ "ConsulError", "ConflictError", "NotFound", "SupportDisabled", "TransactionError", "UnauthorizedError" ] class ConsulError(Exception): """Consul base error Attributes: value (Object): object of the error meta (Meta): meta of the error """ def __init...
{ "repo_name": "johnnoone/aioconsul", "path": "aioconsul/exceptions.py", "copies": "1", "size": "1964", "license": "bsd-3-clause", "hash": 3017824726051999000, "line_mean": 22.9512195122, "line_max": 75, "alpha_frac": 0.5809572301, "autogenerated": false, "ratio": 4.251082251082251, "config_test...
__all__ = [ 'ContextBase', 'DialerBase', 'Protocols', 'SocketBase', ] import ctypes import enum from g1.bases import classes from g1.bases.assertions import ASSERT from . import _nng from . import errors from . import options Protocols = enum.Enum( 'Protocols', [( name.upper(), ...
{ "repo_name": "clchiou/garage", "path": "py/g1/third-party/nng/nng/bases.py", "copies": "1", "size": "9827", "license": "mit", "hash": -4038693703162032000, "line_mean": 25.4878706199, "line_max": 79, "alpha_frac": 0.6151419558, "autogenerated": false, "ratio": 3.186446173800259, "config_test":...
__all__ = [ 'Context', ] import collections import collections.abc from . import classes from .assertions import ASSERT class Context(collections.abc.MutableMapping): """Context. This is just a thin wrapper of collections.ChainMap. """ def __init__(self, content=None, *, _context=None): ...
{ "repo_name": "clchiou/garage", "path": "py/g1/bases/g1/bases/contexts.py", "copies": "1", "size": "1609", "license": "mit", "hash": 3408155465053020000, "line_mean": 25.3770491803, "line_max": 71, "alpha_frac": 0.5978868863, "autogenerated": false, "ratio": 4.032581453634085, "config_test": fa...
__all__ = [ 'copy_exec', 'get_repo_path', 'get_zipapp_target_path', 'make_dir', 'set_dir_attrs', 'set_exec_attrs', 'set_file_attrs', ] import logging import shutil from pathlib import Path from g1.apps import parameters from g1.bases.assertions import ASSERT LOG = logging.getLogger(__name...
{ "repo_name": "clchiou/garage", "path": "py/g1/operations/cores/g1/operations/cores/bases.py", "copies": "1", "size": "1964", "license": "mit", "hash": 2235058019174360300, "line_mean": 21.5747126437, "line_max": 65, "alpha_frac": 0.616089613, "autogenerated": false, "ratio": 3.3175675675675675, ...
__all__ = [ "CorruptedMessage", "Stats", "UnexpectedCommand", "UnexpectedEOF", "UnknownCommand", "log", ] import logging import struct log = logging.getLogger("offhand") class UnexpectedEOF(Exception): def __init__(self): Exception.__init__(self, "Connection closed unexpectedly"...
{ "repo_name": "ninchat/offhand", "path": "python/offhand/__init__.py", "copies": "1", "size": "1817", "license": "bsd-2-clause", "hash": 5965481283021618000, "line_mean": 20.1279069767, "line_max": 86, "alpha_frac": 0.5613648872, "autogenerated": false, "ratio": 3.932900432900433, "config_test"...
__all__ = [ "create_ants_transform", "new_ants_transform", "read_transform", "write_transform", "transform_from_displacement_field", ] import os import numpy as np from . import ants_image as iio from . import ants_transform as tio from .. import utils def new_ants_transform( precision="floa...
{ "repo_name": "ANTsX/ANTsPy", "path": "ants/core/ants_transform_io.py", "copies": "1", "size": "9186", "license": "apache-2.0", "hash": 7761440627765396000, "line_mean": 26.0973451327, "line_max": 91, "alpha_frac": 0.6257348138, "autogenerated": false, "ratio": 3.93573264781491, "config_test": ...
__all__ = [ 'CreateEvenRectilinearGrid', 'CreateUniformGrid', 'CreateTensorMesh', ] __displayname__ = 'Grids' import numpy as np import vtk from .. import interface from ..base import AlgorithmBase def _makeSpatialCellData(nx, ny, nz): """Used for testing""" arr = np.fromfunction(lambda k, j, i...
{ "repo_name": "banesullivan/ParaViewGeophysics", "path": "PVGeo/model_build/grids.py", "copies": "1", "size": "12708", "license": "bsd-3-clause", "hash": 3741089605596108300, "line_mean": 35.1022727273, "line_max": 87, "alpha_frac": 0.5774315392, "autogenerated": false, "ratio": 3.484507814642171...
__all__ = ( 'create_graph', 'draw', ) import os import graphviz as gv def create_graph(net, *, name=None, format=None, engine=None): print(name, format) graph = gv.Digraph(name=name, format=format, engine=None) #graph.node_attr["charset"] = "UTF-8" #graph.node_attr["fillcolor"] = "#FFFFFF" ...
{ "repo_name": "simone-campagna/petra", "path": "petra/utils/graph.py", "copies": "1", "size": "1505", "license": "apache-2.0", "hash": 7612651568433648000, "line_mean": 32.4444444444, "line_max": 77, "alpha_frac": 0.6166112957, "autogenerated": false, "ratio": 3.4518348623853212, "config_test":...
__all__ = ['nCube','nCubeMesh','RegularCubeMesh'] from numpy import ndarray,array,asarray,rank,bitwise_xor,eye,hstack,vstack,arange,zeros from simplex import Simplex class RegularCubeMesh: """ A regular grid of hypercubes. Examples: # create a 2x2 cube mesh bitmap = ones((2,2),dtyp...
{ "repo_name": "pkuwwt/pydec", "path": "pydec/mesh/ncube.py", "copies": "6", "size": "3322", "license": "bsd-3-clause", "hash": -4973985097254441000, "line_mean": 25.7903225806, "line_max": 119, "alpha_frac": 0.5878988561, "autogenerated": false, "ratio": 3.6788482834994465, "config_test": false...
__all__ = [ 'customAxisTicks', 'resetAxisTicks', 'scaleAxis', 'setAxisLabelsFromBounds', ] import vtk def customAxisTicks(rng, axis=0, uniform=False): """Use to set custom axis ticks in the render view Args: rng (list(float)): A list or tuple of floats for the axis ticks axis...
{ "repo_name": "banesullivan/ParaViewGeophysics", "path": "pvmacros/vis/axes.py", "copies": "1", "size": "4099", "license": "bsd-3-clause", "hash": -2056325974394472000, "line_mean": 29.1397058824, "line_max": 80, "alpha_frac": 0.6391802879, "autogenerated": false, "ratio": 3.5924627519719543, "...
__all__ = [ 'DashApi', ] try: import simplejson as json except ImportError: import json class DashApi(object): def dashboard(self, dash_id): """ Return the dashboard with the given id. See the `dashboard API documentation <http://docs.datadoghq.com/api/#dashboard>`_ for the ...
{ "repo_name": "DataDog/dogapi", "path": "src/dogapi/http/dashes.py", "copies": "2", "size": "2573", "license": "bsd-3-clause", "hash": -477662402951493950, "line_mean": 31.5696202532, "line_max": 104, "alpha_frac": 0.5713175282, "autogenerated": false, "ratio": 4.288333333333333, "config_test":...
__all__ = [ 'DATABASE_PORT', 'DATABASE_PUBLISHER_PORT', # Database interface. 'DatabaseInterface', 'DatabaseRequest', 'DatabaseResponse', # Database watcher interface. 'DatabaseEvent', # Type aliases. 'Expiration', 'Key', 'LeaseId', 'Revision', 'TransactionId', ...
{ "repo_name": "clchiou/garage", "path": "py/g1/operations/databases/bases/g1/operations/databases/bases/interfaces.py", "copies": "1", "size": "14289", "license": "mit", "hash": 835693825143514100, "line_mean": 24.9328493648, "line_max": 74, "alpha_frac": 0.6164182238, "autogenerated": false, "ra...
__all__ = [ 'DatabaseServer', ] import collections import functools import logging import time import sqlalchemy from g1.asyncs.bases import tasks from g1.asyncs.bases import timers from g1.bases.assertions import ASSERT from g1.operations.databases.bases import interfaces from . import connections from . impor...
{ "repo_name": "clchiou/garage", "path": "py/g1/operations/databases/servers/g1/operations/databases/servers/servers.py", "copies": "1", "size": "9279", "license": "mit", "hash": 8730191180591167000, "line_mean": 32.0213523132, "line_max": 78, "alpha_frac": 0.5982325682, "autogenerated": false, "r...
__all__ = [ "dedent_block_string_value", "print_block_string", "get_block_string_indentation", ] def dedent_block_string_value(raw_string: str) -> str: """Produce the value of a block string from its parsed raw value. Similar to CoffeeScript's block string, Python's docstring trim or Ruby's s...
{ "repo_name": "graphql-python/graphql-core", "path": "src/graphql/language/block_string.py", "copies": "1", "size": "3198", "license": "mit", "hash": -6614283977143846000, "line_mean": 30.0485436893, "line_max": 79, "alpha_frac": 0.6138211382, "autogenerated": false, "ratio": 3.895249695493301, ...
__all__ = [ 'DEFAULT_FILTERS', 'DEFAULT_XAR_FILTERS', 'merge_image', ] import contextlib import logging import tempfile from pathlib import Path from g1 import scripts from g1.containers import models from g1.containers import scripts as ctr_scripts from . import utils LOG = logging.getLogger(__name__) ...
{ "repo_name": "clchiou/garage", "path": "shipyard2/shipyard2/rules/images/merge_image.py", "copies": "1", "size": "5627", "license": "mit", "hash": -3166568908898312000, "line_mean": 33.3109756098, "line_max": 78, "alpha_frac": 0.5997867425, "autogenerated": false, "ratio": 3.5323289391086, "co...
__all__ = [ 'DEFAULT_USER_AGENT', 'make_connection_pool_params_dict', 'make_params_dict', 'make_rate_limit', 'make_retry', ] from g1.apps import parameters from .. import policies DEFAULT_USER_AGENT = 'Mozilla/5.0' def make_params_dict( # Cache. cache_size=8, # Circuit breaker. ...
{ "repo_name": "clchiou/garage", "path": "py/g1/http/clients/g1/http/clients/parts/bases.py", "copies": "1", "size": "3262", "license": "mit", "hash": 5030547067880569000, "line_mean": 24.2868217054, "line_max": 78, "alpha_frac": 0.5533415083, "autogenerated": false, "ratio": 4.062266500622665, ...
__all__ = [ 'deleteDownstream', ] __displayname__ = 'Pipeline' def deleteDownstream(input_source=None): """Delete downstream filters for a given input source. If no input source provided, all filters on the pipeline will be deleted. Args: input_source (str): The name of the object on the pip...
{ "repo_name": "banesullivan/ParaViewGeophysics", "path": "pvmacros/pipeline.py", "copies": "1", "size": "1263", "license": "bsd-3-clause", "hash": 9080383847292226000, "line_mean": 29.8048780488, "line_max": 79, "alpha_frac": 0.5993665875, "autogenerated": false, "ratio": 4.048076923076923, "co...
__all__ = [ 'depends', 'config_fields', 'run' ] import glob import os depends = [ ] config_fields = { "locations": list, } def run(tracker): for location in tracker.config['locations']: tracker.run_job(job_clean, "Cleaning %s" % location, location) tracker.run_job(job_clean_no_remov...
{ "repo_name": "ammongit/ucr-class-map", "path": "scripts/target_clean.py", "copies": "1", "size": "1210", "license": "mit", "hash": 8210196982293180000, "line_mean": 22.2692307692, "line_max": 73, "alpha_frac": 0.5851239669, "autogenerated": false, "ratio": 3.6336336336336337, "config_test": fa...
__all__ = [ 'depends', 'config_fields', 'run' ] import glob import os depends = [ ] config_fields = { } def run(tracker): for location in ('js', 'tests'): tracker.run_job(job_clean, "Cleaning %s" % location, location) tracker.run_job(job_clean_no_remove_regex, "Cleaning regex", "regex")...
{ "repo_name": "BradleyCai/ucr-schedule-visualizer", "path": "scripts/target_clean.py", "copies": "2", "size": "1177", "license": "mit", "hash": 6005885149075181000, "line_mean": 21.2075471698, "line_max": 73, "alpha_frac": 0.577740017, "autogenerated": false, "ratio": 3.599388379204893, "config...
__all__ = [ 'depends', 'config_fields', 'run', ] import random depends = [ # Specify dependencies here. Each of these is a target # as specified in a target_* file. ] config_fields = { # Settings can be passed to a target as a JSON file # Specify the types of each field here # If thi...
{ "repo_name": "ammongit/ucr-class-map", "path": "scripts/target_sample.py", "copies": "1", "size": "1186", "license": "mit", "hash": 3373570609063107000, "line_mean": 25.3555555556, "line_max": 71, "alpha_frac": 0.6374367622, "autogenerated": false, "ratio": 3.4080459770114944, "config_test": f...
__all__ = [ 'depends', 'config_fields', 'run', ] """ The purpose of this target is to 'compile' the regular expressions found in the regex/ directory and inject them into their respective Javascript sources in the js/ directory. This is done by invoking a Python script in regex/ that combines multiple *.re...
{ "repo_name": "ammongit/ucr-class-map", "path": "scripts/target_build.py", "copies": "1", "size": "7049", "license": "mit", "hash": -995953861065559800, "line_mean": 31.3348623853, "line_max": 127, "alpha_frac": 0.6033479926, "autogenerated": false, "ratio": 3.9139367018323155, "config_test": t...