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
paddlespeech/t2s/modules/transformer/subsampling.py
jerryuhoo/PaddleSpeech
1,379
11007365
# Copyright (c) 2021 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 appli...
commands/restore.py
chuongle1994/nathan
233
11007379
<filename>commands/restore.py import os import re import zipfile import zlib from util.consts import * from util.logging import * from util.files import get_full_path import commands.snapshot SNAP_INFO = "---> Number: %d - Date: %s - Label: %s" BACKUP_LABEL = "BACKUP" class SnapInfo: def __init__(self, _id, _d...
examples/plugins/routing/routing.py
sepich/alerta
1,233
11007416
""" Example Routing Rules Plugin - Customer-based Escalation/Notification Use different notification paths for different customers. ie. PagerDuty for Tier 1 customers, Slack for Tier 2 and nothing for Tier 3 customers. """ TIER_ONE_CUSTOMERS = [ 'Tyrell Corporation', 'Cyberdyne Systems', 'Weyland-Yutani',...
tests/test_unsupported.py
em3ndez/py2many
345
11007419
<reponame>em3ndez/py2many import ast import os.path import unittest import sys from distutils import spawn from functools import lru_cache from subprocess import run from textwrap import dedent from unittest.mock import Mock import astpretty from unittest_expander import foreach, expand from py2many.cli import _get...
Chapter07/matplotlib_3.py
stavsta/Mastering-Python-Networking-Second-Edition
107
11007430
<gh_stars>100-1000 #!/usr/bin/env python3 # Example from http://matplotlib.org/2.0.0/examples/pie_and_polar_charts/pie_demo_features.html import matplotlib.pyplot as plt # Pie chart, where the slices will be ordered and plotted counter-clockwise: labels = 'TCP', 'UDP', 'ICMP', 'Others' sizes = [15, 30, 45, 10] explo...
chainer/initializers/sampling.py
zjzh/chainer
3,705
11007433
<filename>chainer/initializers/sampling.py<gh_stars>1000+ import numpy from chainer.backends import cuda from chainer import initializer # Original code from Berkeley FCN # https://github.com/shelhamer/fcn.berkeleyvision.org/blob/master/surgery.py def _get_linear_filter(size, ndim, upsampling=True): """Make a 2...
toolchains/git/git_configure.bzl
nacl/rules_pkg
123
11007434
<filename>toolchains/git/git_configure.bzl<gh_stars>100-1000 # Copyright 2021 The Bazel 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....
tools/gen_tflite_flatbuffer.py
gcunhase/tensorflow-onnx
1,473
11007440
# SPDX-License-Identifier: Apache-2.0 """ Generates the files in tf2onnx/tflite used for parsing tflite flatbuffer WARNING: this script will overwrite all files in tf2onnx/tflite Before running, download the flatc executable from https://github.com/google/flatbuffers/releases and add it to PATH This script only tested...
software/glasgow/support/lazy.py
electroniceel/Glasgow
1,014
11007465
<reponame>electroniceel/Glasgow __all__ = ["lazy"] class lazy: """ A wrapper for lazily evaluating an expression. E.g. ``obj = slow_operation()`` can generally be replaced with ``obj = lazy(lambda: slow_operation())``, which would only perform ``slow_operation()`` when its result is actually requ...
rlgraph/utils/specifiable_server.py
RLGraph/RLGraph
290
11007473
# Copyright 2018/2019 The RLgraph 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 appli...
glazier/lib/drive_map.py
TsekNet/glazier
1,233
11007487
# Copyright 2016 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 by applicable law or ag...
lib/pymedphys/_experimental/vendor/pylinac_vendored/core/image.py
ethanio12345/pymedphys
207
11007496
# Copyright (c) 2014-2019 <NAME> # 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, distribute...
examples-master/python_examples/md_chain_mts_lj.py
JungHoonJung/2021MD
186
11007501
<reponame>JungHoonJung/2021MD #!/usr/bin/env python3 # md_chain_mts_lj.py #------------------------------------------------------------------------------------------------# # This software was written in 2016/17 # # by <NAME> <<EMAIL>>/<<EMAIL>> ...
utilities/utils.py
akash13singh/thesis
215
11007504
<gh_stars>100-1000 import configuration.config as cfg import matplotlib if cfg.run_config['Xserver']== False: matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np from sklearn.preprocessing import StandardScaler from sklearn.preprocessing import MinMaxScaler from scipy.stats import norm if cfg.r...
test/map_test/stages/sum/__init__.py
martian-lang/martian
127
11007515
<filename>test/map_test/stages/sum/__init__.py """Stage to compute the sum of values in an array""" __MRO__ = """ stage SUM( in float[] x, out float sum, src py "stages/sum", ) """ def main(args, outs): """Computes the sum of values in an array""" outs.sum = sum(args.x)
tests/licensedcode/data/datadriven/lic2/2206-misc-python/interval.py
s4-2/scancode-toolkit
1,511
11007531
# -*- coding: utf-8 -*- # Copyright (c) 2019, <NAME> # All rights reserved. # # This software may be modified and distributed under the terms # of the BSD license. See the LICENSE file for details. from aniso8601.builders import TupleBuilder from aniso8601.builders.python import PythonTimeBuilder from aniso8601.date...
utils/examples/example_ah.py
shinji-s/scrapy-cluster
1,108
11007579
<filename>utils/examples/example_ah.py import argparse from scutils.argparse_helper import ArgparseHelper parser = argparse.ArgumentParser( description='example_ah.py: Prints various family members', add_help=False) parser.add_argument('-h', '--help', action=ArgparseHelper, help='show this help...
datafeeds/usfirst_alliances_parser.py
tervay/the-blue-alliance
266
11007580
import json import logging from bs4 import BeautifulSoup from datafeeds.parser_base import ParserBase class UsfirstAlliancesParser(ParserBase): @classmethod def parse(self, html): """ Parse the table that contains alliances. """ soup = BeautifulSoup(html) tables = so...
astroplan/exceptions.py
lordaniket06/astroplan
160
11007582
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) from astropy.utils.exceptions import AstropyWarning __all__ = ["TargetAlwaysUpWarning", "TargetNeverUpWarning", "OldEarthOrientationDa...
tests/test_common.py
GabrielWen/spartan
156
11007584
import atexit import os from os.path import basename, splitext import signal from spartan import util, config from spartan.cluster import start_cluster from spartan.config import FLAGS, StrFlag, BoolFlag import cProfile import imp import spartan import sys import time import types import unittest FLAGS.add(StrFlag('wo...
stog/modules/input_variational_dropout.py
sfillwo/stog
172
11007587
<reponame>sfillwo/stog import torch class InputVariationalDropout(torch.nn.Dropout): """ Apply the dropout technique in Gal and Ghahramani, "Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learning" (https://arxiv.org/abs/1506.02142) to a 3D tensor. This module accepts a...
apps/impala/gen-py/beeswaxd/ttypes.py
yetsun/hue
5,079
11007594
# # Autogenerated by Thrift Compiler (0.13.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py:new_style # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecu...
llvmpy/src/Support/Dwarf.py
KennethNielsen/llvmpy
140
11007605
<reponame>KennethNielsen/llvmpy from binding import * from ..namespace import llvm dwarf = llvm.Namespace('dwarf') dwarf.includes.add('llvm/Support/Dwarf.h') dwarf_constants = dwarf.Enum('dwarf_constants', ''' DWARF_VERSION DW_TAG_array_type DW_TAG_class_type DW_TAG_entry_point DW_TAG_enumeration_type DW_TAG_formal_...
plaso/containers/storage_media.py
cugu-stars/plaso
1,253
11007633
# -*- coding: utf-8 -*- """Storage media related attribute container definitions.""" from plaso.containers import interface from plaso.containers import manager class MountPoint(interface.AttributeContainer): """Mount point attribute container. Attributes: mount_path (str): path where the path specification...
tests/test_window.py
cgarjun/Pyno
163
11007634
"""Tests for pyno.window""" import pyglet from pyno import runner def test_app_run(): pyglet.clock.schedule_once(lambda x: pyglet.app.exit(), 0.1) runner.run() def test_get_window(window): # Check some meaningful things assert window.caption == 'Pyno' def test_saving_consistency(window): # Lo...
zippy/benchmarks/src/benchmarks/sympy/sympy/logic/tests/test_inference.py
lucapele/pele-c
319
11007661
"""For more tests on satisfiability, see test_dimacs""" from sympy import symbols, Q from sympy.logic.boolalg import Or, Equivalent, Implies, And from sympy.logic.inference import is_literal, literal_symbol, \ pl_true, satisfiable, PropKB from sympy.logic.algorithms.dpll import dpll, dpll_satisfiable, \ find_...
wakatime/packages/py26/pygments/lexers/perl.py
Anton-Latukha/wakatime
1,198
11007666
<gh_stars>1000+ # -*- coding: utf-8 -*- """ pygments.lexers.perl ~~~~~~~~~~~~~~~~~~~~ Lexers for Perl and related languages. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, ExtendedReg...
tests/integration-tests/virtual_environments.py
Tirzono/teamcity-messages
105
11007678
import os import re import shutil import subprocess import sys import tempfile import virtualenv from test_util import get_teamcity_messages_root _windows = os.name == 'nt' class VirtualEnvDescription: def __init__(self, home_dir, bin_dir, python, pip, packages): self.home = home_dir self.bin ...
cctbx/development/cl_template/cut_cl_app.py
dperl-sol/cctbx_project
155
11007719
# # This is a template for command-line callable script. # It is a plain script because nothing else should import it anywhere. # Ideology: # Inherit application from base application class (cl_app), where # majority of common functionality is defined. # Specify needs of particular application here: # - help message # ...
models/timeseries/historic_mean.py
pragnesh-ai/driverlessai-recipes
194
11007727
"""Historic Mean for Time-Series problems. Predicts the mean of the target for each time group for regression problems.""" import datatable as dt import numpy as np import pandas as pd from h2oaicore.models import CustomTimeSeriesModel class HistoricMeanModel(CustomTimeSeriesModel): _can_handle_non_numeric = True...
src/poetry/mixology/solutions/providers/python_requirement_solution_provider.py
pkoch/poetry
7,258
11007759
from __future__ import annotations import re from typing import TYPE_CHECKING from crashtest.contracts.has_solutions_for_exception import HasSolutionsForException if TYPE_CHECKING: from crashtest.contracts.solution import Solution from poetry.puzzle.exceptions import SolverProblemError class PythonRequi...
app/main/errors.py
losnau/flask-blog
103
11007764
<filename>app/main/errors.py<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- # __author__ = 'adison' # @Time : 2017/11/21 from flask import render_template from . import main ''' 在蓝本中编写错误处理程序稍有不同,如果使用 errorhandler 修饰器,那么只有蓝本中的 错误才能触发处理程序。要想注册程序全局的错误处理程序,必须使用 app_errorhandler ''' @main.app_errorha...
rectpack/packer.py
joamatab/rectpack
2,583
11007767
<gh_stars>1000+ from .maxrects import MaxRectsBssf import operator import itertools import collections import decimal # Float to Decimal helper def float2dec(ft, decimal_digits): """ Convert float (or int) to Decimal (rounding up) with the requested number of decimal digits. Arguments: ft (f...
TimeWrapper_JE/venv/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py
JE-Chen/je_old_repo
227
11007796
from .adapter import CacheControlAdapter from .cache import DictCache def CacheControl( sess, cache=None, cache_etags=True, serializer=None, heuristic=None, controller_class=None, adapter_class=None, cacheable_methods=None, ): cache = DictCache() if cache is None el...
gcloud/tests/apigw/views/test_create_and_start_task.py
qqqqqie/bk-sops
881
11007815
<reponame>qqqqqie/bk-sops # -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not ...
src/python/pants/backend/docker/registries.py
yoav-orca/pants
1,806
11007818
<filename>src/python/pants/backend/docker/registries.py<gh_stars>1000+ # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations from dataclasses import dataclass from typing import Any, Generator from pants.o...
models/tridentnet/builder.py
happywu/simpledet-1
3,195
11007819
from __future__ import print_function import numpy as np import mxnet as mx import mxnext as X from symbol.builder import RpnHead, Backbone, RoiExtractor from models.tridentnet.resnet_v2 import TridentResNetV2Builder from models.tridentnet.resnet_v1b import TridentResNetV1bBuilder from models.tridentnet.resnet_v1 imp...
data-prepro/MSCOCO_preprocess/preprocess_entity.py
tsenghungchen/show-adapt-and-tell
166
11007824
<reponame>tsenghungchen/show-adapt-and-tell import re import pickle import json import numpy as np from tqdm import tqdm import pdb import sys def load_json(p): return json.load(open(p,'r')) desired_phase = sys.argv[1] split_path = 'K_split.json' split = load_json(split_path) split_id = split[desired_phase] phase = ...
saleor/graphql/order/mutations/order_fulfill.py
eanknd/saleor
1,392
11007829
<reponame>eanknd/saleor from collections import defaultdict import graphene from django.core.exceptions import ValidationError from django.template.defaultfilters import pluralize from ....core.exceptions import InsufficientStock from ....core.permissions import OrderPermissions from ....core.tracing import traced_at...
tests/integration/common.py
dcos/dcos-cli
164
11007873
import json import os import subprocess import uuid from contextlib import contextmanager import pytest def exec_cmd(cmd, env=None, stdin=None, timeout=None): """Execute CLI command :param cmd: Program and arguments :type cmd: [str] :param env: Environment variables :type env: dict | None :...
pytorch_blade/torch_blade/clustering/support_group_conversion.py
JamesTheZ/BladeDISC
328
11007928
<gh_stars>100-1000 # Copyright 2021 The BladeDISC 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...
tests/serialization/test_util.py
detritus3872/kartothek
171
11007930
<gh_stars>100-1000 # -*- coding: utf-8 -*- import pytest from kartothek.serialization._util import ensure_unicode_string_type @pytest.mark.parametrize( "obj,expected", [("tüst", "tüst"), ("tüst".encode("utf8"), "tüst")] ) def test_ensure_unicode_string_types(obj, expected): actual = ensure_unicode_string_typ...
lib/rucio/client/accountlimitclient.py
jamesp-epcc/rucio
187
11007940
# -*- coding: utf-8 -*- # Copyright 2014-2021 CERN # # 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...
Python/DataStructures/DoublyLinkedList/test/test_doubly_linked_list.py
ThunderZ007/Data-Structures-and-Algorithms
245
11007965
<reponame>ThunderZ007/Data-Structures-and-Algorithms import unittest from Python.DataStructures.DoublyLinkedList.doubly_linked_list import DoublyLinkedList class TestDoublyLinkedList(unittest.TestCase): def test_list_is_empty_on_initialization(self): a_doubly_linked_list = DoublyLinkedList() self....
crabageprediction/venv/Lib/site-packages/pandas/tests/apply/common.py
13rianlucero/CrabAgePrediction
28,899
11007976
from pandas.core.groupby.base import transformation_kernels # tshift only works on time index and is deprecated # There is no Series.cumcount or DataFrame.cumcount series_transform_kernels = [ x for x in sorted(transformation_kernels) if x not in ["tshift", "cumcount"] ] frame_transform_kernels = [ x for x in ...
deadshot/api_server.py
shreyanshp/deadshot
172
11007982
<gh_stars>100-1000 from deadshot.configurations.api_server_config_data import config_map from flask import Flask import os ''' Method to initiate the Flask API server ''' def create_app(config_object_name=None, config_dict=None, **kwargs): app = Flask(__name__) if config_object_n...
tests/components/flux_led/test_select.py
MrDelik/core
30,023
11007986
"""Tests for select platform.""" from unittest.mock import patch from flux_led.const import ( COLOR_MODE_CCT as FLUX_COLOR_MODE_CCT, COLOR_MODE_RGBW as FLUX_COLOR_MODE_RGBW, WhiteChannelType, ) from flux_led.protocol import PowerRestoreState, RemoteConfig import pytest from homeassistant.components import...
tests/facebook/test_conversation.py
sns-sdks/python-facebook
181
11008016
<gh_stars>100-1000 """ Tests for conversation. """ import responses def test_get_info(helpers, fb_api): cvs_id = "t_587956915396498" with responses.RequestsMock() as m: m.add( method=responses.GET, url=f"https://graph.facebook.com/{fb_api.version}/{cvs_id}", j...
stix_shifter_utils/stix_transmission/utils/timeout_http_adapter.py
pyromaneact/stix-shifter
129
11008027
from requests.adapters import HTTPAdapter DEFAULT_TIMEOUT = 5 # seconds class TimeoutHTTPAdapter(HTTPAdapter): def __init__(self, *args, **kwargs): self.timeout = DEFAULT_TIMEOUT if "timeout" in kwargs: self.timeout = kwargs["timeout"] del kwargs["timeout"] super()....
docs/astro/source/plot_snr_brightness_evolution.py
Rishank2610/gammapy
155
11008031
"""Plot SNR brightness evolution.""" import numpy as np from astropy.units import Quantity import matplotlib.pyplot as plt from gammapy.astro.source import SNR densities = Quantity([1, 0.1], "cm-3") t = Quantity(np.logspace(0, 5, 100), "yr") for density in densities: snr = SNR(n_ISM=density) F = snr.luminosit...
packages/pyright-internal/src/tests/samples/functionAnnotation2.py
sasano8/pyright
4,391
11008061
# This sample tests support for comment-style function annotations. # Too few annotations def func1a(a, b): # type: (str) -> str return "" # Too many annotations def func1b(a, b): # type: (str, int, int) -> str return "" class ClassA: def method0(self, a, b): # type: (str, int) -> str ...
office365/sharepoint/search/relevantResults.py
rikeshtailor/Office365-REST-Python-Client
544
11008062
<filename>office365/sharepoint/search/relevantResults.py from office365.runtime.client_value import ClientValue from office365.sharepoint.search.simpleDataTable import SimpleDataTable class RelevantResults(ClientValue): def __init__(self): super(RelevantResults, self).__init__() self.GroupTemplat...
demos/speech_recognition_with_kaldi_model/python/grpc_stateful_client.py
IntelAI/OpenVINO-model-server
305
11008069
<reponame>IntelAI/OpenVINO-model-server # # Copyright (c) 2020-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/LICENSE-2.0 # # U...
objectModel/Python/cdm/persistence/cdmfolder/projections/operation_array_expansion_persistence.py
rt112000/CDM
884
11008072
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. from typing import TYPE_CHECKING from cdm.enums import CdmObjectType from cdm.persistence.cdmfolder.types import OperationArrayExpansion from .operation_base_pers...
atest/testresources/testlibs/archive_src/ZipLib.py
phil-davis/robotframework
7,073
11008085
<reponame>phil-davis/robotframework class ZipLib: def kw_from_zip(self, arg): print(arg) return arg * 2
txweb2/_version.py
backwardn/ccs-calendarserver
462
11008088
<reponame>backwardn/ccs-calendarserver<filename>txweb2/_version.py # This is an auto-generated file. Do not edit it. from twisted.python import versions version = versions.Version('txweb2', 9, 0, 0)
src/newt/db/tests/testsearch.py
bmjjr/db
153
11008094
from ZODB.utils import u64 import unittest from .. import Object from .base import DBSetup class SearchTests(DBSetup, unittest.TestCase): def setUp(self): super(SearchTests, self).setUp() import newt.db self.db = newt.db.DB(self.dsn) self.conn = self.db.open() def tearDown(se...
spyre/server.py
faqb/spyre
822
11008096
<filename>spyre/server.py import matplotlib matplotlib.use('Agg') import os import os.path import json import jinja2 import matplotlib.pyplot as plt import pandas as pd import numpy as np import copy import cherrypy from cherrypy.lib.static import serve_file from cherrypy.lib.static import serve_fileobj try: imp...
terrascript/onelogin/r.py
mjuenema/python-terrascript
507
11008131
# terrascript/onelogin/r.py # Automatically generated by tools/makecode.py () import warnings warnings.warn( "using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2 ) import terrascript class onelogin_app_role_attachments(terrascript.Resource): pass class onelogin_app_rules(terrascript...
Validation/RecoParticleFlow/python/PFElectronValidation_cff.py
Purva-Chaudhari/cmssw
852
11008140
import FWCore.ParameterSet.Config as cms from DQMOffline.PFTau.PFElectronDQMAnalyzer_cfi import pfElectronDQMAnalyzer pfAllElectrons = cms.EDFilter("PdgIdPFCandidateSelector", pdgId = cms.vint32(11, -11), src = cms.InputTag("particleFlow") ...
scripts/bleu_format.py
isi-nlp/Zoph_RNN
199
11008141
#pass the output of the kbest from the RNN toolkit into this to strip it of the extra padding import codecs import sys import re input_file_name = str(sys.argv[1]) output_file_name = input_file_name + '.bleu' input_file = codecs.open(input_file_name,'r','utf-8') output_file = codecs.open(output_file_name,'w','utf-8')...
encrypted-media/polyfill/make-polyfill-tests.py
ziransun/wpt
14,668
11008156
<filename>encrypted-media/polyfill/make-polyfill-tests.py #!/usr/bin/python from __future__ import print_function import os, re, os.path, glob head = re.compile( r"^(\s*</head>)", re.MULTILINE ) runtest = re.compile( r"runTest\(\s*(\S.*?)\s*\)", re.DOTALL ) scripts = ''' <!-- Polyfill files (NOTE: These are add...
www/tests/global_in_imported.py
raspberrypieman/brython
5,926
11008161
<reponame>raspberrypieman/brython<gh_stars>1000+ X = None def ten(): global X X = 10 def fifteen(): global X X = 15 assert X == None ten() assert X == 10 fifteen() assert X == 15
ppocr/postprocess/locality_aware_nms.py
Bourne-M/PaddleOCR
20,401
11008169
<filename>ppocr/postprocess/locality_aware_nms.py<gh_stars>1000+ """ Locality aware nms. """ import numpy as np from shapely.geometry import Polygon def intersection(g, p): """ Intersection. """ g = Polygon(g[:8].reshape((4, 2))) p = Polygon(p[:8].reshape((4, 2))) g = g.buffer(0) p = p.bu...
jboss_wildfly/tests/common.py
mchelen-gov/integrations-core
663
11008198
# (C) Datadog, Inc. 2010-present # All rights reserved # Licensed under Simplified BSD License (see LICENSE) from datadog_checks.dev import get_docker_hostname, get_here CHECK_NAME = 'jboss_wildfly' HERE = get_here() HOST = get_docker_hostname()
nuplan/planning/simulation/main_callback/metric_file_callback.py
motional/nuplan-devkit
128
11008206
import logging import pathlib import pickle import time from collections import defaultdict import pandas from nuplan.planning.metrics.metric_engine import JSON_FILE_EXTENSION from nuplan.planning.simulation.main_callback.abstract_main_callback import AbstractMainCallback logger = logging.getLogger(__name__) class...
algorithms/set/__init__.py
vansh-tiwari/algorithms
22,426
11008221
<gh_stars>1000+ from .find_keyboard_row import *
boto3_type_annotations/boto3_type_annotations/config/client.py
cowboygneox/boto3_type_annotations
119
11008222
from typing import Optional from botocore.client import BaseClient from typing import Dict from typing import Union from botocore.paginate import Paginator from datetime import datetime from botocore.waiter import Waiter from typing import List class Client(BaseClient): def batch_get_aggregate_resource_config(sel...
tests/module_accounts.py
saivarunr/flask-profiler
749
11008292
# -*- coding: utf8 -*- import unittest from basetest import BaseTest from bson.objectid import ObjectId import arrow from app.modules.accounts import Accounts class TestAccount(BaseTest, unittest.TestCase): ACCOUNTS = [{ "id": None, "fname": "Mustafa", "lname": "Atik", "email": "<...
Core/third_party/JavaScriptCore/Scripts/builtins/builtins_generate_combined_implementation.py
InfiniteSynthesis/lynx-native
677
11008326
<filename>Core/third_party/JavaScriptCore/Scripts/builtins/builtins_generate_combined_implementation.py #!/usr/bin/env python # # Copyright (c) 2014, 2015 Apple Inc. All rights reserved. # Copyright (c) 2014 University of Washington. All rights reserved. # # Redistribution and use in source and binary forms, with or wi...
alipay/aop/api/domain/AlipayTradeCreditPayConsultModel.py
antopen/alipay-sdk-python-all
213
11008347
<filename>alipay/aop/api/domain/AlipayTradeCreditPayConsultModel.py #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayTradeCreditPayConsultModel(object): def __init__(self): self._buyer_credit_source = None self._credit_sce...
lib/datasets/posetrack/poseval/py-motmetrics/motmetrics/apps/list_metrics.py
wjbKimberly/DetectAndTrack-wjb
1,007
11008356
<reponame>wjbKimberly/DetectAndTrack-wjb<filename>lib/datasets/posetrack/poseval/py-motmetrics/motmetrics/apps/list_metrics.py """py-motmetrics - metrics for multiple object tracker (MOT) benchmarking. <NAME>, 2017 https://github.com/cheind/py-motmetrics """ if __name__ == '__main__': import motmetrics m...
PhysicsTools/PatAlgos/python/mcMatchLayer0/electronMatch_cfi.py
ckamtsikis/cmssw
852
11008358
import FWCore.ParameterSet.Config as cms # # Example for a configuration of the MC match # for electrons # electronMatch = cms.EDProducer("MCMatcher", # cut on deltaR, deltaPt/Pt; pick best by deltaR src = cms.InputTag("gedGsfElectrons"), # RECO objects to match matched = cms.InputTag("genPar...
AdminServer/appscale/admin/instance_manager/constants.py
loftwah/appscale
790
11008371
<reponame>loftwah/appscale<filename>AdminServer/appscale/admin/instance_manager/constants.py """ Common constants for managing AppServer instances. """ import os import urllib2 from appscale.common.constants import APPSCALE_HOME class BadConfigurationException(Exception): """ An application is configured incorrec...
plenum/test/input_validation/message_validation/test_propagate_message.py
andkononykhin/plenum
148
11008380
from collections import OrderedDict from plenum.common.messages.fields import LimitedLengthStringField from plenum.common.messages.client_request import ClientMessageValidator from plenum.common.messages.node_messages import Propagate EXPECTED_ORDERED_FIELDS = OrderedDict([ ("request", ClientMessageValidator), ...
venv/Lib/site-packages/statsmodels/tests/__init__.py
EkremBayar/bayar
6,931
11008404
<gh_stars>1000+ # Tests for the package behavior of statsmodels
dl_coursera/define.py
nodamu/dl_coursera
111
11008419
import json from .lib.MyDict import MyDict URL_ROOT = 'https://www.coursera.org' COURSE_0 = 'learning-how-to-learn' def URL_SPEC(slug): return URL_ROOT + '/api/onDemandSpecializations.v1?q=slug&slug={}&fields=courseIds,interchangeableCourseIds,launchedAt,logo,memberships,metadata,partnerIds,premiumExperienceVar...
replay/gather_results.py
anonymous-authors-2018/robotics-repo
524
11008440
<reponame>anonymous-authors-2018/robotics-repo """ Create csv result from a folder of methods """ from __future__ import print_function, division, absolute_import import argparse import json import os import glob from collections import OrderedDict import pandas as pd import numpy as np from scipy.stats import ttest_...
src/pretix/multidomain/migrations/0002_knowndomain_event.py
fabm3n/pretix
1,248
11008444
<gh_stars>1000+ # Generated by Django 2.2.11 on 2020-03-20 14:05 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('pretixbase', '0146_giftcardtransaction_text'), ('pretixmultidomain', '0001_initial'), ] op...
cookies/resources/imgIfMatch.py
meyerweb/wpt
14,668
11008467
<filename>cookies/resources/imgIfMatch.py from cookies.resources import helpers def main(request, response): """Respond to `/cookie/imgIfMatch?name={name}&value={value}` with a 404 if the cookie isn't present, and a transparent GIF otherwise.""" headers = helpers.setNoCacheAndCORSHeaders(request, respon...
scripts/feature_extractor.py
Deepak27004/fk-visual-search
177
11008492
import json import traceback import cv2 __author__ = 'ananya' import caffe import sys sys.path.append("..") from scipy.misc import imresize import numpy as np import os from datetime import datetime class FeatureExtractor(object): def __init__(self, path_to_deploy_file, path_to_model_file, input_layer_name="d...
tests/functional/regressions/test_issue228.py
remorses/tartiflette-whl
530
11008509
<reponame>remorses/tartiflette-whl import pytest from tartiflette import Directive, Resolver, create_engine @pytest.mark.asyncio async def test_issue228_1(): @Resolver("Query.a", schema_name="issue228_1") async def lol(*_args, **_kwargs): return {"ninja": "Ohio"} _engine = await create_engine( ...
L1Trigger/L1TGEM/python/simMuonGEMPadDigis_cfi.py
ckamtsikis/cmssw
852
11008510
import FWCore.ParameterSet.Config as cms from L1Trigger.L1TGEM.simMuonGEMPadDigisDef_cfi import * simMuonGEMPadDigis = simMuonGEMPadDigisDef.clone()
AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/test_main.py
CEOALT1/RefindPlusUDK
2,757
11008514
# -*- coding: utf-8 -*- import sys import codecs import logging import StringIO import unittest from lib2to3 import main class TestMain(unittest.TestCase): def tearDown(self): # Clean up logging configuration down by main. del logging.root.handlers[:] def run_2to3_capture(se...
walking_the_path.py
yun-ji-cho/Ten-lines-or-less
526
11008559
from pathlib import Path def visit(path: Path, depth: int = 0) -> None: for item in path.iterdir(): s = f"{' ' * depth}{item.name}:" if item.is_dir(): print(s) visit(item, depth + 1) else: print(f"{s} {item.stat().st_size:,} bytes") visit(Path("."))
pandashells/test/p_format_test.py
timgates42/pandashells
878
11008576
<reponame>timgates42/pandashells<filename>pandashells/test/p_format_test.py #! /usr/bin/env python from mock import patch from unittest import TestCase import pandas as pd from pandashells.bin.p_format import ( main, ) class MainTests(TestCase): @patch( 'pandashells.bin.p_format.sys.argv', ...
test/item_similarity_calculator_test.py
WingCode/live-project
806
11008596
<filename>test/item_similarity_calculator_test.py import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "prs_project.settings") import django django.setup() import unittest import pandas as pd from recommender.models import Similarity from builder.item_similarity_calculator import ItemSimilarityMatrixBuilder ...
dex-net/src/dexnet/learning/tensor_dataset.py
peter0749/PointNetGPD
193
11008607
<gh_stars>100-1000 # -*- coding: utf-8 -*- """ Copyright ©2017. The Regents of the University of California (Regents). All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for educational, research, and not-for-profit purposes, without fee and without a signed licensi...
tests/test_models/test_common_modules/test_mobilenet_v2.py
rlleshi/mmaction2
1,870
11008628
<filename>tests/test_models/test_common_modules/test_mobilenet_v2.py # Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from mmcv.utils import _BatchNorm from mmaction.models import MobileNetV2 from ..base import check_norm_state, generate_backbone_demo_inputs def test_mobilenetv2_backbone():...
minihinch/gui/widgets/led.py
aabbtree77/esp32-mqtt-experiments
198
11008655
# led.py LED class for nano-gui # Released under the MIT License (MIT). See LICENSE. # Copyright (c) 2018-2020 <NAME> from gui.core.nanogui import DObject, fillcircle, circle from gui.widgets.label import Label class LED(DObject): def __init__(self, writer, row, col, *, height=12, fgcolor=None, ...
bigflow_python/python/bigflow/transform_impls/first.py
tushushu/bigflow
1,236
11008666
#!/usr/bin/env python # -*- coding: utf-8 -*- ######################################################################## # # Copyright (c) 2015 Baidu, 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 o...
aif360/detectors/mdss/ScoringFunctions/Bernoulli.py
IBM/AIF-360
982
11008673
from aif360.detectors.mdss.ScoringFunctions.ScoringFunction import ScoringFunction from aif360.detectors.mdss.ScoringFunctions import optim import numpy as np class Bernoulli(ScoringFunction): def __init__(self, **kwargs): """ Bernoulli score function. May be appropriate to use when the outcome o...
tasks/python3/generateCategoryGroupOrder.py
greck2908/worldview
592
11008684
<filename>tasks/python3/generateCategoryGroupOrder.py<gh_stars>100-1000 #!/usr/bin/env python from optparse import OptionParser import os import json import sys prog = os.path.basename(__file__) parser = OptionParser(usage="Usage: %s <input_dir> <output_dir>" % prog) (options, args) = parser.parse_args() category_di...
tests/unittests/log_filtering_functions/debug_logging/main.py
gohar94/azure-functions-python-worker
277
11008687
<reponame>gohar94/azure-functions-python-worker # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import logging import azure.functions def main(req: azure.functions.HttpRequest): logging.info('logging info', exc_info=True) logging.warning('logging warning', exc_in...
cmake/spirv_ext_inst.py
dnovillo/clspv
480
11008702
#!/usr/bin/env python # Copyright 2019 The Clspv 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 re...
qiskit/algorithms/amplitude_estimators/estimation_problem.py
Roshan-Thomas/qiskit-terra
1,456
11008718
<reponame>Roshan-Thomas/qiskit-terra # This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. #...
e2cnn/nn/modules/r2_conv/basisexpansion.py
marcelroed/e2cnn
356
11008739
<filename>e2cnn/nn/modules/r2_conv/basisexpansion.py from abc import ABC, abstractmethod from torch.nn import Module import torch import numpy as np from typing import List, Iterable, Dict, Union __all__ = ["BasisExpansion"] class BasisExpansion(ABC, Module): def __init__(self): r""" Abs...
lib/rucio/daemons/c3po/collectors/agis.py
andresailer/rucio
187
11008744
<gh_stars>100-1000 ''' Copyright European Organization for Nuclear Research (CERN) 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 Authors: - <NAME...
recipes/Python/466330_Fast_select/recipe-466330.py
tdiprima/code
2,023
11008765
<filename>recipes/Python/466330_Fast_select/recipe-466330.py<gh_stars>1000+ def select(pos, seq): """select(pos, seq): find the nth rank ordered element (the least value has rank 0). Note1: it modifies the seq. Note2: this function is useful with Psyco, otherwise .sort is faster until len(seq)>~3e6"...
Chapter13/Exercise13.04/Test_13_04.py
pmayd/The-Data-Science-Workshop
162
11008779
<filename>Chapter13/Exercise13.04/Test_13_04.py import unittest import import_ipynb import pandas as pd import pandas.testing as pd_testing class Test(unittest.TestCase): def setUp(self): import Exercise_13_04_Logistic_Regression_Model_with_MSMOTE_v1_0 self.exercises = Exercise_13_04_Logist...