text
stringlengths
0
1.05M
meta
dict
from dvc import utils from dvc.fs.local import LocalFileSystem def test_file_md5_crlf(tmp_dir): fs = LocalFileSystem() tmp_dir.gen("cr", b"a\nb\nc") tmp_dir.gen("crlf", b"a\r\nb\r\nc") assert utils.file_md5("cr", fs) == utils.file_md5("crlf", fs) def test_dict_md5(): d = { "cmd": "python...
{ "repo_name": "efiop/dvc", "path": "tests/func/test_utils.py", "copies": "1", "size": "1139", "license": "apache-2.0", "hash": -4824718057038003000, "line_mean": 24.8863636364, "line_max": 75, "alpha_frac": 0.4591747147, "autogenerated": false, "ratio": 3.029255319148936, "config_test": false, ...
from dvc import utils def test_file_md5_crlf(tmp_dir): tmp_dir.gen("cr", b"a\nb\nc") tmp_dir.gen("crlf", b"a\r\nb\r\nc") assert utils.file_md5("cr")[0] == utils.file_md5("crlf")[0] def test_dict_md5(): d = { "cmd": "python code.py foo file1", "locked": "true", "outs": [ ...
{ "repo_name": "dmpetrov/dataversioncontrol", "path": "tests/func/test_utils.py", "copies": "1", "size": "1069", "license": "apache-2.0", "hash": -4954493157809188000, "line_mean": 24.4523809524, "line_max": 75, "alpha_frac": 0.438727783, "autogenerated": false, "ratio": 2.977715877437326, "conf...
from dvc.logger import logger from dvc.utils.compat import str import os import yaml import shutil import filecmp import getpass import posixpath from subprocess import Popen, PIPE import boto3 import uuid import paramiko from google.cloud import storage as gc from flaky.flaky_decorator import flaky from dvc.main im...
{ "repo_name": "dataversioncontrol/dvc", "path": "tests/test_repro.py", "copies": "1", "size": "41514", "license": "apache-2.0", "hash": 5277854249803676000, "line_mean": 28.3592644979, "line_max": 79, "alpha_frac": 0.5516934046, "autogenerated": false, "ratio": 3.561599176389842, "config_test":...
from dvc.main import main from tests.basic_env import TestDvc from tests.test_repro import TestRepro, TestReproChangedDeepData import os class TestPipelineShowSingle(TestDvc): def setUp(self): super(TestPipelineShowSingle, self).setUp() self.stage = "foo.dvc" self.dotFile = "graph.dot" ...
{ "repo_name": "dataversioncontrol/dvc", "path": "tests/test_pipeline.py", "copies": "1", "size": "8038", "license": "apache-2.0", "hash": 1242128537849734700, "line_mean": 28.1231884058, "line_max": 79, "alpha_frac": 0.5357053994, "autogenerated": false, "ratio": 3.6939338235294117, "config_tes...
from dvc.parsing import DataResolver, EntryDefinition, ForeachDefinition from dvc.parsing.context import Context TEMPLATED_DVC_YAML_DATA = { "stages": { "stage1": { "cmd": "python script.py ${dict.foo} --out ${dict.bar}", "outs": ["${dict.bar}"], "deps": ["${dict.foo}"],...
{ "repo_name": "efiop/dvc", "path": "tests/func/parsing/__init__.py", "copies": "1", "size": "1428", "license": "apache-2.0", "hash": 8130236260481851000, "line_mean": 25.4444444444, "line_max": 77, "alpha_frac": 0.5210084034, "autogenerated": false, "ratio": 3.2528473804100226, "config_test": f...
from dvc.path.data_item import DataItem class StatedDataItem(DataItem): STATUS_UNTRACKED = '?' STATUS_DELETE = 'D' STATUS_MODIFIED = 'M' STATUS_TYPE_CHANGED = 'T' def __init__(self, state, data_file, git, config, cache_file=None): super(StatedDataItem, self).__init__(data_file, git, confi...
{ "repo_name": "ophiry/dvc", "path": "dvc/path/stated_data_item.py", "copies": "1", "size": "1064", "license": "apache-2.0", "hash": -6137785734417080000, "line_mean": 26.2820512821, "line_max": 80, "alpha_frac": 0.625, "autogenerated": false, "ratio": 3.5115511551155114, "config_test": false, ...
from dvcs import DVCS from subprocess import Popen, PIPE class Git(DVCS): def save_draft(self, message=None): self.commit(message or "Saved via clyde.") self.push(self.draft_branch) def add_file(self, path, message=None): cmd = Popen('git add "%s"' % path, ...
{ "repo_name": "sjl/hyde", "path": "repos/git.py", "copies": "54", "size": "2145", "license": "mit", "hash": -8089011222007240000, "line_mean": 35.3728813559, "line_max": 94, "alpha_frac": 0.5291375291, "autogenerated": false, "ratio": 4.181286549707602, "config_test": false, "has_no_keywords"...
from dvc.utils.collections import apply_diff class MyDict(dict): pass class MyInt(int): pass def test_apply_diff_is_inplace(): dest = MyDict() dest.attr = 42 apply_diff({}, dest) assert type(dest) is MyDict, "Preserves class" assert dest.attr == 42, "Preserves custom attrs" def test...
{ "repo_name": "dmpetrov/dataversioncontrol", "path": "tests/unit/utils/test_collections.py", "copies": "1", "size": "1029", "license": "apache-2.0", "hash": 2490235817818141700, "line_mean": 20, "line_max": 62, "alpha_frac": 0.5762876579, "autogenerated": false, "ratio": 3.118181818181818, "con...
from dvhb_hybrid.amodels import method_connect_once class MPTTMixin: """ Add methods to work with models based on django MPTT model (https://github.com/django-mptt/django-mptt) See also: https://www.sitepoint.com/hierarchical-data-database/ """ parent_key = 'parent_id' # TODO: take it from djan...
{ "repo_name": "dvhbru/dvhb-hybrid", "path": "dvhb_hybrid/amodels/mptt_mixin.py", "copies": "1", "size": "8129", "license": "mit", "hash": 8946347415787624000, "line_mean": 38.4611650485, "line_max": 107, "alpha_frac": 0.6086849551, "autogenerated": false, "ratio": 3.758206195099399, "config_tes...
from dvhb_hybrid import utils from dvhb_hybrid.amodels import Model, method_connect_once from django.contrib.contenttypes.models import ContentType from .enums import UserActionLogEntryType, UserActionLogEntrySubType, UserActionLogStatus class BaseUserActionLogEntry(Model): """ Abstract action log entry async...
{ "repo_name": "dvhbru/dvhb-hybrid", "path": "dvhb_hybrid/user_action_log/base_amodels.py", "copies": "1", "size": "6798", "license": "mit", "hash": -2557521880613084700, "line_mean": 36.1475409836, "line_max": 126, "alpha_frac": 0.6231244484, "autogenerated": false, "ratio": 4.299810246679317, ...
from dwarf.core.controller import CoreController from .models import UserInfo import time core = CoreController() class UtilitiesController: def calculate_utc_offset(local_time): """Calculates UTC offset using local time. Let's pretend this works as intended... Parameters ...
{ "repo_name": "Dwarf-Community/Dwarf-Utilities", "path": "controllers.py", "copies": "1", "size": "1857", "license": "mit", "hash": 4368041005567326000, "line_mean": 27.5692307692, "line_max": 90, "alpha_frac": 0.5406569736, "autogenerated": false, "ratio": 4.328671328671328, "config_test": fal...
from dwarfsquad.lib.compat import join_dicts from dwarfsquad.model.BaseWebModel import BaseWebModel from dwarfsquad.model.ChromatogramMethod import ChromatogramMethod from dwarfsquad.model.Calibration import Calibration class CompoundMethod(BaseWebModel): required_fields = { "name": "", "id": "", ...
{ "repo_name": "whereskenneth/Dwarfsquad", "path": "dwarfsquad/model/CompoundMethod.py", "copies": "1", "size": "1330", "license": "mit", "hash": 4999057239890577000, "line_mean": 30.6666666667, "line_max": 104, "alpha_frac": 0.6436090226, "autogenerated": false, "ratio": 3.8439306358381504, "co...
from dwarfsquad.lib.compat import join_dicts from dwarfsquad.model.BaseWebModel import BaseWebModel from dwarfsquad.model.ReductionMethod import ReductionMethod from dwarfsquad.model.PeakIntegration import PeakIntegration class ChromatogramMethod(BaseWebModel): required_fields = { "name": "", "id"...
{ "repo_name": "whereskenneth/Dwarfsquad", "path": "dwarfsquad/model/ChromatogramMethod.py", "copies": "1", "size": "1447", "license": "mit", "hash": -8192334721702542000, "line_mean": 31.8863636364, "line_max": 73, "alpha_frac": 0.6641326883, "autogenerated": false, "ratio": 3.9972375690607733, ...
from dwarfsquad.lib.compat import join_dicts from dwarfsquad.model.BaseWebModel import BaseWebModel from dwarfsquad.model.RetentionTime import RetentionTime from dwarfsquad.model.Smoothing import Smoothing from dwarfsquad.model.Threshold import Threshold class PeakIntegration(BaseWebModel): required_fields = { ...
{ "repo_name": "whereskenneth/Dwarfsquad", "path": "dwarfsquad/model/PeakIntegration.py", "copies": "1", "size": "1630", "license": "mit", "hash": -9094565142045026000, "line_mean": 32.2653061224, "line_max": 76, "alpha_frac": 0.6674846626, "autogenerated": false, "ratio": 3.908872901678657, "co...
from dwarfsquad.lib.compat import join_dicts from dwarfsquad.model.BaseWebModel import BaseWebModel class Calibration(BaseWebModel): required_fields = { "enabled": False, "degree": "linear", "weighting": "none", "origin": "ignore", "responses": [], "normalizers": []...
{ "repo_name": "whereskenneth/Dwarfsquad", "path": "dwarfsquad/model/Calibration.py", "copies": "1", "size": "1802", "license": "mit", "hash": -2549218998091720000, "line_mean": 30.6140350877, "line_max": 109, "alpha_frac": 0.5849056604, "autogenerated": false, "ratio": 3.9604395604395606, "conf...
from dwarfsquad.lib.compat import join_dicts from dwarfsquad.model.BaseWebModel import BaseWebModel class DisplaySettings(BaseWebModel): required_fields = { 'peak_area_format': 'decimal_format', 'concentration_format': 'decimal_format', 'response_format': 'decimal_format', 'review...
{ "repo_name": "whereskenneth/Dwarfsquad", "path": "dwarfsquad/model/DisplaySettings.py", "copies": "1", "size": "1562", "license": "mit", "hash": -3629649456433969700, "line_mean": 35.3255813953, "line_max": 77, "alpha_frac": 0.628681178, "autogenerated": false, "ratio": 4.005128205128205, "con...
from dwarfsquad.lib.compat import join_dicts from dwarfsquad.model.BaseWebModel import BaseWebModel class QaRuleSchema(BaseWebModel): required_fields = { "name": "", "display_name": "", "description": "", "rule_parameters": [] } @classmethod def __str__(cls): r...
{ "repo_name": "whereskenneth/Dwarfsquad", "path": "dwarfsquad/model/QaRuleSchema.py", "copies": "1", "size": "1301", "license": "mit", "hash": -4838753989209849000, "line_mean": 26.1041666667, "line_max": 92, "alpha_frac": 0.5849346656, "autogenerated": false, "ratio": 3.9424242424242424, "conf...
from dwarfsquad.lib.compat import join_dicts from dwarfsquad.model.BaseWebModel import BaseWebModel class ReductionMethod(BaseWebModel): required_fields = { "activation_energy": "", "polarity": "unspecified", "lower_precursor_mass": "", "upper_precursor_mass": "", "lower_pr...
{ "repo_name": "whereskenneth/Dwarfsquad", "path": "dwarfsquad/model/ReductionMethod.py", "copies": "1", "size": "2349", "license": "mit", "hash": -6475785909928231000, "line_mean": 31.625, "line_max": 78, "alpha_frac": 0.5955725841, "autogenerated": false, "ratio": 3.961214165261383, "config_te...
from dwarfsquad.lib.compat import join_dicts from dwarfsquad.model.BaseWebModel import BaseWebModel class Smoothing(BaseWebModel): required_fields = { "optimal_enabled": True, "fixed": "", "min": "4", "max": "22", "start": "8" } @classmethod def __str__(cls): ...
{ "repo_name": "whereskenneth/Dwarfsquad", "path": "dwarfsquad/model/Smoothing.py", "copies": "1", "size": "1308", "license": "mit", "hash": 4265555969325408000, "line_mean": 24.1538461538, "line_max": 76, "alpha_frac": 0.5275229358, "autogenerated": false, "ratio": 3.7264957264957266, "config_t...
from dwarfsquad.lib.compat import join_dicts from dwarfsquad.model.BaseWebModel import BaseWebModel class Threshold(BaseWebModel): required_fields = { "absolute_area": "1", "relative_area": "0.01", "absolute_height": "100", "relative_height": "0.01", "signal_to_noise": "3",...
{ "repo_name": "whereskenneth/Dwarfsquad", "path": "dwarfsquad/model/Threshold.py", "copies": "1", "size": "3653", "license": "mit", "hash": 7615707665333048000, "line_mean": 33.4622641509, "line_max": 78, "alpha_frac": 0.5956747878, "autogenerated": false, "ratio": 3.8412197686645637, "config_t...
from dwarfsquad.lib import utils from dwarfsquad.lib.rest_api import get from dwarfsquad.lib import urls def download_batch(url, data, credentials): assert isinstance(data, str) batch_id = None batch_name = None batches = get(urls.batches_json(url) + "?search=" + data, credentials).json() if uti...
{ "repo_name": "whereskenneth/Dwarfsquad", "path": "dwarfsquad/lib/download/download_batch.py", "copies": "1", "size": "1523", "license": "mit", "hash": 250486280298823840, "line_mean": 34.4186046512, "line_max": 81, "alpha_frac": 0.5830597505, "autogenerated": false, "ratio": 3.885204081632653, ...
from dwarfsquad.lib.utils import assert_assay_configuration def find_orphan_compounds_in_level(orphan_compounds, compound_method_names, lot): lots_levels_status = [] for level in lot.levels: lots_levels_status.append("\tCompounds without methods in Lot/Level: " + lot.name + "/" + level.name) f...
{ "repo_name": "whereskenneth/Dwarfsquad", "path": "dwarfsquad/lib/check/helpers/check_lots_and_levels.py", "copies": "1", "size": "2914", "license": "mit", "hash": -6500962621375861000, "line_mean": 40.0422535211, "line_max": 117, "alpha_frac": 0.6832532601, "autogenerated": false, "ratio": 3.416...
from dwarfsquad.lib.utils import to_stderr import os from dwarfsquad.lib.build.from_export.helpers.csv_helper import read_csv def get_rulesettings_csv(path_to_export): export_dir = os.path.abspath(path_to_export) rulesettings_csv = os.path.join(export_dir, 'rulesettings.csv') try: assert os.path....
{ "repo_name": "whereskenneth/Dwarfsquad", "path": "dwarfsquad/lib/build/from_export/helpers/rulesettings_helper.py", "copies": "1", "size": "1770", "license": "mit", "hash": 6022625729897839000, "line_mean": 35.1224489796, "line_max": 119, "alpha_frac": 0.5700564972, "autogenerated": false, "rati...
from dwarfsquad.model.Lot import Lot from dwarfsquad.model.Level import Level from dwarfsquad.model.Level import ControlMaterial from dwarfsquad.model.Lot import LotCompound def build_lots_and_levels(lotslevels_csv): lots = [] for row in lotslevels_csv: lot_index, lot = get_lot(lots, row) lot...
{ "repo_name": "whereskenneth/Dwarfsquad", "path": "dwarfsquad/lib/build/from_export/build_lots_and_levels.py", "copies": "1", "size": "2185", "license": "mit", "hash": -4760602027487451000, "line_mean": 28.527027027, "line_max": 83, "alpha_frac": 0.6594965675, "autogenerated": false, "ratio": 3.6...
from dwca.darwincore.utils import qualname as qn from meuh.assessments.base import Assessment from meuh.assessments.logging import MessageLevels, MessageTypes class KnownKingdomAssessment(Assessment): ACCEPTED = {'cavalier-smith': set(['animalia', 'fungi', 'plantae', 'chromista', 'protozoa', ...
{ "repo_name": "BelgianBiodiversityPlatform/meuh", "path": "assessments/knownkingdom.py", "copies": "1", "size": "2250", "license": "bsd-3-clause", "hash": 7641585935558965000, "line_mean": 45.875, "line_max": 122, "alpha_frac": 0.5951111111, "autogenerated": false, "ratio": 3.8461538461538463, ...
from dwitter.models import Comment, Dweet from django.shortcuts import render from dwitter.permissions import IsAuthorOrReadOnly from dwitter.serializers import CommentSerializer, DweetSerializer from dwitter.serializers import UserSerializer from django.utils import timezone from django.contrib.auth.models import User...
{ "repo_name": "lionleaf/dwitter", "path": "dwitter/views.py", "copies": "1", "size": "1889", "license": "apache-2.0", "hash": -7358355168690136000, "line_mean": 33.9814814815, "line_max": 77, "alpha_frac": 0.7310746427, "autogenerated": false, "ratio": 4.273755656108597, "config_test": false, ...
from dwollav2.auth import auth_for from dwollav2.token import token_for from dwollav2.version import version import requests class Client: ENVIRONMENTS = { 'production': { 'auth_url': 'https://accounts.dwolla.com/auth', 'token_url': 'https://api.dwolla.com/token', 'ap...
{ "repo_name": "Dwolla/dwolla-v2-python", "path": "dwollav2/client.py", "copies": "1", "size": "1889", "license": "mit", "hash": -6935874785001524000, "line_mean": 31.5689655172, "line_max": 68, "alpha_frac": 0.5971413446, "autogenerated": false, "ratio": 3.550751879699248, "config_test": false,...
from dx.dex import ByteStream from dx.dex import dxlib #DexParser class DexParser(object): def __init__(self,filename): if filename == None: raise(Exception("Null File Name.")) self.bs = ByteStream(filename) def seek(self,offset): self.bs.seek(offset) def item(self,ite...
{ "repo_name": "strazzere/dexterity", "path": "examples/dexpy_parse.py", "copies": "2", "size": "9730", "license": "bsd-3-clause", "hash": -3773553520655836000, "line_mean": 43.2272727273, "line_max": 86, "alpha_frac": 0.5976361768, "autogenerated": false, "ratio": 3.561493411420205, "config_tes...
from dxfwrite import DXFEngine as dxf import csv import math import pdb import os import sys # ######### Declaration ########## points = [] data = [] area = 0 blockList = [] inner_height = 0 extraCuttingAreaL = 0 extraFillingAreaL = 0 extraCuttingAreaR = 0 extraFillingAreaR = 0 # Getting filename with which the file...
{ "repo_name": "mandeeps708/PyDrain", "path": "pyDrain.py", "copies": "1", "size": "27161", "license": "mit", "hash": 5683376921116357000, "line_mean": 37.2549295775, "line_max": 105, "alpha_frac": 0.4957843967, "autogenerated": false, "ratio": 3.7998041410184666, "config_test": false, "has_no...
from dxfwrite import DXFEngine as dxf from .format import Format class DXF(Format): _drawing = None def encode(self, features, **kwargs): tmpFile = kwargs["tmpFile"] if len(features) > 0: self._drawing = dxf.drawing(tmpFile) self._drawing.add_layer("...
{ "repo_name": "pusateri/vectorformats", "path": "vectorformats/formats/dxf.py", "copies": "2", "size": "1362", "license": "mit", "hash": -7822014826575531000, "line_mean": 29.2666666667, "line_max": 125, "alpha_frac": 0.5381791483, "autogenerated": false, "ratio": 4.54, "config_test": false, ...
from dxlib import DexEncodedArray from dxlib import DexEncodedAnnotation from ctypes import cast from ctypes import POINTER, c_char_p, c_uint32 class DexPrinter (object): def __init__(self,meta_verbose=False): self.meta_verbose = meta_verbose def max_attr(self,obj): return max([len(i[0]) for i...
{ "repo_name": "strazzere/dexterity", "path": "dx/printer.py", "copies": "2", "size": "19475", "license": "bsd-3-clause", "hash": 6115956334946370000, "line_mean": 29.9126984127, "line_max": 86, "alpha_frac": 0.5888061617, "autogenerated": false, "ratio": 3.255600133734537, "config_test": false,...
from dxlib import dxlib from dxlib import _Dex from bytestream import ByteStream class Dex(object): def __init__(self,filename): if filename == None: raise(Exception("Null File Name.")) self.bs = ByteStream(filename) self._dex = dxlib.dx_parse(self.bs._bs) ...
{ "repo_name": "rchiossi/dexterity", "path": "dx/dex.py", "copies": "2", "size": "3582", "license": "bsd-3-clause", "hash": -3840052175483389000, "line_mean": 35.5510204082, "line_max": 84, "alpha_frac": 0.6286990508, "autogenerated": false, "ratio": 3.629179331306991, "config_test": false, "h...
from dxr.lines import Ref from dxr.plugins.xpidl.filters import PLUGIN_NAME from dxr.plugins.xpidl.menus import (filtered_search_menu, typedecl_menu, subclass_menu, type_menu, vardecl_menu, var_menu, function_menu, functiondecl_menu, include_menu...
{ "repo_name": "bozzmob/dxr", "path": "dxr/plugins/xpidl/refs.py", "copies": "9", "size": "1934", "license": "mit", "hash": -158445435174427680, "line_mean": 31.2333333333, "line_max": 99, "alpha_frac": 0.6866597725, "autogenerated": false, "ratio": 3.5682656826568264, "config_test": false, "h...
from dxr.plugins.clang.tests import CSingleFileTestCase, MINIMAL_MAIN class MemberVariableTests(CSingleFileTestCase): source = """ class MemberVariable { public: int member_variable; }; """ + MINIMAL_MAIN def test_member_variable(self): """Test sear...
{ "repo_name": "pelmers/dxr", "path": "dxr/plugins/clang/tests/test_members.py", "copies": "5", "size": "5520", "license": "mit", "hash": 5619938877709736000, "line_mean": 33.7169811321, "line_max": 109, "alpha_frac": 0.5054347826, "autogenerated": false, "ratio": 4.299065420560748, "config_test...
from dxr.testing import DxrInstanceTestCase, menu_on SEARCH = '/code/search?q=%s%%3A%s' class IdlMenusTest(DxrInstanceTestCase): """Test that menu links point to the right places.""" def test_include(self): menu_on(self.source_page("nsIDownloadHistory.idl"), 'nsISupports.idl', {'html...
{ "repo_name": "pelmers/dxr", "path": "dxr/plugins/xpidl/tests/test_menus_and_filters/test_menus.py", "copies": "9", "size": "1923", "license": "mit", "hash": 3168265515574558700, "line_mean": 45.9024390244, "line_max": 96, "alpha_frac": 0.5813832553, "autogenerated": false, "ratio": 3.46486486486...
from dxr.testing import DxrInstanceTestCase class FieldsTests(DxrInstanceTestCase): def test_qual_field(self): self.found_line_eq('+var:test::SomeFields::field1', "<b>field1</b>: i32,", 9) self.found_line_eq('+var:test::SomeFields::field2', "<b>field2</b>: NoFields,", 10) def test_qual_enum_fi...
{ "repo_name": "gartung/dxr", "path": "dxr/plugins/rust/tests/test_data/test_fields.py", "copies": "2", "size": "11696", "license": "mit", "hash": -608101755345044600, "line_mean": 75.4444444444, "line_max": 156, "alpha_frac": 0.4257010944, "autogenerated": false, "ratio": 3.397037467325007, "co...
from dxr.testing import DxrInstanceTestCase class VarTests(DxrInstanceTestCase): def test_var_def(self): self.found_line_eq('var:a', "let <b>a</b> = 32i32;", 31) self.found_line_eq('var:w', "<b>w</b> @ _ =&gt; {", 24) self.found_line_eq('var:z', "<b>z</b> =&gt; {", 18) def test_arg_def...
{ "repo_name": "bozzmob/dxr", "path": "dxr/plugins/rust/tests/test_vars/test_vars.py", "copies": "2", "size": "1744", "license": "mit", "hash": -9185002560865522000, "line_mean": 48.8285714286, "line_max": 85, "alpha_frac": 0.4306192661, "autogenerated": false, "ratio": 2.606875934230194, "confi...
from dxr.testing import DxrInstanceTestCase from nose.tools import eq_, ok_ class BasicTests(DxrInstanceTestCase): """Tests for functionality that isn't specific to particular filters""" def test_text(self): """Assert that a plain text search works.""" self.found_files_eq('main', ['main.c', ...
{ "repo_name": "bozzmob/dxr", "path": "tests/test_basic/test_basic.py", "copies": "2", "size": "3192", "license": "mit", "hash": -397280858275856450, "line_mean": 31.9072164948, "line_max": 76, "alpha_frac": 0.5354010025, "autogenerated": false, "ratio": 4.081841432225064, "config_test": true, ...
from dxr.testing import SingleFileTestCase, MINIMAL_MAIN class MacroRefTests(SingleFileTestCase): """Tests for ``+macro-ref`` queries""" source = """ #define MACRO #ifdef MACRO #endif #ifndef MACRO #endif #if defined(MACRO) #endif #u...
{ "repo_name": "srenatus/dxr", "path": "tests/test_macros.py", "copies": "4", "size": "3338", "license": "mit", "hash": 3807716636934039600, "line_mean": 26.8166666667, "line_max": 79, "alpha_frac": 0.4601557819, "autogenerated": false, "ratio": 3.4590673575129536, "config_test": true, "has_no...
from dxr.testing import SingleFileTestCase, MINIMAL_MAIN class MacroTests(SingleFileTestCase): """Tests for ``macro`` queries""" source = """ #define MACRO #define ADD(x, y) ((x) + (y)) """ + MINIMAL_MAIN def test_simple(self): """Make sure macro definitions are found.""...
{ "repo_name": "gartung/dxr", "path": "dxr/plugins/clang/tests/test_macros.py", "copies": "2", "size": "3849", "license": "mit", "hash": -3087872005937273300, "line_mean": 26.8913043478, "line_max": 79, "alpha_frac": 0.4733697064, "autogenerated": false, "ratio": 3.4613309352517985, "config_test...
from dxtbx.model.experiment_list import Experiment, ExperimentList from dials.algorithms.indexing.indexer import Indexer class IndexerKnownOrientation(Indexer): def __init__(self, reflections, experiments, params, known_orientations): self.known_orientations = known_orientations super().__init__(...
{ "repo_name": "dials/dials", "path": "algorithms/indexing/known_orientation.py", "copies": "1", "size": "1194", "license": "bsd-3-clause", "hash": 3052065936755539000, "line_mean": 37.5161290323, "line_max": 77, "alpha_frac": 0.5787269682, "autogenerated": false, "ratio": 4.279569892473118, "co...
from dxtbx.model.experiment_list import ExperimentListFactory from scitbx import matrix from dials.algorithms.integration import Corrections, CorrectionsMulti from dials.array_family import flex def test_run(dials_data): filename = dials_data("centroid_test_data").join("experiments.json").strpath exlist = E...
{ "repo_name": "dials/dials", "path": "tests/algorithms/integration/test_corrections.py", "copies": "1", "size": "1512", "license": "bsd-3-clause", "hash": -8049187035473998000, "line_mean": 28.0769230769, "line_max": 84, "alpha_frac": 0.6375661376, "autogenerated": false, "ratio": 2.9021113243762...
from dxtbx.model import ExperimentList from xia2.Schema import load_reference_geometries, compare_geometries def test_load_reference_geometries(dials_data): """ Test `xia2.Schema.load_reference_geometries`. Test the function that finds the set of unique instrument models from a list of experiment lis...
{ "repo_name": "xia2/xia2", "path": "tests/Schema/test_Schema.py", "copies": "1", "size": "1126", "license": "bsd-3-clause", "hash": 1099677143206083500, "line_mean": 44.04, "line_max": 88, "alpha_frac": 0.7229129663, "autogenerated": false, "ratio": 3.597444089456869, "config_test": false, "h...
from dynaconf import LazySettings from dynaconf.utils import RENAMED_VARS # 0 given a bare settings settings = LazySettings(environments=True) # 1 Ensure all renamed vars exists in object for old, new in RENAMED_VARS.items(): assert old in settings assert new in settings # 2 Ensure pairs has the same value ...
{ "repo_name": "rochacbruno/dynaconf", "path": "example/compat.py", "copies": "1", "size": "2770", "license": "mit", "hash": -8225005520965477000, "line_mean": 27.8541666667, "line_max": 62, "alpha_frac": 0.7104693141, "autogenerated": false, "ratio": 2.8854166666666665, "config_test": false, ...
from dynaconf import LazySettings settings = LazySettings( environments=True, ENV_FOR_DYNACONF="example", ENVVAR_PREFIX_FOR_DYNACONF="PROGRAM", load_dotenv=True, settings_files="settings.toml;.secrets.toml", ) print(settings.USERNAME) print(settings.SERVER) print(settings.PASSWORD) assertions = ...
{ "repo_name": "rochacbruno/dynaconf", "path": "example/toml_with_secrets/program.py", "copies": "1", "size": "1295", "license": "mit", "hash": -8426366028053750000, "line_mean": 28.4318181818, "line_max": 77, "alpha_frac": 0.6640926641, "autogenerated": false, "ratio": 3.2133995037220844, "conf...
from dynaconf import settings print( f"# 1 all values in {settings.DEFAULT_ENV_FOR_DYNACONF}" f"{settings.current_env}: env of yaml file:" ) assert settings.current_env == "DEVELOPMENT" print("HOST::", settings.HOST) print("PORT:", settings.PORT) print("USERNAME:", settings.USERNAME) print("PASSWORD:", settin...
{ "repo_name": "rochacbruno/dynaconf", "path": "example/envs/app.py", "copies": "1", "size": "4853", "license": "mit", "hash": 2067014256430481200, "line_mean": 33.6642857143, "line_max": 71, "alpha_frac": 0.7141974037, "autogenerated": false, "ratio": 3.283491204330176, "config_test": true, "...
from dynaconf import settings print("Read from settings.py:", settings.PYTHON_VAR) # noqa # BY DEFAULT 'development' is the current env print("Read from development_settings.py:", settings.PYTHON_DEV_VAR) # noqa # If ENV_FOR_DYNACONF=production is in envvars so # print("Read from production_settings.py:", settings...
{ "repo_name": "rochacbruno/dynaconf", "path": "example/multiple_sources/app.py", "copies": "1", "size": "1469", "license": "mit", "hash": 6942934247941992000, "line_mean": 33.9761904762, "line_max": 78, "alpha_frac": 0.6820966644, "autogenerated": false, "ratio": 3.1934782608695653, "config_tes...
from dynaconf.utils import build_env_list from dynaconf.utils import upperfy from dynaconf.utils.parse_conf import parse_conf_data from dynaconf.utils.parse_conf import unparse_conf_data try: from redis import StrictRedis except ImportError: StrictRedis = None IDENTIFIER = "redis" def load(obj, env=None, si...
{ "repo_name": "rochacbruno/dynaconf", "path": "dynaconf/loaders/redis_loader.py", "copies": "1", "size": "3493", "license": "mit", "hash": 7390046726316453000, "line_mean": 31.9528301887, "line_max": 78, "alpha_frac": 0.5986258231, "autogenerated": false, "ratio": 3.731837606837607, "config_tes...
from dynamic_class import Singleton class NotEventException(Exception): pass class GlobalEventDispatcher(object): """not quite there yet""" __metaclass__ = Singleton def __init__(self): pass def event(method): """Must be called first in a decorator chain, otherwise we lose the correct n...
{ "repo_name": "akatrevorjay/speakerbot", "path": "speakerbot/listenable.py", "copies": "2", "size": "4231", "license": "mit", "hash": 1960386818708243000, "line_mean": 30.5820895522, "line_max": 150, "alpha_frac": 0.6164027417, "autogenerated": false, "ratio": 4.269424823410696, "config_test": ...
from dynamiccluster.utilities import getLogger from dynamiccluster.data import Instance log = getLogger(__name__) class ConfigChecker(object): def check(self, **kwargs): assert 0, 'Must define check' class PortChecker(ConfigChecker): """ Check if a port is opened. """ def __init__...
{ "repo_name": "eResearchSA/dynamiccluster", "path": "dynamiccluster/config_checker.py", "copies": "1", "size": "1210", "license": "apache-2.0", "hash": 5387514940329674000, "line_mean": 34.5882352941, "line_max": 94, "alpha_frac": 0.6033057851, "autogenerated": false, "ratio": 3.9802631578947367,...
from ..DynamicDiffusionModel import DynamicDiffusionModel import numpy as np import networkx as nx import future.utils from scipy import stats __author__ = "Letizia Milli" __license__ = "BSD-2-Clause" __email__ = "letizia.milli@isti.cnr.it" class DynProfileModel(DynamicDiffusionModel): """ Node Para...
{ "repo_name": "GiulioRossetti/ndlib", "path": "ndlib/models/dynamic/DynProfileModel.py", "copies": "1", "size": "4606", "license": "bsd-2-clause", "hash": -8355660450341874000, "line_mean": 35.848, "line_max": 105, "alpha_frac": 0.4696048632, "autogenerated": false, "ratio": 4.5739821251241315, ...
from ..DynamicDiffusionModel import DynamicDiffusionModel import numpy as np import networkx as nx import future.utils __author__ = "Giulio Rossetti" __license__ = "BSD-2-Clause" __email__ = "giulio.rossetti@gmail.com" class DynSIModel(DynamicDiffusionModel): """ Model Parameters to be specified via ModelCon...
{ "repo_name": "GiulioRossetti/ndlib", "path": "ndlib/models/dynamic/DynSIModel.py", "copies": "1", "size": "4144", "license": "bsd-2-clause", "hash": 3092132562520736300, "line_mean": 35.6725663717, "line_max": 97, "alpha_frac": 0.5127895753, "autogenerated": false, "ratio": 4.185858585858586, ...
from dynamic_graph import plug from dynamic_graph.sot.core.feature_visual_point import FeatureVisualPoint from dynamic_graph.sot.core.gain_adaptive import GainAdaptive from dynamic_graph.sot.core.meta_tasks import setGain from dynamic_graph.sot.core.op_point_modifier import OpPointModifier from dynamic_graph.sot.core.t...
{ "repo_name": "stack-of-tasks/sot-core", "path": "src/dynamic_graph/sot/core/meta_task_visual_point.py", "copies": "1", "size": "4129", "license": "bsd-2-clause", "hash": 8815918265346295000, "line_mean": 34.2905982906, "line_max": 97, "alpha_frac": 0.6369581012, "autogenerated": false, "ratio": ...
from dynamic_graph import plug from dynamic_graph.sot.core import Flags from dynamic_graph.sot.core.feature_generic import FeatureGeneric from dynamic_graph.sot.core.gain_adaptive import GainAdaptive from dynamic_graph.sot.core.matrix_util import matrixToTuple, vectorToTuple from dynamic_graph.sot.core.meta_task_6d imp...
{ "repo_name": "stack-of-tasks/sot-core", "path": "src/dynamic_graph/sot/core/meta_task_posture.py", "copies": "1", "size": "3171", "license": "bsd-2-clause", "hash": -6224708553671255000, "line_mean": 33.0967741935, "line_max": 95, "alpha_frac": 0.5878271839, "autogenerated": false, "ratio": 3.43...
from dynamic_graph import plug from dynamic_graph.sot.core import Flags from dynamic_graph.sot.core.feature_point6d import FeaturePoint6d from dynamic_graph.sot.core.gain_adaptive import GainAdaptive from dynamic_graph.sot.core.op_point_modifier import OpPointModifier from dynamic_graph.sot.core.task import Task def ...
{ "repo_name": "stack-of-tasks/sot-core", "path": "src/dynamic_graph/sot/core/meta_task_6d.py", "copies": "1", "size": "3635", "license": "bsd-2-clause", "hash": 8723554509462735000, "line_mean": 33.9519230769, "line_max": 94, "alpha_frac": 0.6412654746, "autogenerated": false, "ratio": 3.47182425...
from dynamic_graph import plug from dynamic_graph.sot.core import Flags from dynamic_graph.sot.core.feature_point6d_relative import FeaturePoint6dRelative from dynamic_graph.sot.core.matrix_util import matrixToTuple from dynamic_graph.sot.core.meta_task_6d import MetaTask6d, toFlags # noqa kept for backward compatibil...
{ "repo_name": "stack-of-tasks/sot-core", "path": "src/dynamic_graph/sot/core/meta_tasks_kine_relative.py", "copies": "1", "size": "5587", "license": "bsd-2-clause", "hash": -4621200687946365000, "line_mean": 39.7810218978, "line_max": 111, "alpha_frac": 0.7091462323, "autogenerated": false, "rati...
from dynamic_graph import plug from .selector import Selector as Base print("With meta selector") # Define a new constructor for the selector entity. The basic Selector(name) # constructor is still valid. # Typical use below: # % selecSupportFoot = Selector('selecSupportFoot' # % ,['mat...
{ "repo_name": "stack-of-tasks/sot-pattern-generator", "path": "src/dynamic_graph/sot/pattern_generator/meta_selector.py", "copies": "1", "size": "1090", "license": "isc", "hash": -2024686076165806600, "line_mean": 33.0625, "line_max": 89, "alpha_frac": 0.5165137615, "autogenerated": false, "ratio...
from dynamic import DynamicDict class Document(object): def __init__(self, attrs, parent=None, traits=[]): self.attrs = attrs self.parent = parent self.traits = traits class Trait(object): def __init__(self, attrs, parent=None): self.attrs = attrs self.parent = parent ...
{ "repo_name": "gamechanger/monufacture", "path": "monufacture/factory.py", "copies": "1", "size": "5056", "license": "mit", "hash": 6951514233378143000, "line_mean": 31, "line_max": 107, "alpha_frac": 0.6145174051, "autogenerated": false, "ratio": 4.40418118466899, "config_test": false, "has_...
from dynamicNode import DynamicNode import dynamicNode reload(dynamicNode) import pydot ################### #DynamicNode class got lost, but you should be able still to understand the overall code, # for what I can recall the node was nothing more than a data holder , no special method #added to it, so by the code you ...
{ "repo_name": "giordi91/python_misc", "path": "graphs/unionFind.py", "copies": "1", "size": "5852", "license": "mit", "hash": 5332732196141575000, "line_mean": 25.7214611872, "line_max": 126, "alpha_frac": 0.4875256323, "autogenerated": false, "ratio": 3.7803617571059434, "config_test": false, ...
from dynamicNode import DynamicNode import dynamicNode reload(dynamicNode) import pydot ################### #DynamicNode class got lost, but you should be able still to understand the overall code, # for what I can recall the node was nothing more than a data holder , no special method #added to it, so by the code you...
{ "repo_name": "giordi91/python_misc", "path": "graphs/quickFind.py", "copies": "1", "size": "4980", "license": "mit", "hash": -640872672047234200, "line_mean": 25.6310160428, "line_max": 122, "alpha_frac": 0.5036144578, "autogenerated": false, "ratio": 3.719193427931292, "config_test": false, ...
from .dynamic_pool import DynamicPool, xenon_interactive_worker from ..scheduler import Scheduler from ..job_keeper import JobKeeper from ...workflow import (get_workflow) from copy import copy def run_xenon_simple(workflow, machine, worker_config): """Run a workflow using a single Xenon remote worker. :pa...
{ "repo_name": "NLeSC/noodles", "path": "noodles/run/xenon/runner.py", "copies": "1", "size": "1742", "license": "apache-2.0", "hash": -9114689045179351000, "line_mean": 29.5614035088, "line_max": 77, "alpha_frac": 0.6848450057, "autogenerated": false, "ratio": 3.9322799097065464, "config_test":...
from dynamic_preferences.types import * from dynamic_preferences import global_preferences_registry, user_preferences_registry @global_preferences_registry.register class RegistrationAllowed(BooleanPreference): """ Are new registrations allowed ? """ section = "auth" name = "registration_allowed" ...
{ "repo_name": "willseward/django-dynamic-preferences", "path": "example/example/dynamic_preferences_registry.py", "copies": "1", "size": "1645", "license": "bsd-3-clause", "hash": 6309177182128429000, "line_mean": 21.8472222222, "line_max": 86, "alpha_frac": 0.673556231, "autogenerated": false, "...
from dynamic_preferences.types import * from dynamic_preferences.registries import global_preferences_registry from dynamic_preferences.users.registries import user_preferences_registry from .models import MyModel _section = Section("section") @global_preferences_registry.register class RegistrationAllowed(BooleanPr...
{ "repo_name": "EliotBerriot/django-dynamic-preferences", "path": "example/example/dynamic_preferences_registry.py", "copies": "1", "size": "2321", "license": "bsd-3-clause", "hash": -415613910027314200, "line_mean": 20.8962264151, "line_max": 74, "alpha_frac": 0.6708315381, "autogenerated": false, ...
from dynamic_preferences.types import * from dynamic_preferences.registries import global_preferences_registry from dynamic_preferences.users.registries import user_preferences_registry @global_preferences_registry.register class RegistrationAllowed(BooleanPreference): """ Are new registrations allowed ? ...
{ "repo_name": "haroon-sheikh/django-dynamic-preferences", "path": "example/example/dynamic_preferences_registry.py", "copies": "1", "size": "1802", "license": "bsd-3-clause", "hash": -7948210462633630000, "line_mean": 20.9756097561, "line_max": 74, "alpha_frac": 0.6781354051, "autogenerated": false...
from dynamic_preferences.types import StringPreference, IntegerPreference, BooleanPreference, Section from dynamic_preferences.registries import global_preferences_registry from dynamic_preferences.preferences import Section from django.conf import settings general_section = Section('general') homepage_section = Sect...
{ "repo_name": "sitture/trade-motors", "path": "src/vehicles/dynamic_preferences_registry.py", "copies": "1", "size": "1695", "license": "mit", "hash": -2876332997482406400, "line_mean": 30.3888888889, "line_max": 101, "alpha_frac": 0.7439528024, "autogenerated": false, "ratio": 4.114077669902913,...
from dynamicresponse.response import render_to_response, RequestContext from core.notifications.models import Notification from django.contrib.auth.decorators import login_required from django.views.decorators.csrf import csrf_exempt from django.http import HttpResponse @login_required def widget(req): return ren...
{ "repo_name": "kave/collab", "path": "core/notifications/views.py", "copies": "5", "size": "1063", "license": "cc0-1.0", "hash": 2248715958102678500, "line_mean": 31.2121212121, "line_max": 72, "alpha_frac": 0.665098777, "autogenerated": false, "ratio": 4.662280701754386, "config_test": false, ...
from dynamic_rest.fields import DynamicComputedField from dynamic_rest.serializers import ( DynamicModelSerializer, DynamicRelationField ) from restapi.models import ( CasProtein, Locus, LocusSpacerRepeat, Organism, OrganismCasProtein, OrganismSelfSpacer, Spacer, Repeat ) clas...
{ "repo_name": "goyalsid/phageParser", "path": "restapi/serializers.py", "copies": "3", "size": "3508", "license": "mit", "hash": 2637863936201515000, "line_mean": 29.5043478261, "line_max": 77, "alpha_frac": 0.6624857469, "autogenerated": false, "ratio": 3.884828349944629, "config_test": false,...
from dynamic_rest import fields as fields from dynamic_rest import routers as routers from dynamic_rest import serializers as serializers from dynamic_rest import viewsets as viewsets from .models import Group, Permission, User # DREST # DREST serializers class UserSerializer(serializers.DynamicModelSerializer): ...
{ "repo_name": "sanoma/dynamic-rest", "path": "benchmarks/drest.py", "copies": "2", "size": "1279", "license": "mit", "hash": -1761994316678908000, "line_mean": 19.9672131148, "line_max": 63, "alpha_frac": 0.6716184519, "autogenerated": false, "ratio": 4.335593220338983, "config_test": false, ...
from dynamic_rest.viewsets import DynamicModelViewSet from restapi.models import ( CasProtein, Locus, LocusSpacerRepeat, Organism, OrganismCasProtein, OrganismSelfSpacer, Repeat, Spacer ) from restapi.serializers import ( CasProteinSerializer, LSRSerializer, LocusSerializer,...
{ "repo_name": "mbonsma/phageParser", "path": "restapi/views.py", "copies": "3", "size": "2103", "license": "mit", "hash": -8745331537017083000, "line_mean": 22.8977272727, "line_max": 71, "alpha_frac": 0.7113647171, "autogenerated": false, "ratio": 3.930841121495327, "config_test": false, "ha...
from dynamic_rules.dynamic_actions import BaseDynamicAction from dynamic_manipulation import models from dynamic_manipulation.models import ManipulationLog __all__ = ('BaseDynamicManipulation', ) class BaseDynamicManipulation(BaseDynamicAction): def clear_existing(self): """ Both Side Effect Mo...
{ "repo_name": "imtapps/django-dynamic-manipulation", "path": "dynamic_manipulation/dynamic_actions.py", "copies": "1", "size": "1873", "license": "bsd-2-clause", "hash": -1077260865737851900, "line_mean": 31.8596491228, "line_max": 107, "alpha_frac": 0.6444207154, "autogenerated": false, "ratio":...
from dynamic_scraper.spiders.django_spider import DjangoSpider from open_news.models import NewsWebsite, Article, ArticleItem import scrapy from scrapy.spider import Spider from scrapy.selector import Selector from open_news.items import Website, DmozItem class ArticleSpider(DjangoSpider): name = 'article_spi...
{ "repo_name": "c3pko/GovScrape", "path": "example_project/open_news/scraper/spiders.py", "copies": "1", "size": "1207", "license": "bsd-3-clause", "hash": 559250772424984500, "line_mean": 32.5555555556, "line_max": 66, "alpha_frac": 0.6743993372, "autogenerated": false, "ratio": 3.657575757575757...
from dynamic_scraper.spiders.django_spider import DjangoSpider from open_news.models import NewsWebsite, NewsWebsite2, Article, Article2, ArticleItem, ArticleItem2 class ArticleSpider(DjangoSpider): name = 'article_spider' def __init__(self, *args, **kwargs): self._set_ref_object(NewsWebsite, **...
{ "repo_name": "caspyyy/SCRAPY_DDS", "path": "example_project/open_news/scraper/spiders.py", "copies": "1", "size": "1076", "license": "bsd-3-clause", "hash": -390599826306840900, "line_mean": 36.1379310345, "line_max": 100, "alpha_frac": 0.7081784387, "autogenerated": false, "ratio": 3.3625, "c...
from dynamics import * class Particle(object): def __init__(self): self.convertList = [int, float, list] self.type = 'particle' self.forward_done = False class AbstractScalar(Particle): def __init__(self, name, parent=None): super(AbstractScalar, self).__init__() ...
{ "repo_name": "amartya18x/easyGrad", "path": "easyGrad/particles/dataTypes.py", "copies": "1", "size": "7809", "license": "apache-2.0", "hash": -6609048754816066000, "line_mean": 25.7431506849, "line_max": 75, "alpha_frac": 0.5382251249, "autogenerated": false, "ratio": 3.7435282837967403, "con...
from dynamic_stack_decider.abstract_action_element import AbstractActionElement from humanoid_league_msgs.msg import HeadMode from geometry_msgs.msg import PoseStamped from tf.transformations import quaternion_from_euler import rospy import math class SearchBall(AbstractActionElement): def __init__(self, blackboa...
{ "repo_name": "bit-bots/bitbots_behaviour", "path": "bitbots_body_behavior/src/bitbots_body_behavior/actions/search_ball.py", "copies": "1", "size": "2512", "license": "bsd-3-clause", "hash": -5297303472904633000, "line_mean": 39.5161290323, "line_max": 79, "alpha_frac": 0.6484872611, "autogenerate...
from dynamic_stack_decider.abstract_action_element import AbstractActionElement from humanoid_league_msgs.msg import HeadMode class StartTimer(AbstractActionElement): def __init__(self, blackboard, dsd, parameters=None): super(StartTimer, self).__init__(blackboard, dsd, parameters) if 'name' not ...
{ "repo_name": "bit-bots/bitbots_behaviour", "path": "bitbots_body_behavior/src/bitbots_body_behavior/actions/timer.py", "copies": "1", "size": "1225", "license": "bsd-3-clause", "hash": -3590271183558192000, "line_mean": 38.5161290323, "line_max": 93, "alpha_frac": 0.6824489796, "autogenerated": fa...
from dynamic_stack_decider.abstract_action_element import AbstractActionElement from tf2_geometry_msgs import PoseStamped import rospy class GoToBlockPosition(AbstractActionElement): def __init__(self, blackboard, dsd, parameters=None): super(GoToBlockPosition, self).__init__(blackboard, dsd, parameters) ...
{ "repo_name": "bit-bots/bitbots_behaviour", "path": "bitbots_body_behavior/src/bitbots_body_behavior/actions/go_to_block_position.py", "copies": "1", "size": "2457", "license": "bsd-3-clause", "hash": -5850324741761516000, "line_mean": 48.14, "line_max": 127, "alpha_frac": 0.5592185592, "autogenera...
from dynamic_stack_decider.abstract_action_element import AbstractActionElement from tf2_geometry_msgs import PoseStamped import rospy class GoToDefensePosition(AbstractActionElement): def __init__(self, blackboard, dsd, parameters=None): super(GoToDefensePosition, self).__init__(blackboard, dsd, paramete...
{ "repo_name": "bit-bots/bitbots_behaviour", "path": "bitbots_body_behavior/src/bitbots_body_behavior/actions/go_to_defense_position.py", "copies": "1", "size": "2216", "license": "bsd-3-clause", "hash": -7191562768750323000, "line_mean": 44.2244897959, "line_max": 114, "alpha_frac": 0.5379061372, "...
from dynamic_stack_decider.abstract_decision_element import AbstractDecisionElement class BallDangerous(AbstractDecisionElement): def __init__(self, blackboard, dsd, parameters=None): super(BallDangerous, self).__init__(blackboard, dsd, parameters) self.goal_radius = self.blackboard.config['ball_d...
{ "repo_name": "bit-bots/bitbots_behaviour", "path": "bitbots_body_behavior/src/bitbots_body_behavior/decisions/ball_dangerous.py", "copies": "1", "size": "1628", "license": "bsd-3-clause", "hash": 2610493355450980400, "line_mean": 37.7619047619, "line_max": 96, "alpha_frac": 0.6357493857, "autogene...
from dynamite import fields from dynamite.defines import STRING, NUMBER from dynamite.schema import Schema from dynamite.tables import Table from dynamite.items import TableItems from dynamite.utils import ClassProperty class Model(Schema): _table = None _items = None _key = None read_capacity_units =...
{ "repo_name": "viatoriche/dynamite", "path": "dynamite/models.py", "copies": "1", "size": "4669", "license": "mit", "hash": -2617649550807039500, "line_mean": 28.18125, "line_max": 83, "alpha_frac": 0.5720711073, "autogenerated": false, "ratio": 3.7990235964198535, "config_test": false, "has_...
from dynamoengine.base.metaclasses import ItemMetaclass from dynamoengine.static import VERBOSE_TYPES from dynamoengine.exceptions import ( DynamoPreconditionError, ItemAttributeTypeError, AttributeIsRequired ) from dynamoengine.connection import ( create_item, update_item, delete_item, wi...
{ "repo_name": "jcoc611/DynamoEngine", "path": "dynamoengine/item.py", "copies": "1", "size": "7090", "license": "mit", "hash": 7274544643312761000, "line_mean": 22.7123745819, "line_max": 75, "alpha_frac": 0.514809591, "autogenerated": false, "ratio": 4.591968911917099, "config_test": false, ...
from dynamoengine.static import VERBOSE_TYPES from dynamoengine.exceptions import ( ItemAttributeTypeError, ValidationError ) class BaseField(object): ''' Abstract class representing any Item attribute. Called Field for nomenclature coherence with mongoengine and django backends. ...
{ "repo_name": "jcoc611/DynamoEngine", "path": "dynamoengine/base/field.py", "copies": "1", "size": "2294", "license": "mit", "hash": -1830901081776729900, "line_mean": 26.6385542169, "line_max": 73, "alpha_frac": 0.5431560593, "autogenerated": false, "ratio": 4.6437246963562755, "config_test": ...
from dynamo.models import DynamicApp, DynamicModel, DynamicModelField from django.contrib import admin from dynamo.utils import reregister_in_admin, dynamo_exist class DynamicAppAdmin(admin.ModelAdmin): fields = ('name', 'verbose_name') search_fields = ('name','verbose_name') ordering = ('name',) list...
{ "repo_name": "rendrom/django-dynamit", "path": "dynamo/admin.py", "copies": "1", "size": "1235", "license": "mit", "hash": 6958364581715466000, "line_mean": 29.875, "line_max": 69, "alpha_frac": 0.6995951417, "autogenerated": false, "ratio": 3.7087087087087087, "config_test": false, "has_no_...
from dynasty.models import Dynasty import re def get_mined_dates(text): mined_dates = [] dates = mine_date(text) if dates: for date in dates: if isinstance(date, list): for range_date in date: mined_dates.append(range_date) # TODO...
{ "repo_name": "jmwenda/hypermap", "path": "hypermap/dynasty/utils.py", "copies": "1", "size": "2659", "license": "mit", "hash": -1379545192603141000, "line_mean": 27.5913978495, "line_max": 74, "alpha_frac": 0.5374200827, "autogenerated": false, "ratio": 3.3446540880503144, "config_test": false...
from dynet import * from collections import Counter import random import util # format of files: each line is "word<TAB>tag<newline>", blank line is new sentence. train_file="/Users/yogo/Vork/Research/corpora/pos/WSJ.TRAIN" test_file="/Users/yogo/Vork/Research/corpora/pos/WSJ.TEST" MLP=True def read(fname): se...
{ "repo_name": "mitchellstern/dynet", "path": "examples/python/bilstmtagger.py", "copies": "3", "size": "3645", "license": "apache-2.0", "hash": 936636805345612800, "line_mean": 24.3125, "line_max": 84, "alpha_frac": 0.5404663923, "autogenerated": false, "ratio": 2.9113418530351436, "config_test...
from dynet import * from utils import ParseForest, read_conll, write_conll from operator import itemgetter from itertools import chain import utils, time, random import numpy as np class ArcHybridLSTM: def __init__(self, words, pos, rels, w2i, options): self.model = Model() self.trainer = AdamTrai...
{ "repo_name": "elikip/bist-parser", "path": "barchybrid/src/arc_hybrid.py", "copies": "1", "size": "19112", "license": "apache-2.0", "hash": 869867689638192600, "line_mean": 45.6146341463, "line_max": 206, "alpha_frac": 0.5291439933, "autogenerated": false, "ratio": 3.5783561130874366, "config_...
from dynet import * from utils import read_conll, write_conll from operator import itemgetter import utils, time, random, decoder import numpy as np class MSTParserLSTM: def __init__(self, vocab, pos, rels, w2i, options): self.model = Model() random.seed(1) self.trainer = AdamTrainer(self....
{ "repo_name": "elikip/bist-parser", "path": "bmstparser/src/mstlstm.py", "copies": "2", "size": "15063", "license": "apache-2.0", "hash": -4825762428199560000, "line_mean": 45.4907407407, "line_max": 216, "alpha_frac": 0.555666202, "autogenerated": false, "ratio": 3.6542940320232895, "config_te...
from dynet import * import time import random LAYERS = 2 INPUT_DIM = 256 #50 #256 HIDDEN_DIM = 256 # 50 #1024 VOCAB_SIZE = 0 MB_SIZE = 50 # mini batch size from collections import defaultdict from itertools import count import sys import util class RNNLanguageModel: def __init__(self, model, LAYERS, INPUT_DIM...
{ "repo_name": "cherryc/dynet", "path": "examples/python/rnnlm-batch.py", "copies": "1", "size": "4710", "license": "apache-2.0", "hash": -5546046006523469000, "line_mean": 31.9370629371, "line_max": 102, "alpha_frac": 0.5481953291, "autogenerated": false, "ratio": 3.5228122662677634, "config_te...
from dynet import * import time import random LAYERS = 2 INPUT_DIM = 256 #50 #256 HIDDEN_DIM = 256 # 50 #1024 VOCAB_SIZE = 0 MB_SIZE = 50 # mini batch size import argparse from collections import defaultdict from itertools import count import sys import util class RNNLanguageModel: def __init__(self, model, L...
{ "repo_name": "Peilun-Li/dynet", "path": "examples/python/rnnlm-batch.py", "copies": "2", "size": "4865", "license": "apache-2.0", "hash": 463011954725685760, "line_mean": 31.8716216216, "line_max": 102, "alpha_frac": 0.5531346351, "autogenerated": false, "ratio": 3.548504741064916, "config_tes...
from dynet import * import time import random LAYERS = 2 INPUT_DIM = 256 #50 #256 HIDDEN_DIM = 256 # 50 #1024 VOCAB_SIZE = 0 from collections import defaultdict from itertools import count import argparse import sys import util class RNNLanguageModel: def __init__(self, model, LAYERS, INPUT_DIM, HIDDEN_DIM, VO...
{ "repo_name": "Peilun-Li/dynet", "path": "examples/python/rnnlm.py", "copies": "1", "size": "4216", "license": "apache-2.0", "hash": -4235387333487671300, "line_mean": 31.1832061069, "line_max": 102, "alpha_frac": 0.5396110057, "autogenerated": false, "ratio": 3.4614121510673237, "config_test":...
from dynet import * train_sentence = [('the','D'), ('dog','N'), ('walks','V')] i2w = dict(enumerate(set(w for w,t in train_sentence))) w2i = dict((w,i) for i,w in i2w.items()) t2i = dict((t,i) for i,t in enumerate(set(t for w,t in train_sentence))) num_words = len(w2i) num_tags = len(t2i) model = Model() sgd = Simpl...
{ "repo_name": "Peilun-Li/dynet", "path": "examples/python/viz_birnn.py", "copies": "2", "size": "1825", "license": "apache-2.0", "hash": 226948127466458180, "line_mean": 29.9322033898, "line_max": 128, "alpha_frac": 0.6169863014, "autogenerated": false, "ratio": 2.7037037037037037, "config_test...
from dynet import * train_sentence = [('the','D'), ('dog','N'), ('walks','V')] i2w = dict(enumerate(set(w for w,t in train_sentence))) w2i = dict((w,i) for i,w in i2w.iteritems()) t2i = dict((t,i) for i,t in enumerate(set(t for w,t in train_sentence))) num_words = len(w2i) num_tags = len(t2i) model = Model() sgd = S...
{ "repo_name": "mitchellstern/dynet", "path": "examples/python/viz_birnn.py", "copies": "3", "size": "1829", "license": "apache-2.0", "hash": 8511949188523963000, "line_mean": 30, "line_max": 128, "alpha_frac": 0.6178239475, "autogenerated": false, "ratio": 2.70962962962963, "config_test": false...
from dynet import * #xsent = True xsent = False HIDDEN_SIZE = 8 ITERATIONS = 2000 m = Model() sgd = SimpleSGDTrainer(m) pW = m.add_parameters((HIDDEN_SIZE, 2)) pb = m.add_parameters(HIDDEN_SIZE) pV = m.add_parameters((1, HIDDEN_SIZE)) pa = m.add_parameters(1) W = parameter(pW) b = parameter(pb) V = parameter(pV) a...
{ "repo_name": "mitchellstern/dynet", "path": "examples/python/xor.py", "copies": "3", "size": "1398", "license": "apache-2.0", "hash": 5883331780870273000, "line_mean": 17.3947368421, "line_max": 47, "alpha_frac": 0.5672389127, "autogenerated": false, "ratio": 2.3456375838926173, "config_test":...
from dynetx.utils import make_str import dynetx as dn from itertools import chain, count __all__ = ['node_link_data', 'node_link_graph'] _attrs = dict(id='id', source='source', target='target') def node_link_data(G, attrs=_attrs): """Return data in node-link format that is suitable for JSON serialization and...
{ "repo_name": "GiulioRossetti/dynetx", "path": "dynetx/readwrite/json_graph/node_link.py", "copies": "1", "size": "3153", "license": "bsd-2-clause", "hash": 3400312318020827000, "line_mean": 26.4173913043, "line_max": 129, "alpha_frac": 0.5867427846, "autogenerated": false, "ratio": 3.78966346153...
from dynipman.components import Client client = Client() def device_info(): print("Client host: "+client.info['host']) print("Client name: "+client.info['name']) return client.info def report_ip(): update = client.report_ip() return update def show_menu(): print('\n-Menu-----------------...
{ "repo_name": "jungkumseok/dynipman", "path": "dynipman/client_shell.py", "copies": "1", "size": "1060", "license": "mit", "hash": 2543165939001856000, "line_mean": 24.2619047619, "line_max": 47, "alpha_frac": 0.4613207547, "autogenerated": false, "ratio": 3.8827838827838828, "config_test": fal...
from dynomite import Dynomite from dynomite.ttypes import * from thrift import Thrift from thrift.transport import TSocket from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol from threading import local, RLock class Client(object): """ Simplified thrift client abstracts some t...
{ "repo_name": "seabirdzh/dynomite", "path": "pylibs/dynomite/thrift_client.py", "copies": "2", "size": "1650", "license": "bsd-3-clause", "hash": 6425998245193210000, "line_mean": 27.9473684211, "line_max": 76, "alpha_frac": 0.6218181818, "autogenerated": false, "ratio": 4.187817258883249, "con...
from dynts.utils import test from dynts.utils.populate import randomts, polygen class TestDelta(test.TestCase): def getts(self, cols, *coefs): return randomts(100, cols, backend=self.backend, generator = polygen(*coefs)) def testp0Delta(self): '''Test mean ...
{ "repo_name": "quantmind/dynts", "path": "tests/unit/tsdelta.py", "copies": "1", "size": "2572", "license": "bsd-3-clause", "hash": -2253402724726451000, "line_mean": 30.5569620253, "line_max": 61, "alpha_frac": 0.5221617418, "autogenerated": false, "ratio": 3.480378890392422, "config_test": tr...
from dyplot.nvd3 import NVD3 import csv import json class Scatter(NVD3): m2s = {'o' : 'circle', '+' : 'cross' , '^' : 'triangle-up' , 'v' : 'triangle-down', 'D' : 'diamond' , 's' : 'square'} def __init__(self, x, y, g,s=1, marker='o', slope="", intercept="", option=...
{ "repo_name": "blacksburg98/dyplot", "path": "dyplot/scatter.py", "copies": "1", "size": "5959", "license": "mit", "hash": 2704632319774299600, "line_mean": 36.7151898734, "line_max": 117, "alpha_frac": 0.4782681658, "autogenerated": false, "ratio": 3.6852195423623995, "config_test": false, "...
from .e164 import mapping from .e212 import networks from .errors import InvalidPhone, InvalidNetwork, InvalidCountry def phone_country(phone): ''' Really simple function to get the ISO-3166-1 country from a phone number The phone number must be in E.164, aka international format. Returns an ISO-3166-...
{ "repo_name": "onlinecity/phone-iso3166", "path": "phone_iso3166/country.py", "copies": "1", "size": "2392", "license": "mit", "hash": -2121614214684868400, "line_mean": 29.2784810127, "line_max": 79, "alpha_frac": 0.6049331104, "autogenerated": false, "ratio": 3.9084967320261437, "config_test"...
from eacc.eacc import Eacc from eacc.lexer import Lexer from crocs.grammar import RegexTokens, RegexGrammar, HClassGrammar, HClassTokens from crocs.regex import X, Pattern, Group, NonCapture, NamedGroup, Repeat, ZeroOrMore, OneOrMore, \ OneOrZero, Seq, Include, Exclude, ConsumeNext, ConsumeBack, Any, NGLink, RegexComme...
{ "repo_name": "iogf/crocs", "path": "crocs/xparser.py", "copies": "1", "size": "10477", "license": "apache-2.0", "hash": -1117615612186358300, "line_mean": 31.3364197531, "line_max": 99, "alpha_frac": 0.6093347332, "autogenerated": false, "ratio": 3.3983133311709373, "config_test": false, "ha...
from eacc.eacc import Rule, Grammar, T from eacc.lexer import LexTok, XSpec, SeqTok, LexSeq from eacc.token import TokVal, Plus, Minus, LP, RP, Mul, \ Comma, Sof, Eof, Char, LB, RB, Pipe, Question, Equal, Hash,Comment, \ LBR, RBR, Dot, Escape, Lesser, Greater, Exclam, Caret, TokType, Num, String, \ Colon, Dollar clas...
{ "repo_name": "iogf/crocs", "path": "crocs/grammar.py", "copies": "1", "size": "6619", "license": "apache-2.0", "hash": -5758003398890518000, "line_mean": 34.0211640212, "line_max": 87, "alpha_frac": 0.6058316966, "autogenerated": false, "ratio": 2.5043511161558833, "config_test": false, "has...