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
doubleml/tests/test_plr_tune.py
SvenKlaassen/doubleml-for-py
103
1607446
import numpy as np import pytest import math from sklearn.base import clone from sklearn.linear_model import Lasso, ElasticNet import doubleml as dml from ._utils import draw_smpls from ._utils_plr_manual import fit_plr, boot_plr, tune_nuisance_plr @pytest.fixture(scope='module', params=[Lasso(), ...
0
7
0
0
7
0
torch_geometric/nn/conv/utils/inspector.py
mrmotallebi/pytorch_geometric
12,651
1607461
<reponame>mrmotallebi/pytorch_geometric import re import inspect from collections import OrderedDict from typing import Dict, List, Any, Optional, Callable, Set from .typing import parse_types class Inspector(object): def __init__(self, base_class: Any): self.base_class: Any = base_class self.par...
0
0
0
0
0
0
rdtools/test/soiling_test.py
kperrynrel/rdtools
107
1607475
<filename>rdtools/test/soiling_test.py<gh_stars>100-1000 import pandas as pd import numpy as np from rdtools.soiling import soiling_srr from rdtools.soiling import SRRAnalysis from rdtools.soiling import annual_soiling_ratios from rdtools.soiling import monthly_soiling_rates from rdtools.soiling import NoValidIntervalE...
0
0
0
0
0
0
tests/layers/test_mmd_loss_with_original.py
KevinMusgrave/pytorch-adapt
131
1607498
from __future__ import annotations import unittest import numpy as np import torch from pytorch_adapt.layers import MMDBatchedLoss, MMDLoss from pytorch_adapt.layers.utils import get_kernel_scales from .. import TEST_DEVICE # from https://github.com/thuml/Xlearn/blob/master/pytorch/src/loss.py def guassian_kernel(...
12
5
0
0
17
0
kaldi/patch/steps/libs/nnet3/train/frame_level_objf_20180105/common.py
ishine/asv-subtools
370
1607507
# Copyright 2016 <NAME>. # 2016 <NAME> # 2017 Johns Hopkins University (author: <NAME>) # Apache 2.0. from __future__ import annotations """ This is a module with methods which will be used by scripts for training of deep neural network acoustic model and raw model (i.e., generic neural network wi...
33
3
0
0
36
0
python-daemon/tests/common/test_profiling.py
cardosolucas/incubator-marvin-trytravis
101
1607525
<gh_stars>100-1000 #!/usr/bin/env python # coding=utf-8 # Copyright [2020] [Apache Software Foundation] # # 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/...
0
0
0
0
0
0
jupytext/pairs.py
st--/jupytext
5,378
1607529
"""Functions to read or write paired notebooks""" from collections import namedtuple import jupytext from .combine import combine_inputs_with_outputs from .compare import compare from .formats import ( check_file_version, long_form_multiple_formats, long_form_one_format, ) from .paired_paths import find_...
2
3
0
0
5
0
rotkehlchen/tests/utils/checks.py
rotkehlchenio/rotkehlchen
137
1607535
from typing import Dict, List, Optional from rotkehlchen.fval import FVal def assert_serialized_lists_equal( a: List, b: List, max_length_to_check: Optional[int] = None, ignore_keys: Optional[List] = None, length_list_keymap: Optional[Dict] = None, max_diff: str = "1e-...
12
2
0
0
14
0
sorts/random_pivot_quick_sort.py
Pratiyush27/Python
145,614
1607545
""" Picks the random index as the pivot """ import random def partition(A, left_index, right_index) -> object: pivot = A[left_index] i = left_index + 1 for j in range(left_index + 1, right_index): if A[j] < pivot: A[j], A[i] = A[i], A[j] i += 1 A[left_index...
0
1
0
0
1
0
tests/cupyx_tests/scipy_tests/ndimage_tests/test_interpolation.py
prkhrsrvstv1/cupy
6,180
1607550
<filename>tests/cupyx_tests/scipy_tests/ndimage_tests/test_interpolation.py<gh_stars>1000+ import numpy import pytest import cupy from cupy.cuda import runtime from cupy import testing import cupyx.scipy.ndimage from cupyx.scipy.ndimage import _util try: import scipy import scipy.ndimage scipy_version = n...
0
0
0
0
0
0
mindmeld/components/question_answerer.py
owanr/mindmeld
580
1607580
<filename>mindmeld/components/question_answerer.py # -*- coding: utf-8 -*- # # Copyright (c) 2015 Cisco Systems, Inc. and others. 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 Lice...
0
0
0
0
0
0
sdk/eventhub/azure-eventhub/tests/eventhub_preparer.py
rsdoherty/azure-sdk-for-python
2,728
1607590
<reponame>rsdoherty/azure-sdk-for-python<filename>sdk/eventhub/azure-eventhub/tests/eventhub_preparer.py #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # lice...
0
0
0
0
0
0
Providers/nxOMSAutomationWorker/automationworker/worker/automationrunbooktracer.py
chsamala2/PowerShell-DSC-for-Linux
154
1607616
<reponame>chsamala2/PowerShell-DSC-for-Linux<filename>Providers/nxOMSAutomationWorker/automationworker/worker/automationrunbooktracer.py #!/usr/bin/env python2 # # Copyright (C) Microsoft Corporation, All rights reserved. import os import configuration import tracer configuration.set_config({configuration.COMPONENT:...
0
0
0
0
0
0
modules/templates/historic/STL/config.py
himansu1997/eden
205
1607618
# -*- coding: utf-8 -*- from __future__ import annotations from collections import OrderedDict from gluon import current, DIV, H3, IS_EMPTY_OR, IS_IN_SET, IS_NOT_EMPTY, SPAN, URL from gluon.storage import Storage from s3 import S3Represent # Service type names INDIVIDUAL_SUPPORT = "Individual Support" MENTAL_HEALTH...
5
32
0
0
37
0
regipy/regdiff.py
kamnon/regipy
190
1607651
import os from typing import Any, Set, Tuple import logging from regipy.exceptions import RegistryKeyNotFoundException from regipy.registry import RegistryHive, NKRecord from regipy.utils import convert_wintime, calculate_sha1 logger = logging.getLogger(__name__) def get_subkeys_and_timestamps(registry_hive) -> o...
2
3
1
0
6
0
test/test_detectors.py
TorchDrift/TorchDrift
200
1607656
import pytest import functools import torchdrift import torch def test_detector(): x = torch.randn(5, 5) d = torchdrift.detectors.Detector() d.fit(x) with pytest.raises(NotImplementedError): d(x) def _test_detector_class(cls): devices = ['cpu'] + (['cuda'] if torch.cuda.is_available() el...
1
2
0
0
3
0
keras_text/data.py
wasimakh2/keras-text
455
1607661
<gh_stars>100-1000 from __future__ import absolute_import import logging import numpy as np from .import utils from .import sampling from sklearn.preprocessing import MultiLabelBinarizer, LabelBinarizer from sklearn.model_selection import StratifiedShuffleSplit logger = logging.getLogger(__name__) class Dataset(...
0
0
0
0
0
0
platypush/message/response/translate.py
RichardChiang/platypush
228
1607691
<reponame>RichardChiang/platypush from platypush.message.response import Response class TranslateResponse(Response): def __init__(self, translated_text: str, source_text: str, detected_source_language: str, *args, **kwargs): ...
0
0
0
0
0
0
caltrain/calibration_metrics.py
DionysisChristopoulos/google-research
23,901
1607729
<filename>caltrain/calibration_metrics.py # 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/L...
0
0
0
0
0
0
core/dbt/deprecations.py
f1fe/dbt
3,156
1607740
from typing import Optional, Set, List, Dict, ClassVar import dbt.exceptions from dbt import ui import dbt.tracking class DBTDeprecation: _name: ClassVar[Optional[str]] = None _description: ClassVar[Optional[str]] = None @property def name(self) -> str: if self._name is not None: ...
2
4
12
0
18
0
skyfield/tests/test_strs_and_reprs.py
facorazza/python-skyfield
765
1607751
<reponame>facorazza/python-skyfield import textwrap from ..api import Topos, load, wgs84 from ..sgp4lib import EarthSatellite lines = [ 'ISS (ZARYA) ', '1 25544U 98067A 13330.58127943 .00000814 00000-0 21834-4 0 1064', '2 25544 51.6484 23.7537 0001246 74.1647 18.7420 15.50540527859894...
0
0
0
0
0
0
playground/detection/coco/atss/atss.res50.fpn.coco.800size.1x/config.py
hanqiu-hq/cvpods
548
1607763
import os.path as osp from cvpods.configs.fcos_config import FCOSConfig _config_dict = dict( MODEL=dict( WEIGHTS="detectron2://ImageNetPretrained/MSRA/R-50.pkl", RESNETS=dict(DEPTH=50), FCOS=dict( CENTERNESS_ON_REG=True, NORM_REG_TARGETS=True, NMS_THRESH...
0
0
0
0
0
0
test/test_xadc.py
skiphansen/litex-buildenv
198
1607771
from litex.tools.litex_client import RemoteClient wb = RemoteClient("192.168.1.50", 1234, csr_data_width=8) wb.open() regs = wb.regs # # # print("temperature: %f°C" %(regs.xadc_temperature.read()*503.975/4096 - 273.15)) print("vccint: %fV" %(regs.xadc_vccint.read()/4096*3)) print("vccaux: %fV" %(regs.xadc_vccaux.rea...
0
0
0
0
0
0
src/lib_ext/webrtc/webrtc/webrtc.gyp
saurabhshri/CCAligner
139
1607780
# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All contributing project au...
0
0
0
0
0
0
test/integration/049_dbt_debug_test/test_debug.py
jankytara2/dbt
3,156
1607794
from __future__ import annotations from test.integration.base import DBTIntegrationTest, use_profile import os import re import yaml import pytest class TestDebug(DBTIntegrationTest): @property def schema(self) -> str: return 'dbt_debug_049' @staticmethod def dir(value) -> object: r...
0
8
0
0
8
0
dojo/group/queries.py
mtcolman/django-DefectDojo
1,772
1607815
<filename>dojo/group/queries.py from crum import get_current_user from django.db.models import Exists, OuterRef from django.conf import settings from dojo.models import Dojo_Group, Dojo_Group_Member, Product_Group, Product_Type_Group, Role from dojo.authorization.authorization import get_roles_for_permission from dojo....
0
0
0
0
0
0
IDLE-files/grade.py
arvidl/dynamical-systems-with-applications-using-python
106
1607819
<reponame>arvidl/dynamical-systems-with-applications-using-python<gh_stars>100-1000 # A program to grade student results. # Save file as grade.py. # Run the Module (or type F5). def grade(score): if score >= 70: letter = 'A' elif score >= 60: letter = 'B' elif score >= 50: letter = ...
0
0
0
0
0
0
tests/conftest.py
arkjinli/understat
114
1607845
import aiohttp import pytest from understat import Understat @pytest.fixture() async def understat(): session = aiohttp.ClientSession() fpl = Understat(session) yield fpl await session.close()
0
0
0
0
0
0
mltrace/db/migrations/versions/8d252c0dc636_notes_field_for_componentrun.py
jeannefukumaru/mltrace
328
1607861
"""Notes field for ComponentRun Revision ID: 8d252c0dc636 Revises: <KEY> Create Date: 2021-05-26 09:52:19.057302 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "8d252c0dc636" down_revision = "<KEY>" branch_labels = None depends_on = None def upgrade(): o...
0
0
0
0
0
0
h2o-py/tests/testdir_algos/glm/pyunit_mean_residual_deviance_glm.py
ahmedengu/h2o-3
6,098
1607867
import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.estimators.glm import H2OGeneralizedLinearEstimator def glm_mean_residual_deviance(): cars = h2o.import_file(path=pyunit_utils.locate("smalldata/junit/cars_20mpg.csv")) s = cars[0].runif() train = cars[s > 0.2] vali...
0
0
0
0
0
0
python/paddle_fl/mpc/tests/unittests/test_op_pool.py
barrierye/PaddleFL
379
1607877
# Copyright (c) 2020 PaddlePaddle Authors. 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 # # Unless required by app...
0
0
0
0
0
0
DQMOffline/JetMET/test/run_PromptAna33X.py
ckamtsikis/cmssw
852
1607903
from __future__ import print_function ##----- # Set job-specific inputs based on shell # the following enviromental variables # export COSMIC_MODE=True # or False # export JOB_NAME="CosmicStream112220" # export NEVENTS=1000 # export ALL_HISTS=True # export TRIGGER_SET=HLT # export READ_LIST_FROM_FILE=False # or True # ...
0
0
0
0
0
0
desktop/core/ext-py/eventlet-0.24.1/examples/recursive_crawler.py
kokosing/hue
5,079
1607917
<filename>desktop/core/ext-py/eventlet-0.24.1/examples/recursive_crawler.py """This is a recursive web crawler. Don't go pointing this at random sites; it doesn't respect robots.txt and it is pretty brutal about how quickly it fetches pages. The code for this is very short; this is perhaps a good indication that this...
0
0
0
0
0
0
impacket/examples/ntlmrelayx/clients/smbrelayclient.py
kamnsv/impacket
6,612
1607934
<filename>impacket/examples/ntlmrelayx/clients/smbrelayclient.py # Impacket - Collection of Python classes for working with network protocols. # # SECUREAUTH LABS. Copyright (C) 2020 SecureAuth Corporation. All rights reserved. # # This software is provided under a slightly modified version # of the Apache Software Lic...
0
0
0
0
0
0
samples/world_grid.py
jtiai/ursina
1,431
1607941
<reponame>jtiai/ursina from ursina import * app = Ursina() r = 8 for i in range(1, r): t = i/r s = 4*i print(s) grid = Entity(model=Grid(s,s), scale=s, color=color.color(0,0,.8,lerp(.8,0,t)), rotation_x=90, y=i/1000) subgrid = duplicate(grid) subgrid.model = Grid(s*4, s*4) subgrid.color =...
0
0
0
0
0
0
RecoLocalMuon/CSCSegment/test/run_on_simdigi_tc.py
ckamtsikis/cmssw
852
1607986
## Process sim digi events with CSC rechit & segment builders - <NAME> - 12.02.2015 ## This version runs in 7_4_0_preX on a 7_3_0 simulated data DIGI relval sample. ## -- USING OLD ALGO 'TC' ## Run on 100 events of a 25ns PU TTbar sample import FWCore.ParameterSet.Config as cms process = cms.Process("TEST") pr...
0
0
0
0
0
0
modules/js/src/templates.py
thisisgopalmandal/opencv
56,632
1608023
<gh_stars>1000+ ############################################################################### # # IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. # # By downloading, copying, installing or using the software you agree to this license. # If you do not agree to this license, do not download, instal...
0
0
0
0
0
0
app/models.py
digomes87/blog
343
1608025
from django.db import models from django.core.urlresolvers import reverse # Create your models here. class Article(models.Model): STATUS_CHOICES: tuple[tuple[str, str], tuple[str, str]] = ( ('d', 'part'), ('p', 'Published'), ) # 文章的状态 title = models.CharField('标题', max_length=100) b...
0
6
2
0
8
0
tensorflow_hub/tools/module_search/search_test.py
m0tchy/hub
3,234
1608043
# Copyright 2019 The TensorFlow Hub Authors. 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 # # Unless required by app...
0
3
0
0
3
0
backend/data_export/pipeline/factories.py
arcada-uas/doccano
2,082
1608049
<filename>backend/data_export/pipeline/factories.py from typing import Dict, List, Type from django.db.models import QuerySet from . import writers from .catalog import CSV, JSON, JSONL, FastText from .formatters import ( DictFormatter, FastTextCategoryFormatter, Formatter, JoinedCategoryFormatter, ...
0
0
0
0
0
0
venv/Lib/site-packages/pandas/core/groupby/numba_.py
EkremBayar/bayar
603
1608051
"""Common utilities for Numba operations with groupby ops""" import inspect from typing import Any, Callable, Dict, Optional, Tuple import numpy as np from pandas._typing import Scalar from pandas.compat._optional import import_optional_dependency from pandas.core.util.numba_ import ( NUMBA_FUNC_CACHE, Numba...
21
5
0
0
26
0
src/genie/libs/parser/iosxe/tests/ShowEnvAll/cli/equal/golden_output_expected.py
balmasea/genieparser
204
1608055
expected_output = { 'switch': { "1": { 'fan': { "1": { 'state': 'ok' }, "2": { 'state': 'ok' }, "3": { 'state': 'ok' } }, ...
0
0
0
0
0
0
test/refactor/import_tree/inline_mod.py
kirat-singh/jedi
4,213
1608096
<filename>test/refactor/import_tree/inline_mod.py inline_var = 5 + 3
0
0
0
0
0
0
caffe2/python/operator_test/wngrad_test.py
Hacky-DH/pytorch
60,067
1608118
<reponame>Hacky-DH/pytorch import functools import logging import hypothesis from hypothesis import given, settings, HealthCheck import hypothesis.strategies as st import numpy as np from caffe2.python import core import caffe2.python.hypothesis_test_util as hu import caffe2.python.serialized_test.serialized_te...
0
0
0
0
0
0
tests/sparse_product/test_sparse_weighted_average_gpu.py
SamuelCahyawijaya/fast-transformers
1,171
1608120
<reponame>SamuelCahyawijaya/fast-transformers # # Copyright (c) 2020 Idiap Research Institute, http://www.idiap.ch/ # Written by <NAME> <<EMAIL>>, # <NAME> <<EMAIL>> # import os from os import getenv import unittest import torch from fast_transformers.sparse_product import sparse_weighted_average class TestSparseW...
0
0
0
0
0
0
mirage/libs/esb.py
tlechien/mirage
123
1608134
from scapy.all import * from mirage.core.module import WirelessModule from mirage.libs.esb_utils.scapy_esb_layers import * from mirage.libs.esb_utils.packets import * from mirage.libs.esb_utils.constants import * from mirage.libs.esb_utils.dissectors import * from mirage.libs.esb_utils.rfstorm import * from mirage.libs...
2
2
0
0
4
0
examples/redis/redis-example.py
minegit/ignite
4,339
1608148
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
0
0
0
0
0
0
salt/modules/statuspage.py
markgras/salt
9,425
1608162
from __future__ import annotations """ StatusPage ========== Handle requests for the StatusPage_ API_. .. _StatusPage: https://www.statuspage.io/ .. _API: http://doers.statuspage.io/api/v1/ In the minion configuration file, the following block is required: .. code-block:: yaml statuspage: api_key: <API_KEY> ...
29
10
0
0
39
0
virtual/lib/python3.6/site-packages/pip/__init__.py
Lornakimani62/IP4-_One-Minute-Pitch
548
1608166
__version__ = "10.0.1"
0
0
0
0
0
0
src/opendr/perception/activity_recognition/x3d/x3d_learner.py
ad-daniel/opendr
217
1608172
<gh_stars>100-1000 # Copyright 2020-2022 OpenDR European Project # # 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 appl...
0
0
0
0
0
0
autogl/module/hpo/bayes_advisor.py
general502570/AutoGL
824
1608181
<filename>autogl/module/hpo/bayes_advisor.py import hyperopt from . import register_hpo from .advisorbase import AdvisorBaseHPOptimizer from .suggestion.algorithm.bayesian_optimization import BayesianOptimization @register_hpo("bayes") class BayesAdvisor(AdvisorBaseHPOptimizer): """ Bayes algorithm in `advis...
0
0
0
0
0
0
valideer/base.py
timgates42/valideer
169
1608196
from __future__ import annotations import inspect from contextlib import contextmanager from threading import RLock from decorator import decorator from .compat import with_metaclass, iteritems __all__ = [ "ValidationError", "SchemaError", "Validator", "accepts", "returns", "adapts", "parse", "parsing", "regis...
4
17
1
1
23
0
env/lib/python3.8/site-packages/plotly/validators/scattergl/error_y/__init__.py
acrucetta/Chicago_COVI_WebApp
11,750
1608206
<gh_stars>1000+ import sys if sys.version_info < (3, 7): from ._width import WidthValidator from ._visible import VisibleValidator from ._valueminus import ValueminusValidator from ._value import ValueValidator from ._type import TypeValidator from ._tracerefminus import TracerefminusValidator ...
0
0
0
0
0
0
tests/spark/models/test_spark_configuration.py
Geims83/aztk
161
1608207
<filename>tests/spark/models/test_spark_configuration.py from aztk.spark.models import SparkConfiguration from aztk.error import InvalidModelError def test_spark_configuration_defaults(): spark_configuration = SparkConfiguration() spark_configuration.validate() assert spark_configuration.spark_defaults_c...
0
0
0
0
0
0
dialogue-engine/src/programy/storage/stores/nosql/redis/engine.py
cotobadesign/cotoba-agent-oss
104
1608226
""" Copyright (c) 2020 COTOBA DESIGN, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
0
0
0
0
0
0
TopQuarkAnalysis/TopEventProducers/python/producers/TopDecaySubset_cfi.py
ckamtsikis/cmssw
852
1608227
import FWCore.ParameterSet.Config as cms # # module to make a persistent copy of the genParticles from the top decay, # using either status 2 equivalent particles (default) or status 3 particles # decaySubset = cms.EDProducer("TopDecaySubset", ## input particle collection of type edm::View<reco::GenParticle> src =...
0
0
0
0
0
0
integration/send_packet.py
krishna4741/UsbSerial
1,545
1608248
<filename>integration/send_packet.py # UsbSerial test: Sending single packet # args: # port (eg /dev/ttyUSB0) # size in bytes (eg 1024) # speed in bauds (eg 115200) import serial import sys import os port = sys.argv[1] size = sys.argv[2] speed = sys.argv[3] comm = serial.Serial(port, int(speed)) data_tx = os....
0
0
0
0
0
0
dadmatools/models/flair/visual/manifold.py
njzr/DadmaTools
161
1608264
import numpy import tqdm from sklearn.manifold import TSNE class _Transform: def __init__(self): pass def fit(self, X) -> object: return self.transform.fit_transform(X) class tSNE(_Transform): def __init__(self): super().__init__() self.transform = TSNE(n_components=2, ...
0
5
0
0
5
0
powerline/lint/spec.py
MrFishFinger/powerline
11,435
1608268
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import itertools import re from copy import copy from powerline.lib.unicode import unicode from powerline.lint.markedjson.error import echoerr, DelayedEchoErr, NON_PRINTABLE_STR from powerline.lint.self...
0
0
0
0
0
1
applications/PFEM2Application/python_scripts/pfem_2_base_solver.py
lkusch/Kratos
778
1608290
<gh_stars>100-1000 from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7 from importlib import import_module # Importing the Kratos Library import KratosMultiphysics as KM from KratosMultiphysics.python_solver import PythonSolver # Impo...
0
0
0
0
0
0
saleor/graphql/wishlist/types.py
fairhopeweb/saleor
15,337
1608301
<reponame>fairhopeweb/saleor import graphene from ...wishlist import models from ..core.connection import CountableDjangoObjectType class Wishlist(CountableDjangoObjectType): class Meta: only_fields = ["id", "created_at", "items"] description = "Wishlist item." interfaces = [graphene.rela...
0
0
0
0
0
0
mmtrack/core/track/transforms.py
BigBen0519/mmtracking
2,226
1608336
# Copyright (c) OpenMMLab. All rights reserved. from __future__ import annotations import mmcv import numpy as np import torch from mmdet.core import bbox2result def imrenormalize(img, img_norm_cfg, new_img_norm_cfg) -> object: """Re-normalize the image. Args: img (Tensor | ndarray): Input image. If ...
8
4
0
0
12
0
python/179 Largest Number.py
allandproust/leetcode-share
156
1608341
''' Given a list of non negative integers, arrange them such that they form the largest number. For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330. Note: The result may be very large, so you need to return a string instead of an integer. ''' from functools import cmp_to_key class...
0
1
0
0
1
0
src/python/grpcio_tests/tests/unit/_rpc_part_2_test.py
goodarzysepideh/grpc
36,552
1608353
<filename>src/python/grpcio_tests/tests/unit/_rpc_part_2_test.py # Copyright 2016 gRPC 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-...
0
0
0
0
0
0
scripts/Assemble.py
AustinHartman/shasta
267
1608359
<filename>scripts/Assemble.py<gh_stars>100-1000 #!/usr/bin/python3 import shasta import GetConfig import ast # Read the config file. config = GetConfig.getConfig() # Create the Assembler. a = shasta.Assembler() # Set up the consensus caller. a.setupConsensusCaller(config['Assembly']['consensusCaller']) a.accessKme...
0
0
0
0
0
0
tests/core/pm-module/test_pm_init.py
bhardwajRahul/web3.py
3,041
1608373
import json import pytest from ethpm import ( Package, ) from ethpm.exceptions import ( InsufficientAssetsError, ) from ethpm.tools import ( get_ethpm_local_manifest, get_ethpm_spec_manifest, ) from web3.exceptions import ( PMError, ) def test_pm_init_with_minimal_manifest(w3): owned_manifest...
0
1
0
0
1
0
integration/tests/multilines.py
youhavethewrong/hurl
1,013
1608379
<filename>integration/tests/multilines.py from tests import app @app.route("/multilines") def multilines(): return 'line1\nline2\nline3\n'
0
0
0
0
0
0
tensorflow/python/distribute/model_collection/simple_models.py
abhaikollara/tensorflow
848
1608386
# Copyright 2019 The TensorFlow Authors. 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 # # Unless required by applica...
0
15
1
0
16
0
gammapy/utils/coordinates/other.py
Rishank2610/gammapy
155
1608390
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import annotations """Other coordinate and distance-related functions""" import numpy as np from astropy.units import Quantity, Unit __all__ = [ "cartesian", "galactic", "velocity_glon_glat", "motion_since_birth", "pola...
1
5
0
0
6
0
mitmproxy/addons/modifybody.py
KarlParkinson/mitmproxy
24,939
1608396
import re import typing from mitmproxy import ctx, exceptions from mitmproxy.addons.modifyheaders import parse_modify_spec, ModifySpec class ModifyBody: def __init__(self): self.replacements: typing.List[ModifySpec] = [] def load(self, loader): loader.add_option( "modify_body", t...
0
2
0
1
3
0
scripts/contractInteraction/misc.py
omerzam/Sovryn-smart-contracts
108
1608406
from brownie import * from brownie.network.contract import InterfaceContainer import json import time; import copy from scripts.utils import * import scripts.contractInteraction.config as conf def redeemFromAggregator(aggregatorAddress, tokenAddress, amount): abiFile = open('./scripts/contractInteraction/ABIs/ag...
0
0
0
0
0
0
src/oscar/apps/offer/applicator.py
QueoLda/django-oscar
4,639
1608422
from __future__ import annotations import logging from itertools import chain from oscar.core.loading import get_class, get_model logger = logging.getLogger('oscar.offers') OfferApplications = get_class('offer.results', 'OfferApplications') class OfferApplicationError(Exception): pass class Applicator(object)...
4
5
0
0
9
0
Advanced workshops/AI Driving Olympics 2019/challenge_train_DQN/src/markov/utils.py
espittle/aws-deepracer-workshops
1,116
1608426
from __future__ import annotations import json import logging import os import sys import signal import socket import time import datetime import inspect from collections import OrderedDict SIMAPP_VERSION="1.0" SIMAPP_SIMULATION_WORKER_EXCEPTION = "simulation_worker.exceptions" SIMAPP_TRAINING_WORKER_EXCEPTION = "tra...
1
4
1
1
7
0
tests/providers/google/cloud/operators/test_text_to_speech.py
holly-evans/airflow
8,092
1608451
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
0
0
0
0
0
0
system.d/library/tools_installer/tools_to_install/responder/tools/MultiRelay/creddump/framework/win32/hashdump.py
CraftyBastard/PiBunny
201
1608454
# This file is part of creddump. # # creddump 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. # # creddump is distributed in the hope t...
0
0
0
0
0
0
starfish/core/image/Filter/test/test_zero_by_channel_magnitude.py
haoxusci/starfish
164
1608459
import numpy as np from starfish import ImageStack from starfish.core.image.Filter.zero_by_channel_magnitude import ZeroByChannelMagnitude def create_imagestack_with_magnitude_scale() -> object: """create an imagestack with increasing magnitudes""" data = np.linspace(0, 1, 11, dtype=np.float32) data = np....
0
1
0
0
1
0
homeassistant/components/bosch_shc/config_flow.py
MrDelik/core
30,023
1608472
<reponame>MrDelik/core<filename>homeassistant/components/bosch_shc/config_flow.py """Config flow for Bosch Smart Home Controller integration.""" import logging from os import makedirs from boschshcpy import SHCRegisterClient, SHCSession from boschshcpy.exceptions import ( SHCAuthenticationError, SHCConnectionE...
0
0
0
0
0
0
scitbx/array_family/shared.py
dperl-sol/cctbx_project
155
1608485
from __future__ import absolute_import, division, print_function import scitbx.stl.vector # import dependency import boost_adaptbx.boost.python as bp bp.import_ext("scitbx_array_family_shared_ext") from scitbx_array_family_shared_ext import * import scitbx_array_family_shared_ext as ext class pickle_import_trigger(ob...
0
1
0
0
1
0
demo/demo.py
erjel/SOTR
158
1608492
<reponame>erjel/SOTR # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import argparse import glob import multiprocessing as mp import os import time import cv2 import tqdm from detectron2.data.detection_utils import read_image from detectron2.utils.logger import setup_logger from predictor impor...
0
0
0
0
0
0
ParlAI/parlai/mturk/tasks/image_chat/igc_evals/task_configs/task_config_responses.py
UmaTaru/run
163
1608499
<reponame>UmaTaru/run # 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. task_config = {} """A short and descriptive title about the kind of task the HIT contains. On the Amazon Mechanical Turk ...
0
0
0
0
0
0
project/test_fun.py
wei/listen-now
157
1608502
import sys sys.path.append('..') #必须要, 设置project为源程序的包顶 # encoding:utf-8 import io import sys sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8') ''' 功能测试脚本 ''' # from project.Scrawl.QQMusic import QQMusic # app1 = QQMusic.QQMusic() # print(app1.search_by_keyword('纸短情长')) # print(app1.search_by_id(...
0
0
0
0
0
0
gui/widgets/py_table_widget/style.py
ZETOsfx/PyOneDark_Qt_Widgets_Modern_GUI
318
1608532
# STYLE # /////////////////////////////////////////////////////////////// style = ''' /* ///////////////////////////////////////////////////////////////////////////////////////////////// QTableWidget */ QTableWidget {{ background-color: {_bg_color}; padding: 5px; border-radius: {_radius}px; gridline-col...
0
0
0
0
0
0
mayan/apps/storage/tests/test_management_commands.py
nattangwiwat/Mayan-EDMS-recitation
336
1608545
<filename>mayan/apps/storage/tests/test_management_commands.py<gh_stars>100-1000 from django.core import management from django.utils.encoding import force_text from mayan.apps.documents.tests.base import GenericDocumentTestCase from mayan.apps.documents.storages import storage_document_files from mayan.apps.mimetype....
0
0
0
0
0
0
management/backup.py
steadfasterX/mailinabox
8,706
1608547
<reponame>steadfasterX/mailinabox<gh_stars>1000+ #!/usr/local/lib/mailinabox/env/bin/python # This script performs a backup of all user data: # 1) System services are stopped. # 2) STORAGE_ROOT/backup/before-backup is executed if it exists. # 3) An incremental encrypted backup is made using duplicity. # 4) The stopped...
0
0
0
0
0
0
oauth/utils.py
giuseppe/quay
2,027
1608559
<filename>oauth/utils.py<gh_stars>1000+ # Ported to Python 3 # Originally from https://github.com/DeprecatedCode/oauth2lib/blob/d161b010f8a596826050a09e5e94d59443cc12d9/oauth2lib/provider.py import string import urllib.parse from random import SystemRandom UNICODE_ASCII_CHARACTERS = string.ascii_letters + string.digi...
0
0
0
0
0
0
tensorflow_toolkit/bert/squad_large_export.py
morkovka1337/openvino_training_extensions
256
1608560
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
0
8
0
0
8
0
docs/examples/holygrail_py3.py
jamezpolley/begins
120
1608570
import begin @begin.start def run(name: 'What, is your name?', quest: 'What, is your quest?', colour: 'What, is your favourite colour?'): pass
3
0
0
0
3
0
release/stubs.min/System/__init___parts/String.py
htlcnn/ironpython-stubs
182
1608572
<gh_stars>100-1000 class String(object): """ Represents text as a series of Unicode characters. str(value: Char*) str(value: Char*,startIndex: int,length: int) str(value: SByte*) str(value: SByte*,startIndex: int,length: int) str(value: SByte*,startIndex: int,length: int,enc: Encoding) ...
0
0
0
0
0
0
speedml/model.py
Dennis055/speedml
212
1608586
""" Speedml Model component with methods that work on sklearn models workflow. Contact author https://twitter.com/manavsehgal. Code, docs and demos https://speedml.com. """ from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * from .base im...
0
2
0
0
2
0
cfn_tools/__init__.py
thomasrockhu-codecov/aws-cfn-template-flip
904
1608594
""" 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/ or in the "license" file accompanying t...
0
4
0
0
4
0
InnerEye/ML/SSL/lightning_modules/simclr_module.py
faz1993/InnerEye-DeepLearning
402
1608599
# ------------------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # -------------------------------------------------------------------...
14
7
0
0
21
0
pyNastran/bdf/test/unit/test_read_write.py
ACea15/pyNastran
293
1608659
import os import unittest from io import StringIO from cpylog import SimpleLogger import pyNastran from pyNastran.bdf.bdf import BDF, read_bdf from pyNastran.bdf.bdf_interface.pybdf import BDFInputPy from pyNastran.bdf.bdf_interface.include_file import ( split_filename_into_tokens, get_include_filename, PurePo...
0
0
0
0
0
0
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
dan-zheng/llvm-project
456
1608660
<filename>lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py # coding=utf8 """ Test lldb data formatter subsystem. """ from __future__ import print_function import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbte...
0
0
0
0
0
0
examples/from-wiki/rotate.py
hesom/pycuda
1,264
1608661
<gh_stars>1000+ #!python #!/usr/bin/env python -tt # encoding: utf-8 # # Created by <NAME> on 2009-03-11. # <EMAIL> # import pycuda.driver as cuda import pycuda.compiler import pycuda.autoinit import numpy from math import pi,cos,sin _rotation_kernel_source = """ texture<float, 2> tex; __global__ void copy_texture_...
0
0
0
0
0
0
mmrazor/models/architectures/base.py
hunto/mmrazor
553
1608687
<gh_stars>100-1000 # Copyright (c) OpenMMLab. All rights reserved. from mmcv.cnn import MODELS from mmcv.runner import BaseModule class BaseArchitecture(BaseModule): """Base class for architecture. Args: model (:obj:`torch.nn.Module`): Model to be slimmed, such as ``DETECTOR`` in MMDetect...
0
0
0
0
0
0
django/core/management/commands/createcachetable.py
huicheese/Django-test
118
1608699
<gh_stars>100-1000 from optparse import make_option from django.core.cache.backends.db import BaseDatabaseCache from django.core.management.base import LabelCommand, CommandError from django.db import connections, router, transaction, models, DEFAULT_DB_ALIAS from django.db.utils import DatabaseError from django.utils...
0
0
0
0
0
0
tests/tensortrade/unit/stochastic/processes/test_cox.py
nicomon24/tensortrade
3,081
1608700
<reponame>nicomon24/tensortrade from tensortrade.stochastic import cox def test_shape(): n = 50 frame = cox( base_price=7000, base_volume=15000, start_date='2018-01-01', start_date_format='%Y-%m-%d', times_to_generate=n, time_frame='1d' ) assert frame...
0
0
0
0
0
0
test/api/test_snapshot.py
WagPTech/grafana_api
107
1608725
import unittest import requests_mock from grafana_api.grafana_face import GrafanaFace class SnapshotTestCase(unittest.TestCase): def setUp(self): self.cli = GrafanaFace( ("admin", "admin"), host="localhost", url_path_prefix="", protocol="http" ) @requests_mock.Mocker() def t...
0
0
0
0
0
0
boot/rpi/test/py/tests/test_fit.py
yodaos-project/yodaos
1,144
1608729
# SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2013, Google Inc. # # Sanity check of the FIT handling in U-Boot import os import pytest import struct import u_boot_utils as util # Define a base ITS which we can adjust using % and a dictionary base_its = ''' /dts-v1/; / { description = "Chrome OS kernel ...
0
10
0
0
10
0
QUANTAXIS/QAUtil/QABar.py
vensentzhou/QUANTAXIS
6,322
1608738
<filename>QUANTAXIS/QAUtil/QABar.py<gh_stars>1000+ # coding=utf-8 # # The MIT License (MIT) # # Copyright (c) 2016-2021 yutiansut/QUANTAXIS # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software w...
0
0
0
0
0
0