max_stars_repo_path
string
max_stars_repo_name
string
max_stars_count
int64
id
string
content
string
add_param_types
int64
add_return_types
int64
add_class_field_types
int64
add_instance_field_types
int64
add_total
int64
add_error
int64
calico/tests/utils.py
davidlrosenblum/integrations-extras
158
1715721
import os from datadog_checks.dev import get_here HERE = get_here() def get_fixture_path(filename) -> object: return os.path.join(HERE, 'fixtures', filename)
0
1
0
0
1
0
sdk/commerce/azure-mgmt-commerce/azure/mgmt/commerce/models/__init__.py
rsdoherty/azure-sdk-for-python
2,728
1715785
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
0
0
0
0
0
0
examples/nas/oneshot/pfld/datasets.py
dutxubo/nni
9,680
1715811
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from __future__ import annotations from __future__ import absolute_import, division, print_function import cv2 import os import numpy as np from torch.utils import data class PFLDDatasets(data.Dataset): """ Dataset to manage the data loa...
3
2
0
4
9
0
tao/trackers/sot/base.py
NVDLI/tao
158
1715843
from __future__ import annotations import logging import time from abc import ABC, abstractmethod from contextlib import contextmanager from functools import partial from pathlib import Path import numpy as np from moviepy.video.io.ffmpeg_writer import FFMPEG_VideoWriter from tqdm import tqdm from PIL import Image fr...
17
4
0
0
21
0
mturk/style_flame_disentanglement/plot_results.py
qiaone/GIF
322
1715865
import sys sys.path.append('../../') import constants as cnst import pandas import matplotlib.pyplot as plt; plt.rcdefaults() import numpy as np df = pandas.read_csv(cnst.five_pt_likert_scale_result_csv_path) results = df[['Input.image_url', 'Answer.category.label']].to_numpy() print(df) id_hist_dict = {} categori...
0
0
0
0
0
0
core/payload.py
barballs/koadic
2,255
1715907
import threading class Payload(object): PAYLOAD_ID: int = 0 PAYLOAD_ID_LOCK = threading.Lock() def __init__(self, data: str=""): self.data = data with Payload.PAYLOAD_ID_LOCK: self.id = Payload.PAYLOAD_ID Payload.PAYLOAD_ID += 1
1
0
1
0
2
0
core/func.py
EarthCompass/patchkit
631
1715908
<filename>core/func.py class Func: def __init__(self, pt, addr, size): self.pt = pt self.addr = addr self.size = size def dis(self): return self.pt.dis(self.addr, self.size) def read(self): return self.pt.elf.read(self.addr, self.size) def nop(self): se...
0
0
0
0
0
0
src/nitpick/cli.py
camresp/nitpick
251
1715916
"""Module that contains the command line app. Why does this file exist, and why not put this in __main__? You might be tempted to import things from __main__ later, but that will cause problems: the code will get executed twice: - When you run `python -mnitpick` python will execute ``__main__.py`` as a script. T...
5
2
1
0
8
0
utils/writer.py
suspiria/MelNet
190
1715930
from torch.utils.tensorboard import SummaryWriter from . import plotting as plt class MyWriter(SummaryWriter): def __init__(self, hp, logdir): super(MyWriter, self).__init__(logdir) self.hp = hp def log_training(self, train_loss, step): self.add_scalar('train_loss', train_loss, step...
0
0
0
0
0
0
replication_handler/components/mysql_tools.py
ywlianghang/mysql_streamer
419
1715943
<reponame>ywlianghang/mysql_streamer # -*- coding: utf-8 -*- # Copyright 2016 Yelp Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
0
0
0
0
0
0
apps/account/urls/journal.py
youssriaboelseod/pyerp
115
1715984
# Django Library from django.urls import path # Localfolder Library from ..views import ( JournalAutoComplete, JournalCreateView, JournalDeleteView, JournalDetailView, JournalListView, JournalUpdateView) app_name = 'PyJournal' urlpatterns = [ # ========================= Account Plan URL's ===============...
0
0
0
0
0
0
image-generation/slegan/train.py
AaratiAkkapeddi/nnabla-examples
228
1716017
<reponame>AaratiAkkapeddi/nnabla-examples # Copyright 2021 Sony Corporation. # Copyright 2021 Sony Group Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache...
0
0
0
0
0
0
parallelformers/utils/dist_utils.py
Oaklight/parallelformers
454
1716020
# Copyright 2021 TUNiB inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
3
5
0
1
9
0
comparison/masif_ppi_search_ub/zdock/parse_results.py
NBDsoftware/masif
309
1716021
<filename>comparison/masif_ppi_search_ub/zdock/parse_results.py import os import numpy as np stats = [] cpu_seconds = [] for dirname in os.listdir('03-results/'): full_dirname = os.path.join('03-results/',dirname) if not os.path.exists(full_dirname+'/results.txt'): continue results = open(full_dirn...
0
0
0
0
0
0
test/modules/losses/test_contrastive_loss_with_temperature.py
facebookresearch/multimodal
128
1716022
<reponame>facebookresearch/multimodal<filename>test/modules/losses/test_contrastive_loss_with_temperature.py # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. im...
0
0
0
0
0
0
SMPyBandits/PoliciesMultiPlayers/CentralizedMultiplePlay.py
balbok0/SMPyBandits
309
1716032
<reponame>balbok0/SMPyBandits # -*- coding: utf-8 -*- """ CentralizedMultiplePlay: a multi-player policy where ONE policy is used by a centralized agent; asking the policy to select nbPlayers arms at each step. """ from __future__ import division, print_function # Python 2 compatibility __author__ = "<NAME>" __versio...
0
0
0
0
0
0
env/PathVars.py
jeanqasaur/jeeves
253
1716063
import JeevesLib import fast.AST class VarSetting: def __init__(self, var, val): self.var = var self.val = val def __eq__(self, other) -> object: return self.var is other.var and self.val == other.val def __str__(self) -> object: return "(%s, %s)" % (self.var.name, self.val) # TODO: Define your ...
0
6
0
1
7
0
terrascript/provider/hashicorp/ciscoasa.py
mjuenema/python-terrascript
507
1716078
<reponame>mjuenema/python-terrascript # terrascript/provider/hashicorp/ciscoasa.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:14:03 UTC) import terrascript class ciscoasa(terrascript.Provider): """terraform-provider-ciscoasa""" __description__ = "terraform-provider-ciscoasa" __namesp...
0
0
0
0
0
0
tests/migrations/test_model_migration_9.py
dannyrohde/pydbantic
124
1716126
<gh_stars>100-1000 from logging import exception import time import random import uuid from typing import Optional, List from attr import has import pytest from pydbantic import Database, DataBaseModel, PrimaryKey, Default from pydantic import BaseModel def get_uuid(): return str(uuid.uuid4()) def get_random_na...
0
0
0
0
0
0
orochi/ya/forms.py
garanews/orochi
121
1716215
from django import forms from django_file_form.forms import ( FileFormMixin, MultipleUploadedFileField, ) class RuleForm(FileFormMixin, forms.Form): rules = MultipleUploadedFileField(required=False) def __init__(self, *args, **kwargs): super(RuleForm, self).__init__(*args, **kwargs) clas...
0
0
2
0
2
0
python/examples/triage/__init__.py
carsonharmon/binaryninja-api
589
1716244
from . import view from . import byte from . import files
0
0
0
0
0
0
cutkum/command_line.py
mrjummy/cutkum
169
1716301
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import argparse import logging from .tokenizer import Cutkum def main(): p = argparse.ArgumentParser() p.add_argument('-v', '--verbose', help='verbose', action='store_true') #p.add_argument('-m', '--model_file', required=True, hel...
0
0
0
0
0
0
tests/__init__.py
LaTueur/reddit-detective
173
1716342
<gh_stars>100-1000 import json import praw from neo4j import GraphDatabase from reddit_detective import VERSION with open("test_credentials.json") as test_cred_file: test_cred = json.load(test_cred_file) api_ = praw.Reddit( client_id=test_cred["client_id"], client_secret=test_cred["client_secret"], u...
0
0
0
0
0
0
tests/SampleApps/python/django-realworld-example-app/conduit/apps/profiles/renderers.py
samruddhikhandale/Oryx
403
1716435
from conduit.apps.core.renderers import ConduitJSONRenderer class ProfileJSONRenderer(ConduitJSONRenderer): object_label: str = 'profile' pagination_object_label: str = 'profiles' pagination_count_label: str = 'profilesCount'
0
0
3
0
3
0
src/super_gradients/training/datasets/segmentation_datasets/cityscape_segmentation.py
Deci-AI/super-gradients
308
1716439
<reponame>Deci-AI/super-gradients import os import cv2 import numpy as np from PIL import Image, ImageColor from super_gradients.training.datasets.segmentation_datasets.segmentation_dataset import SegmentationDataSet # TODO - ADD COARSE DATA - right now cityscapes dataset includes fine annotations. It's optional to us...
0
0
0
0
0
0
tests/test_housekeeping.py
LeroyR/graphitesend
122
1716455
import unittest2 as unittest import os import datetime class HouseKeeping(unittest.TestCase): def test_license_year(self): self.assertTrue(os.path.exists('LICENSE.txt')) now = datetime.datetime.now() current_year = datetime.datetime.strftime(now, '%Y') license_text = open('LICENSE...
0
0
0
0
0
0
2015/EasyCTF2015/Sum-It/sumit.py
Kage/CTF-Writeups
191
1716463
with open("addition.in", 'r') as fi: dump = fi.read() lst = [int(item) for item in dump.split(',')] with open("addition.out", 'w') as fo: fo.write(str(sum(lst)) + "\n")
0
0
0
0
0
0
backend/boards/admin.py
aibek79/Django-React-knboard
665
1716496
from adminsortable.admin import SortableAdmin from django.contrib import admin from .models import Board, Label, Column, Task class LabelAdmin(admin.ModelAdmin): list_display: list[str] = ["name", "board"] list_filter: list[str] = ["board"] search_fields: list[str] = ["name"] class Meta: mod...
0
0
3
0
3
0
src/skmultiflow/trees/_nodes/__init__.py
denisesato/scikit-multiflow
663
1716504
""" The :mod:`skmultiflow.trees.nodes` module includes learning and split node implementations for the hoeffding trees. """ # Base class nodes from .base import FoundNode from .base import Node from .base import SplitNode from .base import LearningNode from .base import ActiveLeaf from .base import InactiveLeaf # Hoef...
0
0
0
0
0
0
herokuapp/__init__.py
urkonn/django-herokuapp
262
1716522
<gh_stars>100-1000 """ A set of utilities and a project template for running Django sites on heroku. Developed by <NAME>. <http://www.etianen.com/> """ __version__ = (0, 9, 20)
0
0
0
0
0
0
AK-wang/0006/key_word.py
saurabh896/python-1
3,976
1716528
#!/usr/bin/env python # -*-coding:utf-8-*- # 第 0006 题:你有一个目录,放了你一个月的日记,都是 txt,为了避免分词的问题,假设内容都是英文,请统计出你认为每篇日记最重要的词。 import glob from collections import Counter import re def list_txt(): return glob.glob("*.txt") def wc(filename): datalist = [] with open(filename, 'r') as f: for line in f: ...
0
0
0
0
0
0
mici/states.py
matt-graham/mici
137
1716548
from __future__ import annotations """Objects for recording state of a Markov chain and caching computations.""" import copy from functools import wraps from collections import Counter from mici.errors import ReadOnlyStateError def _cache_key_func(system, method) -> tuple[str, object]: """Construct cache key for...
5
14
0
0
19
0
Hello World Programs/pracpython1.py
TeacherManoj0131/HacktoberFest2020-Contributions
256
1716573
sum = 0 while True: user_input = input("enter the item price or press q to quit: \n") if user_input!='q': sum = sum + int(user_input) print(f"order total so far: {sum}") else: print(f"your bill total is {sum}. thnks for visiting") break
0
0
0
0
0
0
src/test.py
mana-ysh/knowledge-graph-embeddings
248
1716587
import argparse from processors.evaluator import Evaluator from utils.dataset import TripletDataset, Vocab from utils.graph import * def test(args): ent_vocab = Vocab.load(args.ent) rel_vocab = Vocab.load(args.rel) # preparing data test_dat = TripletDataset.load(args.data, ent_vocab, rel_vocab) ...
0
0
0
0
0
0
intro/matplotlib/examples/options/plot_solid_joinstyle.py
junghun73/Learning
419
1716591
<reponame>junghun73/Learning """ Solid joint style ================== An example showing the differen solid joint styles in matplotlib. """ import numpy as np import matplotlib.pyplot as plt size = 256, 16 dpi = 72.0 figsize = size[0] / float(dpi), size[1] / float(dpi) fig = plt.figure(figsize=figsize, dpi=dpi) fig....
0
0
0
0
0
0
tests/fields/test_hidden.py
Ennkua/wtforms
1,197
1716595
from wtforms.fields import HiddenField from wtforms.form import Form class F(Form): a = HiddenField(default="LE DEFAULT") def test_hidden_field(): form = F() assert form.a() == """<input id="a" name="a" type="hidden" value="LE DEFAULT">""" assert form.a.flags.hidden
0
0
0
0
0
0
mlir/python/mlir/dialects/linalg/opdsl/lang/__init__.py
mkinsner/llvm
2,338
1716617
from .dsl import *
0
0
0
0
0
0
tests/test_mesh_expand.py
clazaro/sfepy
510
1716655
<filename>tests/test_mesh_expand.py from __future__ import absolute_import from sfepy.base.testing import TestCommon class Test(TestCommon): @staticmethod def from_conf(conf, options): test = Test(conf=conf, options=options) return test def test_mesh_expand(self): import numpy as ...
0
0
0
0
0
0
data_processing.py
DigiLog-N/RUL-Net
157
1716705
from __future__ import annotations import pandas as pd from matplotlib import pyplot as plt import numpy as np from sklearn.preprocessing import MinMaxScaler import random MAXLIFE = 120 SCALE = 1 RESCALE = 1 true_rul = [] test_engine_id = 0 training_engine_id = 0 def kink_RUL(cycle_list, max_cycle) ->...
17
6
0
0
23
0
reset_free_learning/envs/reset_free_wrapper.py
deepneuralmachine/google-research
23,901
1716750
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
14
12
0
22
48
0
tfmpl/plots/confusion_matrix.py
cuijianaaa/tf-matplotlib
115
1716753
# Copyright 2018 <NAME>. # # Licensed under MIT License # ============================================================ from __future__ import annotations import numpy as np import re from textwrap import wrap from itertools import product def from_labels_and_predictions(labels, predictions, num_classes) -> object: ...
2
1
0
0
3
0
test/make_a_call.py
bitigchi/MuditaOS
369
1716757
<gh_stars>100-1000 #!/usr/bin/env python # Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. # For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md import sys import time from harness import log from harness.harness import Harness from harness.interface.defs import key_codes, endpoint, metho...
0
0
0
0
0
0
examples/qp2q/utils/Config.py
xeisberg/pecos
288
1716779
from __future__ import annotations import json import random import os import numpy as np from pathlib import Path import logging LOGGER = logging.getLogger(__name__) class Config(object): def __init__(self, filename: object | None=None): self.config_name = filename self.base_res_dir: str = ".....
2
4
0
20
26
0
train.py
Woffee/deformer
114
1716784
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import argparse from datetime import datetime from common import logger from common import tf from common.builder import get_estimator from common.builder import input_fn_builder from common.config import get_config_from_args from features import get_record_parser from t...
0
0
0
0
0
0
tests/components/litejet/test_switch.py
MrDelik/core
30,023
1716788
<reponame>MrDelik/core """The tests for the litejet component.""" from homeassistant.components import switch from homeassistant.const import ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON from . import async_init_integration ENTITY_SWITCH = "switch.mock_switch_1" ENTITY_SWITCH_NUMBER = 1 ENTITY_OTHER_SWITCH = "sw...
0
0
0
0
0
0
tensorflow_toolkit/image_retrieval/tools/test.py
morkovka1337/openvino_training_extensions
256
1716811
""" Copyright (c) 2019 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wri...
0
1
0
0
1
0
Wenshu_Project/__init__.py
juvu/Wenshu_Spider
197
1716896
<gh_stars>100-1000 # !/user/bin/env python # -*- coding:utf-8 -*- # time: 2018/10/19--22:09 __author__ = 'Henry'
0
0
0
0
0
0
tests/utils/test_provider.py
rcy1314/RSSerpent
202
1716909
import math from typing import Any, Dict import pytest from hypothesis import given, infer, settings from rsserpent.utils import fetch_data from tests.conftest import Times async def provider( a: int, *, b: float, c: bool, d: int = 1, **_: Dict[str, Any] ) -> Dict[str, Any]: """Define an example data provid...
8
2
0
0
10
0
econml/automated_ml/__init__.py
imatiach-msft/EconML
1,846
1716916
<filename>econml/automated_ml/__init__.py # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from ._automated_ml import (setAutomatedMLWorkspace, addAutomatedML, AutomatedMLModel, AutomatedMLMixin, EconAutoMLConfig) __all__ = ["setAutomatedM...
0
0
0
0
0
0
osp/test/fields/models/subfield/test_make_regex.py
davidmcclure/open-syllabus-project
220
1716919
import pytest pytestmark = pytest.mark.usefixtures('db') def test_name(add_subfield): """ Subfield#make_regex() should build a query from the field name. """ subfield = add_subfield(name='Field') assert subfield.make_regex('{:s} regex') == '(Field|FIELD) regex' def test_name_and_abbreviat...
0
0
0
0
0
0
CondTools/DT/test/time_conv.py
ckamtsikis/cmssw
852
1716927
<reponame>ckamtsikis/cmssw # The following comments couldn't be translated into the new config version: # Configuration file for EventSetupTest_t import FWCore.ParameterSet.Config as cms process = cms.Process("TEST") process.source = cms.Source("EmptySource", numberEventsInRun = cms.untracked.uint32(1), fir...
0
0
0
0
0
0
rclpy/test/test_qos.py
RoboStack/rclpy
121
1716960
<gh_stars>100-1000 # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
0
0
0
0
0
0
tests/glucose/test_display.py
ijustlovemath/openaps
525
1717001
<reponame>ijustlovemath/openaps from unittest import TestCase from openaps.glucose.display import Display class DisplayTestCase (TestCase): """ Checks that the display function rounds to the correct number of significant digits """ def test_display_mmol_l(self): self.assertEqual(D...
0
0
0
0
0
0
DDDProxy/symmetryConnectServerHandler.py
wdongxv/DDDProxy
139
1717009
<reponame>wdongxv/DDDProxy #!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2015年11月18日 @author: dxw ''' import struct from DDDProxy.baseServer import sockConnect, socketBufferMaxLenght import json import hashlib from DDDProxy import log import time class symmetryConnect(sockConnect): """ @type remoteC...
0
0
0
0
0
0
slovnet/infer/syntax.py
harri-pltr/slovnet
147
1717025
<gh_stars>100-1000 from slovnet.markup import SyntaxMarkup from slovnet.mask import split_masked from .base import Infer class SyntaxDecoder: def __init__(self, rels_vocab): self.rels_vocab = rels_vocab def __call__(self, preds): for pred in preds: head_ids, rel_ids = pred ...
0
0
0
0
0
0
code/posenet-py-torch/posenet/models/__init__.py
sunyikang/paper
253
1717043
from posenet.models.mobilenet_v1 import MobileNetV1, MOBILENET_V1_CHECKPOINTS
0
0
0
0
0
0
ui/app/models.py
zhaoxinwo/zufang
122
1717044
<reponame>zhaoxinwo/zufang<gh_stars>100-1000 #coding: utf-8 from mongoengine import * class House(Document): hashurl = StringField(max_length=32) title = StringField() author = DictField() images = ListField() links = ListField() text = StringField() pub_time = StringField(ma...
0
0
0
0
0
0
sknetwork/topology/tests/test_structure.py
HerrZYZ/scikit-network
457
1717064
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """"tests for structure.py""" import unittest import numpy as np from scipy import sparse from sknetwork.data import star_wars, cyclic_digraph, linear_digraph, linear_graph from sknetwork.topology import get_largest_connected_component, is_bipartite, is_acyclic from skne...
0
0
0
0
0
0
texar/torch/utils/nest.py
qinzzz/texar-pytorch
746
1717068
# Apply from Tensorflow: # https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/util/nest.py """This module can perform operations on nested structures. A nested structure is a Python sequence, tuple (including `namedtuple`), or dict that can contain further sequences, tuples, and dicts. """ import ...
11
7
2
0
20
0
crypten/optim/sgd.py
knarflin/CrypTen
1,074
1717121
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import annotations import crypten from .optimizer import Optimizer class SGD(Optimizer): r"""Im...
5
1
0
0
6
0
CalibCalorimetry/EcalTrivialCondModules/python/ESTrivialCondRetrieverTB_cfi.py
ckamtsikis/cmssw
852
1717124
import FWCore.ParameterSet.Config as cms ESTrivialConditionRetriever = cms.ESSource("ESTrivialConditionRetriever", # Values to get correct noise on RecHit amplitude using 3+5 weights ESpedRMS = cms.untracked.double(1.26), weightsForTB = cms.untracked.bool(True), producedESPedestals = cms.untracke...
0
0
0
0
0
0
src/kpda_parser.py
gathierry/FashionAI-KeyPointsDetectionOfApparel
174
1717157
<reponame>gathierry/FashionAI-KeyPointsDetectionOfApparel<gh_stars>100-1000 import numpy as np from sklearn.model_selection import train_test_split import pandas as pd import cv2 class KPDA(): def __init__(self, config, data_dir, train_val): self.config = config if train_val == 'test': ...
0
0
0
0
0
0
examples/SpongeRollProblem2.py
rimaddo/pulp
1,418
1717174
""" The Simplified Sponge Roll Problem with Surplus and Trim for the PuLP Modeller Authors: <NAME>, Dr <NAME> 2007 """ # Import PuLP modeler functions from pulp import * # A list of all the roll lengths is created LenOpts = ["5", "7", "9"] rollData = { # Length Demand SalePrice "5": [150, 0.25], "7": [20...
0
0
0
0
0
0
tools/pyinstaller_hooks/runtime_raiden_contracts.py
tirkarthi/raiden
2,101
1717180
<filename>tools/pyinstaller_hooks/runtime_raiden_contracts.py import sys from pathlib import Path from raiden_contracts import contract_manager # `sys._MEIPASS` is the root of the extracted pyinstaller bundle base_path = Path(sys._MEIPASS) # type: ignore # pylint: disable=no-member # Patch location of compiled cont...
0
0
0
0
0
0
src/UQpy/Distributions/copulas/gumbel.py
marrov/UQpy
132
1717211
from UQpy.Distributions.baseclass import Copula from UQpy.Distributions.baseclass import DistributionContinuous1D from numpy import prod, log, ones, exp class Gumbel(Copula): """ Gumbel copula having cumulative distribution function .. math:: F(u_1, u_2) = \exp(-(-\log(u_1))^{\Theta} + (-\log(u_2))^{\The...
0
2
0
0
2
0
tests/stackoverflow/test_question_58827592.py
next-franciscoalgaba/python-benedict
365
1717222
# -*- coding: utf-8 -*- import unittest class stackoverflow_question_58827592_test_case(unittest.TestCase): def test_stackoverflow_question_58827592(self): """ https://stackoverflow.com/questions/58827592/is-there-a-way-to-convert-csv-columns-into-hierarchical-relationships """ f...
0
0
0
0
0
0
crowdsourcing/middleware/requirement.py
Kyeongan/crowdsource-platform
138
1717335
<gh_stars>100-1000 from django.http import JsonResponse from crowdsourcing.utils import get_worker_cache class RequirementMiddleware(): def __init__(self, get_response=None): self.get_response = get_response @staticmethod def process_view(request, view_func, view_args, view_kwargs): allo...
0
0
0
0
0
0
kgtk/unreify/kgtkunreifyvalues.py
vishalbelsare/kgtk
222
1717338
""" Unreify RDF values in KGTK files """ from argparse import ArgumentParser, Namespace import attr from pathlib import Path import sys import typing from kgtk.kgtkformat import KgtkFormat from kgtk.io.kgtkreader import KgtkReader, KgtkReaderMode, KgtkReaderOptions from kgtk.io.kgtkwriter import KgtkWriter from kgtk.u...
34
4
78
0
116
0
alipay/aop/api/domain/AlipayMarketingCampaignUserActivityvoucherBatchqueryModel.py
antopen/alipay-sdk-python-all
213
1717339
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayMarketingCampaignUserActivityvoucherBatchqueryModel(object): def __init__(self): self._scene_code = None self._voucher_status = None @property de...
0
0
0
0
0
0
api/utils.py
boscp/aws-ops-wheel
277
1717362
<reponame>boscp/aws-ops-wheel # Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://aws.amazon.com/apache2....
0
0
0
0
0
0
.ado/downloadAndroidDependencies.py
microsoft/react-native
118
1717377
import json import logging import maven_dependency_utils import os import re import shutil import subprocess import sys import time desired_sdk = os.getenv("ANDROID_SDK_ROOT") if not desired_sdk: logging.error("Environment variable ANDROID_SDK_ROOT must be set.") exit(-1) if os.getenv("ANDROI...
0
1
0
0
1
0
flaml/config.py
wuchihsu/FLAML
1,747
1717390
'''! * Copyright (c) 2020-2021 Microsoft Corporation. All rights reserved. * Licensed under the MIT License. ''' N_SPLITS = 5 RANDOM_SEED = 1 SPLIT_RATIO = 0.1 MEM_THRES = 4 * (1024 ** 3) SMALL_LARGE_THRES = 10000000 MIN_SAMPLE_TRAIN = 10000 CV_HOLDOUT_THRESHOLD = 100000 SAMPLE_MULTIPLY_FACTOR = 4
0
0
0
0
0
0
tests/test_key.py
f90/mir_eval
431
1717422
<filename>tests/test_key.py<gh_stars>100-1000 ''' Tests for mir_eval.key ''' import mir_eval import nose.tools import glob import json import numpy as np A_TOL = 1e-12 # Path to the fixture files REF_GLOB = 'data/key/ref*.txt' EST_GLOB = 'data/key/est*.txt' SCORES_GLOB = 'data/key/output*.json' def __unit_test_key...
0
0
0
0
0
0
checkov/cloudformation/checks/resource/aws/BackupVaultEncrypted.py
jamesholland-uk/checkov
4,013
1717424
from checkov.cloudformation.checks.resource.base_resource_value_check import BaseResourceValueCheck from checkov.common.models.enums import CheckCategories from checkov.common.models.consts import ANY_VALUE class BackupVaultEncrypted(BaseResourceValueCheck): def __init__(self): name = "Ensure Backup Vault...
0
2
0
0
2
0
vis.py
StevenWHU/facenet_pytorch_v2
324
1717455
from __future__ import print_function import argparse import torch from torch.autograd import Variable from torchvision import datasets, transforms from model import FaceModel from torchvision.datasets import ImageFolder from TripletFaceDataset import FaceDataset import math import os import seaborn as sns import numpy...
0
0
0
0
0
0
peeringdb_server/request.py
CyberFlameGO/peeringdb
224
1717465
from __future__ import annotations """ Django HTTPRequest utilities. """ from peeringdb_server.context import current_request def bypass_validation(request: object | None=None) -> bool | object: """ Return whether the specified request is to bypass certain data quality validations. (#741) If not re...
1
1
0
0
2
0
feedhq/reader/migrations/0001_initial.py
feedhq/feedhq
361
1717491
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import django.utils.timezone import feedhq.reader.models class Migration(migrations.Migration): dependencies: list[object] = [ migrations.swappable_dependency(setting...
0
0
2
0
2
0
cyvlfeat/hog/__init__.py
hubutui/cyvlfeat
103
1717511
<reponame>hubutui/cyvlfeat from .hog import hog
0
0
0
0
0
0
python/pysvso/py_pose_graph/frame.py
mfkiwl/SEMANTIC_VISUAL_SUPPORTED_ODEMETRY
191
1717554
from __future__ import annotations import numpy as np from enum import Enum import cv2 # we will use linear_assignment to quickly write experiments, # later a customerized KM algorithms with various optimization in c++ is employed # see https://github.com/berhane/LAP-solvers # This is used for "Complete Matching" and...
13
55
2
33
103
0
libtrellis/examples/config_to_bit.py
Keno/prjtrellis
256
1717565
<reponame>Keno/prjtrellis<filename>libtrellis/examples/config_to_bit.py #!/usr/bin/env python3 """ This example uses PyTrellis to convert the text-config from bit_to_config.py back to a bitstream """ import pytrellis import sys pytrellis.load_database("../../database") def get_next_nonblank(f): while True: ...
0
0
0
0
0
0
mmpose/models/registry.py
ssumin6/buob
367
1717592
<gh_stars>100-1000 from mmcv.utils import Registry BACKBONES = Registry('backbone') NECKS = Registry('neck') HEADS = Registry('head') LOSSES = Registry('loss') POSENETS = Registry('posenet')
0
0
0
0
0
0
functions/MaskRaster.py
mmfink/raster-functions
173
1717624
from __future__ import annotations import numpy as np class MaskRaster(): def __init__(self): self.name: str = "Mask Raster Function" self.description: str = "Applies a raster as the NoData mask of the input raster." def getParameterInfo(self) -> list[dict[str,None | bool | str]]: ...
0
3
0
2
5
0
src/sage/features/internet.py
UCD4IDS/sage
1,742
1717652
r""" Feature for testing if the Internet is available """ from . import Feature, FeatureTestResult class Internet(Feature): r""" A :class:`~sage.features.Feature` describing if Internet is available. Failure of connecting to the site "https://www.sagemath.org" within a second is regarded as internet...
0
2
0
0
2
0
pysplit/mapdesigner.py
haochiche/pysplit
110
1717659
from __future__ import annotations from __future__ import division, print_function import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap from .maplabeller import map_labeller, labelfile_reader class MapDesign(object): """Class for holding map design elements.""" def __...
20
1
0
3
24
0
tests/test_unit.py
cdown/tzupdate
143
1717671
#!/usr/bin/env python import tzupdate import httpretty import os import errno from unittest import mock import pytest from tests._test_utils import ( IP_ADDRESSES, FAKE_SERVICES, FAKE_TIMEZONE, FAKE_ZONEINFO_PATH, setup_basic_api_response, ) from hypothesis import given, settings, HealthCheck, assu...
0
0
0
0
0
0
dash-textarea-height.py
oriolmirosa/dash-recipes
932
1717674
<reponame>oriolmirosa/dash-recipes<filename>dash-textarea-height.py import dash import dash_core_components as dcc import dash_html_components as html app = dash.Dash() app.layout = html.Div( html.Div([ html.Div([ dcc.Textarea( id='input_query', placeholder='Ent...
0
0
0
0
0
0
mlcomp/db/models/docker.py
sUeharaE4/mlcomp
166
1717694
import sqlalchemy as sa from sqlalchemy import ForeignKey from mlcomp.db.models.base import Base class Docker(Base): __tablename__: str = 'docker' name = sa.Column(sa.String, primary_key=True) computer = sa.Column(sa.String, ForeignKey('computer.name'), ...
0
0
1
0
1
0
Pico_Four_Keypad/code.py
gamblor21/Adafruit_Learning_System_Guides
665
1717695
# SPDX-FileCopyrightText: 2021 <NAME> for Adafruit Industries # SPDX-License-Identifier: MIT # Pico Four Key USB HID Keypad import board from digitalio import DigitalInOut, Pull from adafruit_debouncer import Debouncer import usb_hid from adafruit_hid.keyboard import Keyboard from adafruit_hid.keycode import Keycode ...
0
0
0
0
0
0
ptt-parser/ptt/model.py
yuju13488/homework
332
1717705
class Push(): def __init__(self, **kwargs): self.author = kwargs.get('author') self.content = kwargs.get('content') self.datetime = kwargs.get('datetime') self.push = kwargs.get('push') def __str__(self) -> object: return '<Push> %s %s' % (self.push, self.author) clas...
0
3
1
0
4
0
Tests/import_extant/_vendor/packaging/version.py
aisk/ironpython3
1,872
1717710
<reponame>aisk/ironpython3<gh_stars>1000+ from ._structures import Infinity
0
0
0
0
0
0
omnizart/models/spectral_norm_net.py
nicolasanjoran/omnizart
1,145
1717721
<reponame>nicolasanjoran/omnizart<gh_stars>1000+ """Transcription model of drum leveraging spectral normalization. The model was originally developed with tensorflow 1.12. We rewrite the model with tensorflow 2.3 module and uses keras to implement most of the functionalities for better readability. Original Author: <...
0
0
0
0
0
0
python/queue/stack_use_queue.py
googege/algo-learn
153
1717771
<gh_stars>100-1000 # 使用队列实现一个栈 class MyStack: def __init__(self): """ Initialize your data structure here. """ self.input = [] def push(self, x: int) -> None: """ Push element x onto stack. """ self.input.append(x) if len(self.input) > ...
0
0
0
0
0
0
mlcomp/utils/torch.py
sUeharaE4/mlcomp
166
1717781
from __future__ import annotations import numpy as np from tqdm import tqdm import torch from torch.jit import load from torch.utils.data import DataLoader, Dataset from mlcomp.contrib.transform.tta import TtaWrap def apply_activation(x, activation) -> object: if not activation: return x if activati...
10
3
0
0
13
0
gobbli/dataset/cmu_movie_summary.py
RTIInternational/gobbli
276
1717810
import json from typing import List, Tuple import pandas as pd from gobbli.dataset.base import BaseDataset from gobbli.util import download_archive class MovieSummaryDataset(BaseDataset): """ gobbli Dataset for the CMU Movie Summary dataset, framed as a multilabel classification problem predicting movie...
1
7
3
0
11
0
airmozilla/search/split_search.py
mozilla/airmozilla
115
1717820
# -*- coding: utf-8 -* # # Split search string - Useful when building advanced search application # By: <NAME>, <EMAIL> # May 2008-2010 # Python # # Taken from http://www.peterbe.com/plog/split_search from __future__ import annotations import re __version__ = '1.4' def split_search(q, keywords) -> tuple[object, dic...
0
1
0
0
1
0
homeassistant/components/senseme/__init__.py
MrDelik/core
30,023
1717838
<reponame>MrDelik/core """The SenseME integration.""" from __future__ import annotations from aiosenseme import async_get_device_by_device_info from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady from .const import...
0
0
0
0
0
0
swagger/clients/pythonclient/test/test_stat_api.py
roylee17/chainquery
4,111
1717855
# coding: utf-8 """ Chain Query The LBRY blockchain is read into SQL where important structured information can be extracted through the Chain Query API. # noqa: E501 OpenAPI spec version: 0.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolu...
0
0
0
0
0
0
src/GridCal/Engine/Simulations/ATC/available_transfer_capacity_ts_driver.py
SanPen/GridCal
284
1717892
<gh_stars>100-1000 # This file is part of GridCal. # # GridCal is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # GridCal is distribut...
0
0
0
0
0
0
Packs/X509Certificate/Scripts/CertificateReputation/CertificateReputation_test.py
diCagri/content
799
1717902
from __future__ import annotations import pytest def load_json_data(path) -> object: import json with open(path, 'r') as f: return json.load(f) TEST_VECTORS = [ ('test_data/ca.json', 'test_data/ca_result.json'), ('test_data/messy.json', 'test_data/messy_result.json'), ] @pytest.mark.param...
0
3
0
0
3
0
apps/kv_storage/cachekeys.py
goztrk/django-htk
206
1717929
# HTK Imports from htk.cache import CustomCacheScheme from htk.constants import * class KVStorageCache(CustomCacheScheme): """Cache management object for key-value storage """ def get_cache_duration(self) -> object: duration = TIMEOUT_30_MINUTES return duration
0
1
0
0
1
0