max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
7
115
max_stars_count
int64
101
368k
id
stringlengths
2
8
content
stringlengths
6
1.03M
isotope/run_tests.py
daixiang0/tools
264
79576
#!/usr/bin/env python3 # Copyright Istio 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 applicable law or ag...
tests/common/factories/__init__.py
tgiardina/rpp-h
2,103
79580
"""Factory classes for easily generating test objects.""" from .activation import Activation from .annotation import Annotation from .annotation_moderation import AnnotationModeration from .auth_client import AuthClient, ConfidentialAuthClient from .auth_ticket import AuthTicket from .authz_code import AuthzCode from ....
Filters/Geometry/Testing/Python/geomFilter.py
cclauss/VTK
1,755
79587
#!/usr/bin/env python import vtk from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() import sys # create pipeline - structured grid # pl3d = vtk.vtkMultiBlockPLOT3DReader() pl3d.SetXYZFileName("" + str(VTK_DATA_ROOT) + "/Data/combxyz.bin") pl3d.SetQFileName("" + str(VTK_DATA_ROOT) + "/Data/combq....
pyro/contrib/gp/models/gpr.py
GautamV234/pyro
4,959
79597
<filename>pyro/contrib/gp/models/gpr.py # Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import torch import torch.distributions as torchdist from torch.distributions import constraints import pyro import pyro.distributions as dist from pyro.contrib.gp.models.model import GPMode...
Steg_Tool/steg.py
Affanmir/Awesome-Python-Scripts
1,026
79625
#Image Stego using LSB import cv2 def encode(input_image_name, output_image_name, file_name): input_image = cv2.imread(input_image_name) height, width, nbchannels = input_image.shape size = width*height current_width = 0 current_height = 0 current_channel = 0 maskonevalues = [1, 2, 4, 8, ...
tensorlog/testxcomp.py
saraswat/TensorLog
108
79638
<gh_stars>100-1000 # (C) <NAME> and Carnegie Mellon University, 2017 import logging import numpy as np import os import unittest import sys import collections import tempfile from tensorlog import xctargets if xctargets.tf: import tensorflow as tf from tensorlog import tensorflowxcomp else: tensorflowxcomp=No...
checkov/terraform/checks/provider/base_registry.py
pmalkki/checkov
4,013
79654
<filename>checkov/terraform/checks/provider/base_registry.py<gh_stars>1000+ from typing import Dict, Any, Tuple from checkov.common.checks.base_check_registry import BaseCheckRegistry class Registry(BaseCheckRegistry): def extract_entity_details(self, entity: Dict[str, Any]) -> Tuple[str, str, Dict[str, Any]]: ...
spotpy/examples/hymod_python/hymod.py
cheginit/spotpy
182
79664
<filename>spotpy/examples/hymod_python/hymod.py<gh_stars>100-1000 # -*- coding: utf-8 -*- ''' Copyright (c) 2015 by <NAME> This file is part of Statistical Parameter Estimation Tool (SPOTPY). :author: <NAME> and <NAME> :paper: <NAME>., <NAME>., <NAME>. and <NAME>.: SPOTting Model Parameters Using a Ready-Made Pytho...
mayan/apps/announcements/permissions.py
nattangwiwat/Mayan-EDMS-recitation
343
79694
<reponame>nattangwiwat/Mayan-EDMS-recitation from django.utils.translation import ugettext_lazy as _ from mayan.apps.permissions import PermissionNamespace namespace = PermissionNamespace( label=_('Announcements'), name='announcements' ) permission_announcement_create = namespace.add_permission( label=_('Cre...
deeppavlov/models/morpho_tagger/cells.py
xbodx/DeepPavlov
5,893
79732
# Copyright 2017 Neural Networks and Deep Learning lab, MIPT # # 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...
dnanexus/filter_qc/src/filter_qc.py
strattan/test-merge2
108
79751
<filename>dnanexus/filter_qc/src/filter_qc.py #!/usr/bin/env python # filter_qc 0.0.1 # Generated by dx-app-wizard. # # Basic execution pattern: Your app will run on a single machine from # beginning to end. # # See https://wiki.dnanexus.com/Developer-Portal for documentation and # tutorials on how to modify this file....
engine/compile/ops/onnx_input.py
kevinintel/neural-compressor
172
79756
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2021 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/...
tests/test_type_hooks.py
HallerPatrick/frosch
204
79775
<gh_stars>100-1000 import contextlib import unittest from unittest.mock import Mock, patch import sys from frosch.type_hooks import HookLoader from frosch.parser import Variable @contextlib.contextmanager def mock_numpy_module(): """Inject a numpy mock to avoid import errors""" numpy_mock = Mock() numpy_m...
utils/metrics_accumulator.py
pytti-tools/blended-diffusion
121
79778
from collections import defaultdict import numpy as np class MetricsAccumulator: def __init__(self) -> None: self.accumulator = defaultdict(lambda: []) def update_metric(self, metric_name, metric_value): self.accumulator[metric_name].append(metric_value) def print_average_metric(self): ...
resource-timing/resources/eventsource.py
meyerweb/wpt
14,668
79797
<reponame>meyerweb/wpt<filename>resource-timing/resources/eventsource.py<gh_stars>1000+ def main(request, response): response.headers.set(b"Content-Type", b"text/event-stream") return u""
twiml/voice/pay/pay-1/pay-1.6.x.py
Tshisuaka/api-snippets
234
79804
from twilio.twiml.voice_response import Pay, VoiceResponse response = VoiceResponse() response.pay() print(response)
tensorflow_gan/examples/dme_cyclegan/train_test.py
nivedwho/gan
783
79813
<gh_stars>100-1000 # coding=utf-8 # Copyright 2021 The TensorFlow GAN 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 re...
unit1/spiders/spider_2_quotes.py
nulearn3296/scrapy-training
182
79831
import scrapy class QuotesSpider(scrapy.Spider): name = "quotes2" start_urls = [ 'http://quotes.toscrape.com/page/1/', 'http://quotes.toscrape.com/page/2/', ] def parse(self, response): self.log('I just visited {}'.format(response.url))
bcbio/variation/prioritize.py
naumenko-sa/bcbio-nextgen
418
79841
"""Prioritization scheme for identifying follow up variants in tumor-only samples. Generalizes the filtering scheme used in VarDict post-processing: https://github.com/AstraZeneca-NGS/VarDict/blob/9ffec9168e91534fac5fb74b3ec7bdd2badd3464/vcf2txt.pl#L190 The goal is to build up a standard set of prioritization filter...
odps/lib/importer.py
wjsi/aliyun-odps-python-sdk
412
79868
<reponame>wjsi/aliyun-odps-python-sdk<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2017 Alibaba Group Holding Ltd. # # 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 Lic...
poco/utils/simplerpc/jsonrpc/manager.py
HBoPRC/Poco
1,444
79872
import json # import logging from .utils import is_invalid_params from .exceptions import ( JSONRPCInvalidParams, JSONRPCInvalidRequest, JSONRPCInvalidRequestException, JSONRPCMethodNotFound, JSONRPCParseError, JSONRPCServerError, JSONRPCDispatchException, ) from .jsonrpc1 import JSONRPC10Re...
tests/io_components/test_mutate.py
detritus3872/kartothek
171
79873
<filename>tests/io_components/test_mutate.py<gh_stars>100-1000 import types import pandas as pd import pytest from kartothek.io_components.merge import align_datasets from kartothek.io_components.metapartition import MetaPartition from kartothek.io_components.write import store_dataset_from_partitions def test_alig...
plugins/dcmp/auth/models.py
qmgeng/docker-airflow
269
79909
<reponame>qmgeng/docker-airflow # encoding: utf-8 import logging from datetime import datetime from sqlalchemy import ( Column, Integer, String, DateTime, Text, Boolean, ForeignKey, PickleType, Index, Float) from sqlalchemy.ext.declarative import declarative_base, declared_attr from sqlalchemy.event import li...
tests/test_label_smoothing.py
blufb/fairseq
307
79912
<reponame>blufb/fairseq<filename>tests/test_label_smoothing.py # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS ...
django_version.py
Muflhi01/flow-dashboard
1,623
79931
<reponame>Muflhi01/flow-dashboard<filename>django_version.py import os os.environ["DJANGO_SETTINGS_MODULE"] = "settings"
dolly_tests/launch/follow_ignition_TEST.launch.py
Russ76/dolly
169
79945
<filename>dolly_tests/launch/follow_ignition_TEST.launch.py<gh_stars>100-1000 # Copyright 2021 <NAME> # # 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/LI...
pipetools/__init__.py
0101/pipetools
164
79971
<gh_stars>100-1000 from pipetools.utils import foreach __version__ = VERSION = 1, 0, 1 __versionstr__ = VERSION > foreach(str) | '.'.join from pipetools.main import pipe, X, maybe, xpartial from pipetools.utils import * # prevent namespace pollution import pipetools.compat for symbol in dir(pipetools.compat): if...
images/mariadb-galera/src/entrypoint.py
makr17/docker-tools
180
80003
<reponame>makr17/docker-tools<filename>images/mariadb-galera/src/entrypoint.py #!/usr/bin/env python # MariaDB cluster startup # This script upon startup waits for a specified number of nodes # (environment variable CLUSTER_SIZE) to report state of files # in /var/lib/mysql to etcd. It will halt if the cluster is #...
data/gener_rdat.py
eldipa/termgraph
2,790
80118
<filename>data/gener_rdat.py #!/usr/bin/env python import random b = [2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018] a = [1, 40, 24, 26, 29, 80, 100, 36] BASE = 1990 YEARS = 28 f = open('random.dat', 'w') for offset in range(YEARS): date = BASE + offset value = random.randint(-500, 500) f.write('{} {}...
tools/test_waymo.py
collector-m/SST
217
80133
<reponame>collector-m/SST<filename>tools/test_waymo.py import tensorflow as tf from waymo_open_dataset import dataset_pb2 as open_dataset from waymo_open_dataset.utils import frame_utils def get_data_from_seg(segment): dataset = tf.data.TFRecordDataset(segment, compression_type='') for data in dataset: ...
examples/overlay.py
kampelmuehler/HTML4Vision
155
80135
<filename>examples/overlay.py from html4vision import Col, imagetable cols = [ Col('img', 'Image', 'images/road_*_image.jpg'), Col('img', 'Label', 'images/road_*_label.png', 1), # 1 is used to select only the first item Col('img', 'Image + Label', 'images/road_*_image.jpg'), Col('overlay', '', 'images/...
MagneticField/GeomBuilder/test/python/mfwriter.py
ckamtsikis/cmssw
852
80146
### ### Read a geometry from a single xml file created from mfxmlwriter.py ### and write it into a db file. ### import FWCore.ParameterSet.Config as cms process = cms.Process("MagneticFieldWriter") process.load("CondCore.DBCommon.CondDBCommon_cfi") #GEOMETRY_VERSION = '90322' #GEOMETRY_VERSION = '120812' #GEOMETRY_...
watsor/test/model/prepare.py
firefly2442/watsor
123
80164
<filename>watsor/test/model/prepare.py import os import tensorflow as tf from string import Template from PIL import Image from logging import DEBUG from pathlib import Path from threading import Thread, Event from logging import getLogger from logging.handlers import QueueHandler from multiprocessing import Queue from...
generate/lib/run-firefox/cuddlefish/runner.py
flamencist/browser-extensions
102
80171
<gh_stars>100-1000 import os import sys import time import tempfile import atexit import shutil import shlex import subprocess import re import simplejson as json import mozrunner from cuddlefish.prefs import DEFAULT_COMMON_PREFS from cuddlefish.prefs import DEFAULT_FIREFOX_PREFS from cuddlefish.prefs import DEFAULT_T...
pythonFiles/testing_tools/adapter/pytest/_cli.py
JesterOrNot/vscode-python
404
80175
<gh_stars>100-1000 # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from __future__ import absolute_import from ..errors import UnsupportedCommandError def add_subparser(cmd, name, parent): """Add a new subparser to the given parent and add args to it.""" parser ...
tests/fixtures/foo_command.py
Ivoz/cleo
859
80187
<gh_stars>100-1000 from cleo.commands.command import Command from cleo.io.io import IO class FooCommand(Command): name = "foo bar" description = "The foo bar command" aliases = ["afoobar"] def interact(self, io: IO) -> None: io.write_line("interact called") def handle(self) -> int: ...
tests/unit/dynamodb/test_batch.py
Yurzs/boto
5,079
80188
#!/usr/bin/env python # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
dcdownloader/main.py
dev-techmoe/python-dcdownloader
173
80209
<filename>dcdownloader/main.py import sys, os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../')) from dcdownloader import arg_parse, version # for unittest cmd_args = None def main(): args = arg_parse.parser.parse_args(cmd_args) version.show_welcome() from dcdownloader.scheduler imp...
tools/datasets/gen_sceneflow_anns.py
jiaw-z/DenseMatchingBenchmark
160
80213
import os import numpy as np import argparse import os.path as osp import json from tqdm import tqdm from mmcv import mkdir_or_exist def getFlying3dMetas(root, Type, data_type='clean'): Metas = [] imgDir = 'flyingthings3d/frames_' + data_type + 'pass' dispDir = 'flyingthings3d/disparity' Parts = ['A'...
tests/pytests/unit/states/test_layman.py
markgras/salt
9,425
80224
""" :codeauthor: <NAME> <<EMAIL>> """ import pytest import salt.states.layman as layman from tests.support.mock import MagicMock, patch @pytest.fixture def configure_loader_modules(): return {layman: {}} def test_present(): """ Test to verify that the overlay is present. """ name = "sunrise"...
venv/share/doc/networkx-2.6.3/examples/algorithms/plot_circuits.py
AisahAlfiyatusR/Image_Retrieval_Heroku
10,024
80231
""" ======== Circuits ======== Convert a Boolean circuit to an equivalent Boolean formula. A Boolean circuit can be exponentially more expressive than an equivalent formula in the worst case, since the circuit can reuse subcircuits multiple times, whereas a formula cannot reuse subformulas more than once. Thus creati...
ldif/inference/predict.py
trisct/ldif
242
80240
# Copyright 2020 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
test/pytest/test_answers_and_docs.py
dmulyalin/ttp
254
80251
<reponame>dmulyalin/ttp<filename>test/pytest/test_answers_and_docs.py import sys sys.path.insert(0, "../..") import pprint import pytest import logging logging.basicConfig(level=logging.DEBUG) from ttp import ttp def test_answer_1(): """https://stackoverflow.com/questions/63522291/parsing-blocks-of-text-within...
tests/unit_tests/test_pin.py
norberto-schmidt/openmc
262
80258
<filename>tests/unit_tests/test_pin.py """ Tests for constructing Pin universes """ import numpy as np import pytest import openmc from openmc.model import pin def get_pin_radii(pin_univ): """Return a sorted list of all radii from pin""" rads = set() for cell in pin_univ.get_all_cells().values(): ...
mayan/apps/common/exceptions.py
eshbeata/open-paperless
2,743
80273
<gh_stars>1000+ from __future__ import unicode_literals class BaseCommonException(Exception): """ Base exception for the common app """ pass class NotLatestVersion(BaseCommonException): """ The installed version is not the latest available version """ def __init__(self, upstream_vers...
util/cm_list.py
ValkA/audio-analyzer-for-android
260
80282
<gh_stars>100-1000 #!/usr/bin/env python # Ref: # Origin (mpl colormaps): # https://bids.github.io/colormap/ # Raw data: # https://github.com/BIDS/colormap/blob/master/colormaps.py import csv import numpy as np #import matplotlib.pyplot as plt # matplotlib ver >= 1.5 names = ['magma', 'inferno', 'plasma', 'virid...
recipes/Python/498259_Implementing_observer_pattern_yet_agathtime/recipe-498259.py
tdiprima/code
2,023
80294
<gh_stars>1000+ """ observer module Typical usage is as follows: from __future__ import with_statement from observer import consumer, observation @consumer def do_something_with_notification(): while True: key, old, new = (yield) print "%s: %s -> %s" % (key, old, new) container = {} # Any modif...
tests/text/test_chrf.py
stancld/metrics
769
80306
from functools import partial from typing import Sequence import pytest from torch import Tensor, tensor from tests.text.helpers import TextTester from tests.text.inputs import _inputs_multiple_references, _inputs_single_sentence_multiple_references from torchmetrics.functional.text.chrf import chrf_score from torchm...
usaspending_api/references/account_helpers.py
g4brielvs/usaspending-api
217
80329
from django.db import connection from usaspending_api.common.etl import ETLQuery, ETLTable from usaspending_api.common.etl.operations import delete_obsolete_rows, insert_missing_rows, update_changed_rows # This is basically the desired final state of the federal_account table. We can diff this against the # actual f...
python/test/mapreduce/util_test.py
Batterii/appengine-mapreduce
228
80331
#!/usr/bin/env python # Copyright 2010 Google Inc. 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 ...
api/curve/db.py
QiliangFan/Baidu-Curve
478
80349
<reponame>QiliangFan/Baidu-Curve # -*- coding: utf-8 -*- """ Curve ~~~~ db package :copyright: (c) 2017-2018 by Baidu, Inc. :license: Apache, see LICENSE for more details. """ import flask_sqlalchemy db = flask_sqlalchemy.SQLAlchemy()
python/hls2srt.py
AngusF22/toolbox
182
80356
<gh_stars>100-1000 #!/usr/bin/python2.7 # # Copyright 2019 Eyevinn Technology. All rights reserved # Use of this source code is governed by a MIT License # that can be found in the LICENSE file. # Author: <NAME> (Eyevinn Technology) # # Receive HLS and stream over SRT # import argparse import subprocess from os.path im...
core/src/main/resources/tf_algos/easytransfer/run_easytransfer_train_main.py
starburst-project/Alink
3,301
80391
<filename>core/src/main/resources/tf_algos/easytransfer/run_easytransfer_train_main.py import os os.environ["HOME"] = os.path.expanduser('~') from akdl.models.tf.easytransfer import easytransfer_main from akdl.runner.config import TrainTaskConfig def main(task_config: TrainTaskConfig): easytransfer_main.main(ta...
tests/lists_tests.py
cockcrow/python-mammoth
557
80400
from nose.tools import istest, assert_equal from mammoth.lists import unique @istest def unique_of_empty_list_is_empty_list(): assert_equal([], unique([])) @istest def unique_removes_duplicates_while_preserving_order(): assert_equal(["apple", "banana"], unique(["apple", "banana", "apple"]))
djangae/tests/test_storage.py
julietkb/djangae
467
80438
<gh_stars>100-1000 # coding: utf-8 # STANDARD LIB import os # THIRD PARTY import requests from django.core.files.base import ( ContentFile, File, ) from django.db import models from django.test.utils import override_settings # DJANGAE from djangae.contrib import sleuth from djangae.storage import ( CloudS...
alipay/aop/api/domain/KoubeiRetailWmsSupplierQueryModel.py
snowxmas/alipay-sdk-python-all
213
80472
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.OperateContext import OperateContext class KoubeiRetailWmsSupplierQueryModel(object): def __init__(self): self._operate_context = None self...
fexm/test/test_fuzzer.py
fgsect/fexm
105
80490
<reponame>fgsect/fexm import json import unittest import unittest.mock import sys from unittest import mock import sys import os from helpers import utils sys.path.insert(0, os.path.abspath(os.path.join(os.getcwd(), "configfinder/"))) sys.modules[ 'configfinder.builder'] = unittest.mock.Mock() # Mocking builder ...
alipay/aop/api/domain/AlipayOpenOperationBizfeeAftechCancelModel.py
snowxmas/alipay-sdk-python-all
213
80541
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayOpenOperationBizfeeAftechCancelModel(object): def __init__(self): self._app_name = None self._gmt_service = None self._order_no = None self._out_biz_no = Non...
QuickWall/feh.py
deepjyoti30/QuickWall
191
80562
<filename>QuickWall/feh.py """Functions related to usign feh as wallpaper setter.""" import subprocess from pathlib import Path from simber import Logger # Declare the logger logger = Logger("feh") class feh: def __init__(self): self.feh_config_path = Path('~/.fehbg').expanduser() self.current...
helm/dagster/schema/schema/charts/dagster/subschema/service_account.py
dbatten5/dagster
4,606
80632
<reponame>dbatten5/dagster from pydantic import BaseModel # pylint: disable=no-name-in-module from ...utils import kubernetes class ServiceAccount(BaseModel): create: bool name: str annotations: kubernetes.Annotations
vega/report/__init__.py
jie311/vega
724
80649
from .report_server import ReportServer from .report_client import ReportClient from .record import ReportRecord from .nsga_iii import NonDominatedSorting, SortAndSelectPopulation
plugins/lookup/apt_keys.py
manala/ansible-roles
138
80662
from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' name: apt_keys author: Manala (@manala) short_description: returns a curated keys list description: - Takes a keys list and returns it curated. ''' from ansible.plugins.lookup import Looku...
tests/test_graphviz.py
center-for-threat-informed-defense/attack-flow
165
80696
from textwrap import dedent import attack_flow.graphviz def test_convert_attack_flow_to_dot(): flow = { "actions": [ { "id": "action1", "name": "action-one", }, { "id": "action2", "name": "action-two", ...
vue/factory.py
adamlwgriffiths/vue.py
274
80698
<reponame>adamlwgriffiths/vue.py from .decorators.base import VueDecorator from .decorators.prop import Prop from .decorators.data import Data from .decorators.lifecycle_hook import LifecycleHook from .decorators.method import Method from .decorators.render import Render from .decorators.mixins import Mixins from .deco...
pytermgui/context_managers.py
jakkso/pytermgui
771
80704
<filename>pytermgui/context_managers.py """ Ease-of-use context-manager classes & functions. There isn't much (or any) additional functionality provided in this module, most things are nicer-packaged combinations to already available methods from `pytermgui.ansi_interface`. """ from __future__ import annotations fro...
tests/test_filtration.py
bbhunter/pyWhat
5,049
80717
<reponame>bbhunter/pyWhat<filename>tests/test_filtration.py import pytest from pywhat import Distribution, Filter, pywhat_tags from pywhat.helper import CaseInsensitiveSet, InvalidTag, load_regexes regexes = load_regexes() @pytest.mark.skip( "Dist.get_regexes() returns the regex list with the default filter of ...
samples/break.py
akhand2222/pyicu
140
80728
<reponame>akhand2222/pyicu # ==================================================================== # Copyright (c) 2004-2010 Open Source Applications Foundation. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to d...
test/unit/optimizer/test_selection_operators.py
rozlana-g/FEDOT
358
80734
<gh_stars>100-1000 from functools import partial from fedot.core.composer.advisor import PipelineChangeAdvisor from fedot.core.composer.gp_composer.gp_composer import GPComposerRequirements from fedot.core.debug.metrics import RandomMetric from fedot.core.optimisers.adapters import PipelineAdapter from fedot.core.opti...
tools/azure-devtools/src/azure_devtools/perfstress_tests/_event_perf_test.py
vincenttran-msft/azure-sdk-for-python
2,728
80746
<reponame>vincenttran-msft/azure-sdk-for-python # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------...
zeus/datasets/transforms/pytorch/Numpy2Tensor.py
shaido987/vega
240
80748
<reponame>shaido987/vega<filename>zeus/datasets/transforms/pytorch/Numpy2Tensor.py # -*- coding: utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the MIT License. # This program is distribut...
server/explorer/utils/collection.py
s-bauer/yang-explorer
437
80763
<filename>server/explorer/utils/collection.py<gh_stars>100-1000 """ Copyright 2015, Cisco Systems, 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...
src/genie/libs/parser/iosxr/tests/ShowSpanningTreePvrst/cli/equal/golden_output_1_expected.py
balmasea/genieparser
204
80764
expected_output = { 'pvst': { 'a': { 'pvst_id': 'a', 'vlans': { 2: { 'vlan_id': 2, 'designated_root_priority': 32768, 'designated_root_address': '0021.1bff.d973', 'designated_root_max_ag...
pyscf/grad/test/test_casscf.py
QuESt-Calculator/pyscf
501
80788
#!/usr/bin/env python # # Author: <NAME> <<EMAIL>> # from functools import reduce import unittest import numpy from pyscf import lib from pyscf import gto from pyscf import scf from pyscf import mcscf from pyscf import ao2mo from pyscf import fci from pyscf.tools import molden from pyscf.grad import rhf as rhf_grad f...
pybotters/client.py
maruuuui/pybotters
176
80807
from __future__ import annotations import asyncio import json import logging import os from typing import Any, Mapping, Optional, Union import aiohttp from aiohttp import hdrs from aiohttp.client import _RequestContextManager from .auth import Auth from .request import ClientRequest from .typedefs import WsBytesHand...
airesources/Python3/hlt/__init__.py
xinnosuke/Halite-II
232
80813
<filename>airesources/Python3/hlt/__init__.py """ Halite II Python 3 starter kit See MyBot.py for a basic usage example. In short, you should initialize() at the start, then in a loop, call get_map() to get the current game state, then build up a list of commands and send them with send_command_queue(). """ from . im...
pywick/losses.py
achaiah/pywick
408
80837
<filename>pywick/losses.py<gh_stars>100-1000 """ Losses are critical to training a neural network well. The training can only make progress if you provide a meaningful measure of loss for each training step. What the loss looks like usually depends on your application. Pytorch has a number of `loss functions <https://p...
qt__pyqt__pyside__pyqode/Is_IP__QRegExpValidator/main.py
DazEB2/SimplePyScripts
117
80841
<gh_stars>100-1000 #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' from PyQt5.QtWidgets import QLineEdit, QApplication from IP_Validator import get_ip_validator if __name__ == '__main__': app = QApplication([]) mw = QLineEdit() mw.setValidator(get_ip_validator()) mw.setText...
mindboggle/guts/mesh.py
cemlyn007/mindboggle
118
80850
#!/usr/bin/env python """ Operations on surface mesh vertices. Authors: - <NAME>, 2012 (<EMAIL>) - <NAME>, 2012-2016 (<EMAIL>) http://binarybottle.com Copyright 2016, Mindboggle team (http://mindboggle.info), Apache v2.0 License """ def find_neighbors_from_file(input_vtk): """ Generate the list...
src/test/tests/hybrid/ddf_vs_dbinning.py
visit-dav/vis
226
80871
<gh_stars>100-1000 from visit_utils import * import math def setup_plot(): DeleteAllPlots() OpenDatabase(silo_data_path("rect3d.silo")) exprs.define("coords", "coord(quadmesh3d)",etype="vector") exprs.define("mesh_x_zonal","recenter(coords[0])") exprs.define("mesh_y_zonal","recenter(coords[1])") ...
facemask_detector/model.py
anshul2807/Automation-scripts
496
80873
# Author - Abhinand --> https://github.com/abhinand5 # ===================================================================== # IMPORTS # ====================================================================== import torch import torchvision from torchvision.models.detection.faster_rcnn import FastRCNNPredictor import ...
src/main/python/apache/aurora/executor/common/resource_manager.py
jeremyvdw/aurora
479
80885
<gh_stars>100-1000 # # 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, software #...
etl/parsers/etw/Microsoft_Windows_MediaFoundation_Performance_Core.py
IMULMUL/etl-parser
104
80894
# -*- coding: utf-8 -*- """ Microsoft-Windows-MediaFoundation-Performance-Core GUID : b20e65ac-c905-4014-8f78-1b6a508142eb """ from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct from etl.utils import WString, CString, SystemTime, Guid from etl.dty...
tools/dbgui/build_errors.py
rakati/ppci-mirror
161
80897
<filename>tools/dbgui/build_errors.py<gh_stars>100-1000 from qtwrapper import QtGui, QtWidgets, pyqtSignal, get_icon class BuildErrors(QtWidgets.QTreeView): sigErrorSelected = pyqtSignal(object) def __init__(self, parent=None): super().__init__(parent) model = QtGui.QStandardItemModel() ...
src/run/LPC_runcore.py
ufo2011/NXP-MCUBootUtility
174
80909
#! /usr/bin/env python # -*- coding: utf-8 -*- import sys import os import math import LPC_rundef import rundef import boot sys.path.append(os.path.abspath("..")) from gen import LPC_gencore from gen import LPC_gendef from ui import LPC_uidef from ui import uidef from ui import uivar from ui import uilang from mem impo...
amazon/paapi5_python_sdk/search_items_request.py
frenners/python-amazon-paapi
121
80941
# coding: utf-8 """ 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. A copy of the License is located at http://www.apache.org/licenses/LICENSE-2.0 or in ...
docs_src/fastapi/docs001.py
naterenegar/ormar
905
80961
from typing import List, Optional import databases import sqlalchemy from fastapi import FastAPI import ormar app = FastAPI() metadata = sqlalchemy.MetaData() database = databases.Database("sqlite:///test.db") app.state.database = database @app.on_event("startup") async def startup() -> None: database_ = app.s...
ludwig/utils/horovod_utils.py
hfurkanbozkurt/ludwig
970
80988
<gh_stars>100-1000 # Copyright (c) 2020 Uber Technologies, 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 appli...
tests/projects/test_kubernetes.py
PeterSulcs/mlflow
10,351
80991
import yaml import pytest from unittest import mock import kubernetes from kubernetes.config.config_exception import ConfigException from mlflow.projects import kubernetes as kb from mlflow.exceptions import ExecutionException from mlflow.entities import RunStatus def test_run_command_creation(): # pylint: disable...
samples/debug/symbols/symsearch.py
IMULMUL/PythonForWindows
479
81001
import argparse import os import windows import windows.debug.symbols as symbols parser = argparse.ArgumentParser(prog=__file__, formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('pattern') parser.add_argument('file', help="The PE file to load") parser.add_argument('--addr', type=lambda x: ...
tests/test_fixture.py
acpaquette/deepstate
684
81002
<reponame>acpaquette/deepstate<filename>tests/test_fixture.py from __future__ import print_function import logrun import deepstate_base class FixtureTest(deepstate_base.DeepStateTestCase): def run_deepstate(self, deepstate): (r, output) = logrun.logrun([deepstate, "build/examples/Fixture"], "d...
coldtype/renderer/winman/webview.py
goodhertz/coldtype
142
81079
<gh_stars>100-1000 import threading, json from pathlib import Path from http.server import SimpleHTTPRequestHandler, HTTPServer from coldtype.renderer.winman.passthrough import WinmanPassthrough from coldtype.renderer.config import ConfigOption, ColdtypeConfig from coldtype.pens.svgpen import SVGPen from coldtype.pe...
build-support/migration-support/fix_deprecated_globs_usage.py
rcuza/pants
1,806
81101
#!/usr/bin/env python3 # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). """A script to replace deprecated uses of `globs`, `rglobs`, and `zglobs` in BUILD files with a direct list of files and globs. Run `python3 fix_deprecated_globs_us...
workflows/pipe-templates/__COMMON/luigi/src/@.py
msleprosy/cloud-pipeline
126
81112
# Copyright 2017-2019 EPAM Systems, Inc. (https://www.epam.com/) # # 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 appli...
f5/bigip/tm/sys/crypto.py
nghia-tran/f5-common-python
272
81120
# coding=utf-8 # # Copyright 2016 F5 Networks 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 a...
tests/misc/test_utils.py
lpd6375/qlib
8,637
81121
from unittest.case import TestCase import unittest import pandas as pd import numpy as np from datetime import datetime from qlib import init from qlib.config import C from qlib.log import TimeInspector from qlib.utils.time import cal_sam_minute as cal_sam_minute_new, get_min_cal def cal_sam_minute(x, sam_minutes): ...
src/bls/python-impl/hkdf.py
chasingkirkjufell/navcoin-core
103
81143
<reponame>chasingkirkjufell/navcoin-core from math import ceil import hmac import hashlib BLOCK_SIZE = 32 def extract(salt: bytes, ikm: bytes) -> bytes: h = hmac.new(salt, ikm, hashlib.sha256) return h.digest() def expand(L: int, prk: bytes, info: bytes) -> bytes: N: int = ceil(L / BLOCK_SIZE) byte...
openmc/data/nbody.py
janmalec/openmc
262
81147
from numbers import Real, Integral import numpy as np import openmc.checkvalue as cv from .angle_energy import AngleEnergy from .endf import get_cont_record class NBodyPhaseSpace(AngleEnergy): """N-body phase space distribution Parameters ---------- total_mass : float Total mass of product p...
template.py
ardovm/wxGlade
225
81152
<reponame>ardovm/wxGlade<gh_stars>100-1000 """ Handles the template tags and description @copyright: 2002-2007 <NAME> @author: <NAME> @author: <NAME> @copyright: 2016 <NAME> @license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY """ import glob import logging import os import wx from xml.dom import min...
tests/test_property.py
DeathGOD7/pythonnet
3,183
81168
# -*- coding: utf-8 -*- """Test CLR property support.""" import pytest from Python.Test import PropertyTest def test_public_instance_property(): """Test public instance properties.""" ob = PropertyTest() assert ob.PublicProperty == 0 ob.PublicProperty = 1 assert ob.PublicProperty == 1 with...
Filters/Hybrid/Testing/Python/TestFacetReader.py
forestGzh/VTK
1,755
81190
<reponame>forestGzh/VTK #!/usr/bin/env python import vtk from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() ren1 = vtk.vtkRenderer() ren1.SetBackground(0,0,0) renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) renWin.SetSize(300,300) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWind...