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
ex09_sed/testfiles/parseargs.py
techieguy007/learn-more-python-the-hard-way-solutions
466
12741588
<reponame>techieguy007/learn-more-python-the-hard-way-solutions import argparse parser = argparse.ArgumentParser() parser.add_argument('integers', metavar='N', type=int, nargs='+') parser.add_argument('-f', '--foo', help='foo help') parser.add_argument('-b', '--bar', help='bar help') parser.add_argument('-z', '--b...
terrascript/data/rancher/rancher2.py
mjuenema/python-terrascript
507
12741608
<filename>terrascript/data/rancher/rancher2.py # terrascript/data/rancher/rancher2.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:25:37 UTC) import terrascript class rancher2_app(terrascript.Data): pass class rancher2_catalog(terrascript.Data): pass class rancher2_catalog_v2(terrascript...
plugins/modules/nsxt_policy_ip_pool.py
madhukark/ansible-for-nsxt
127
12741622
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2018 VMware, Inc. # SPDX-License-Identifier: BSD-2-Clause OR GPL-3.0-only # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHA...
recipes/Python/111971_Format_version_numbers/recipe-111971.py
tdiprima/code
2,023
12741626
def StringVersion( seq ): return '.'.join( ['%s'] * len( seq )) % tuple( seq ) def TupleVersion( str ): return map( int, str.split( '.' ))
components/aws/sagemaker/tests/unit_tests/tests/deploy/test_deploy_component.py
Strasser-Pablo/pipelines
2,860
12741651
from common.sagemaker_component import SageMakerComponent, SageMakerJobStatus from deploy.src.sagemaker_deploy_spec import SageMakerDeploySpec from deploy.src.sagemaker_deploy_component import ( EndpointRequests, SageMakerDeployComponent, ) from tests.unit_tests.tests.deploy.test_deploy_spec import DeploySpecTe...
tests/test_admin.py
adamlamers/pypicloud
336
12741656
""" Tests for admin endpoints """ from mock import MagicMock from pyramid.httpexceptions import HTTPBadRequest from pypicloud.views.admin import AdminEndpoints from . import MockServerTest class TestAdmin(MockServerTest): """Tests for admin endpoints""" def setUp(self): super(TestAdmin, self).setU...
third_party/gsutil/third_party/apitools/apitools/gen/extended_descriptor.py
tingshao/catapult
2,151
12741707
#!/usr/bin/env python # # Copyright 2015 Google 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 o...
src/test/make_tests_poly1305_reduce.py
ghassanmas/pycryptodome
2,063
12741722
<gh_stars>1000+ """Make unit test for poly1305_reduce()""" from common import counter, make_main, split32 def make_test(value): result = value % (2**130 - 5) h_in = split32(value, 5) h_out = split32(result, 5) print("") print("void test_%d() {" % next(counter)) print(" uint32_t h[5] = {...
tests/strided_range_test.py
jnice-81/dace
227
12741762
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved. import dace from dace.memlet import Memlet import numpy as np sr = dace.SDFG('strided_range_test') s0 = sr.add_state('s0') A = s0.add_array('A', [2, 16, 4], dace.float32) B = s0.add_array('B', [16], dace.float32) tasklet = s0.add_tasklet( ...
pyGPs/Demo/generate_data_for_Rasmussen_examples.py
Corentin-LF/pyGPs
196
12741771
from builtins import zip from builtins import range import numpy as np def save_data_regresssion(): # n = 20 # number of labeled/training data # D = 1 # dimension of input data x = np.array([[2.083970427750732, -0.821018066101379, -0.617870699182597, -1.183822608860694,\ 0.2740...
pano_opt_gen.py
kopetri/LayoutNetv2
166
12741774
import torch import torch.optim as optim import numpy as np from PIL import Image #import pano import pano_gen as pano import time def vecang(vec1, vec2): vec1 = vec1 / np.sqrt((vec1 ** 2).sum()) vec2 = vec2 / np.sqrt((vec2 ** 2).sum()) return np.arccos(np.dot(vec1, vec2)) def rotatevec(vec, theta): ...
app/auth/views.py
taogeT/livetv_server
283
12741800
# -*- coding: UTF-8 -*- from flask import url_for, g, redirect from flask_login import logout_user, current_user from datetime import datetime from importlib import import_module from .. import db, login_manager from ..models import User from . import auth @auth.route('/login/<string:authtype>') def login_authorize(...
tests/unit/cloudsearchdomain/test_cloudsearchdomain.py
Yurzs/boto
5,079
12741803
#!/usr/bin env python import json import mock from tests.unit import AWSMockServiceTestCase from boto.cloudsearch2.domain import Domain from boto.cloudsearch2.layer1 import CloudSearchConnection from boto.cloudsearchdomain.layer1 import CloudSearchDomainConnection class CloudSearchDomainConnectionTest(AWSMockServiceT...
evcouplings/complex/protocol.py
mrunalimanj/EVcouplings
117
12741836
<reponame>mrunalimanj/EVcouplings """ Protocols for matching putatively interacting sequences in protein complexes to create a concatenated sequence alignment Authors: <NAME> <NAME> """ from collections import Counter import numpy as np import pandas as pd from evcouplings.couplings.mapping import Segment from ...
floweaver/layered_graph.py
guest-cc/floweaver
342
12741848
<filename>floweaver/layered_graph.py import networkx as nx from .sankey_definition import Ordering class LayeredMixin(object): def __init__(self): super().__init__() self.ordering = Ordering([]) def copy(self): new = super().copy() new.ordering = self.ordering return ...
jobs/jobs/spiders/zhihu.py
xfsd521/crawler
141
12741881
# -*- coding: utf-8 -*- import scrapy import json class ZhihuSpider(scrapy.Spider): name = 'zhihu' allowed_domains = ['www.zhihu.com'] start_urls = ['https://www.zhihu.com/'] loginUrl = 'https://www.zhihu.com/#signin' siginUrl = 'https://www.zhihu.com/login/email' feedUrl = 'https://www.zhihu...
software/glasgow/applet/memory/floppy/mfm.py
electroniceel/Glasgow
1,014
12741887
import logging __all__ = ["SoftwareMFMDecoder"] class SoftwareMFMDecoder: def __init__(self, logger): self._logger = logger self._lock_time = 0 self._bit_time = 0 def _log(self, message, *args): self._logger.log(logging.DEBUG, "soft-MFM: " + message, *args) def edge...
src/examples/voice/assistant_library_demo.py
SanchitMisal/aiyprojects-raspbian
1,610
12741892
<reponame>SanchitMisal/aiyprojects-raspbian #!/usr/bin/env python3 # Copyright 2017 Google 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-...
env/lib/python3.8/site-packages/plotly/validators/layout/template/data/_scattermapbox.py
acrucetta/Chicago_COVI_WebApp
11,750
12741917
<gh_stars>1000+ import _plotly_utils.basevalidators class ScattermapboxValidator(_plotly_utils.basevalidators.CompoundArrayValidator): def __init__( self, plotly_name="scattermapbox", parent_name="layout.template.data", **kwargs ): super(ScattermapboxValidator, self).__init__( plot...
webapp/tests/test_dashboard.py
romanek-adam/graphite-web
4,281
12741925
<filename>webapp/tests/test_dashboard.py import copy import errno import mock import os from . import TEST_CONF_DIR from django.conf import settings try: from django.urls import reverse except ImportError: # Django < 1.10 from django.core.urlresolvers import reverse from django.http import HttpResponse from ...
aws_ir/libs/connection.py
jeffb4/aws_ir
308
12741934
import boto3 import logging logger = logging.getLogger(__name__) class Connection(object): def __init__(self, type, service=None, region='us-west-2', profile='default'): self.region = region self.connection_type = type self.service = service self.client = None self.resourc...
Ryven/packages/auto_generated/asynchat/nodes.py
tfroehlich82/Ryven
2,872
12741938
<gh_stars>1000+ from NENV import * import asynchat class NodeBase(Node): pass class Find_Prefix_At_End_Node(NodeBase): """ """ title = 'find_prefix_at_end' type_ = 'asynchat' init_inputs = [ NodeInputBP(label='haystack'), NodeInputBP(label='needle'), ] init_out...
generator.py
Nyrize/LipGAN
435
12741957
<gh_stars>100-1000 from keras.models import load_model import numpy as np from keras.optimizers import Adam from keras.models import Model from keras.layers import Dense, Conv2DTranspose, Conv2D, BatchNormalization, \ Activation, Concatenate, Input, MaxPool2D,\ UpSampling2D, ZeroPadding2D, Lambda, Add from...
lite/examples/recommendation/ml/model/recommendation_model_launcher_test.py
duy-maimanh/examples
6,484
12741966
# Lint as: python3 # Copyright 2021 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...
tests/solver_tests.py
stantonious/pymaze
154
12741968
from __future__ import absolute_import import unittest from src.solver import Solver class TestSolver(unittest.TestCase): def test_ctor(self): solver = Solver("", "", False) self.assertEqual(solver.name, "") self.assertEqual(solver.quiet_mode, False) if __name__ == "__main__": uni...
app/lib/api/records.py
grepleria/SnitchDNS
152
12741991
<filename>app/lib/api/records.py from app.lib.base.provider import Provider from app.lib.api.base import ApiBase from app.lib.api.definitions.record import Record class ApiRecords(ApiBase): def all(self, user_id, zone_id=None, domain=None): provider = Provider() zones = provider.dns_zones() ...
qutip/tests/test_stochastic_me.py
quantshah/qutip
1,205
12742005
import pytest import numpy as np from numpy.testing import assert_, run_module_suite from qutip import (smesolve, mesolve, photocurrent_mesolve, liouvillian, QobjEvo, spre, spost, destroy, coherent, parallel_map, qeye, fock_dm, general_stochastic, ket2dm, num) def f(t, args): ...
neuralmonkey/runners/xent_runner.py
ufal/neuralmonkey
446
12742010
from typing import Dict, List, Union from typeguard import check_argument_types import tensorflow as tf import numpy as np from neuralmonkey.decoders.autoregressive import AutoregressiveDecoder from neuralmonkey.decoders.sequence_labeler import SequenceLabeler from neuralmonkey.decorators import tensor from neuralmon...
tests/integration/cattletest/core/test_audit_log.py
lifecontrol/cattle
482
12742014
<reponame>lifecontrol/cattle from common_fixtures import * # NOQA from copy import deepcopy def made_log(object, admin_user_client, context, accountId=None): t = object.type if t == 'stack': t = 'stack' logs = admin_user_client.list_audit_log(resourceId=object.id, ...
smoke-test/test_e2e.py
ShubhamThakre/datahub
289
12742018
<reponame>ShubhamThakre/datahub import time import urllib import pytest import requests from datahub.cli.docker import check_local_docker_containers from datahub.ingestion.run.pipeline import Pipeline from tests.utils import ingest_file_via_rest GMS_ENDPOINT = "http://localhost:8080" FRONTEND_ENDPOINT = "http://loca...
modules/rtm2org.py
hwiorn/orger
241
12742048
<filename>modules/rtm2org.py #!/usr/bin/env python3 from orger import StaticView from orger.inorganic import node, link from orger.common import dt_heading from my.rtm import active_tasks class RtmView(StaticView): def get_items(self): for t in active_tasks(): yield t.uid, node( ...
algorithms/maths/primes_sieve_of_eratosthenes.py
zhengli0817/algorithms
128
12742074
<reponame>zhengli0817/algorithms ''' Using sieve of Eratosthenes, primes(x) returns list of all primes less than x Modification: We don't need to check all even numbers, we can make the sieve excluding even numbers and adding 2 to the primes list by default. We are going to make an array of: x / 2 - 1 if number is ev...
codalab/scripts/compute.py
AIMultimediaLab/AI4Media-EaaS-prototype-Py2-public
333
12742078
<filename>codalab/scripts/compute.py #!/usr/bin/env python # # import web urls = ('/api/computation/(.+)', 'computation') class computation: def GET(self, id): print "ID: %s" % id if __name__ == "__main__": app = web.application(urls, globals()) app.internalerror = web.debugerror app.run()
ad_examples/timeseries/word2vec_custom.py
matwey/ad_examples
773
12742079
<filename>ad_examples/timeseries/word2vec_custom.py import numpy as np import numpy.random as rnd import tensorflow as tf from ..common.utils import Timer, logger """ This is a simplified version of TensorFlow word2vec_basic.py The primary purpose is pedagogical. Instead of calling some tensorflow functions such as ...
removestar/tests/test_removestar.py
asmeurer/removestar
102
12742089
from pyflakes.checker import Checker import sys import ast import os from pathlib import Path from filecmp import dircmp import subprocess from pytest import raises import pytest from ..removestar import (names_to_replace, star_imports, get_names, get_names_from_dir, get_names_dynamically, ...
tests/builtins/test_list.py
jacebrowning/voc
850
12742093
from .. utils import TranspileTestCase, BuiltinFunctionTestCase, SAMPLE_SUBSTITUTIONS class ListTests(TranspileTestCase): pass class BuiltinListFunctionTests(BuiltinFunctionTestCase, TranspileTestCase): functions = ["list"] substitutions = dict(SAMPLE_SUBSTITUTIONS) substitutions.update({ "...
src/tests/test_sites/test_utils.py
winkidney/PickTrue
118
12742110
<reponame>winkidney/PickTrue<filename>src/tests/test_sites/test_utils.py from picktrue.sites import utils def test_get_name_ext_from_url(): assert utils.get_filename_fom_url( "https://img9.doubanio.com/view/photo/l/public/p2208623414.jpg" ) == "p2208623414.jpg" assert utils.get_filename_fom_url( ...
CPAC/func_preproc/func_preproc.py
FCP-INDI/C-PAC
125
12742174
<filename>CPAC/func_preproc/func_preproc.py from nipype import logging from nipype.interfaces import ants logger = logging.getLogger('workflow') from CPAC.pipeline import nipype_pipeline_engine as pe import nipype.interfaces.fsl as fsl import nipype.interfaces.utility as util from nipype.interfaces import afni from n...
scripts/ipa_to_sql.py
btrungchi/English-to-IPA
195
12742188
from eng_to_ipa import transcribe import sqlite3 import re from os.path import join, abspath, dirname conn = sqlite3.connect(join(abspath(dirname(__file__)), "../eng_to_ipa/resources/CMU_dict.db")) c = conn.cursor() def create_dictionary_table(): try: c.execute("""CREATE TABLE...
utest/resources/robotdata/libs/sub/libsi.py
ludovicurbain/SWIFT-RIDE
775
12742200
<filename>utest/resources/robotdata/libs/sub/libsi.py def libsi_keyword(): print('libsi keyword')
babyai/rl/utils/supervised_losses.py
m-smith/babyai
411
12742213
import torch import torch.nn.functional as F import numpy from babyai.rl.utils import DictList # dictionary that defines what head is required for each extra info used for auxiliary supervision required_heads = {'seen_state': 'binary', 'see_door': 'binary', 'see_obj': 'binary', ...
tests/RunTests/PythonTests/test2011_036.py
maurizioabba/rose
488
12742214
<gh_stars>100-1000 class num(): def __init__(self, n): self.n = n print "init", self.n def __enter__(self): print "enter", self.n return (self.n, self.n**2) def __exit__(self, type, value, traceback): print "exit", self.n pass # simple (non-targetted) with-st...
apps/bible/utils/translations.py
goztrk/django-htk
206
12742239
<reponame>goztrk/django-htk # HTK Imports from htk.utils import htk_setting from htk.utils.general import resolve_model_dynamically def get_translation_model(translation): translations_map = htk_setting('HTK_BIBLE_TRANSLATIONS_MAP') translation_model_class = translations_map.get(translation.upper()) trans...
h2o-py/tests/testdir_misc/pyunit_pop.py
ahmedengu/h2o-3
6,098
12742241
<gh_stars>1000+ from __future__ import print_function import sys sys.path.insert(1,"../../") import h2o from tests import pyunit_utils def pyunit_pop(): pros = h2o.import_file(pyunit_utils.locate("smalldata/prostate/prostate.csv")) nc = pros.ncol popped_col = pros.pop(pros.names[0]) print(pros.dim) prin...
ortools/sat/samples/nurses_sat.py
magneticflux-/or-tools
8,273
12742243
#!/usr/bin/env python3 # Copyright 2010-2021 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
galileo/platform/path_helper.py
YaoPu2021/galileo
115
12742282
<gh_stars>100-1000 # Copyright 2020 JD.com, Inc. Galileo 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 # # U...
chapter03/3-2.py
alberthao/Python-Crash-Course-Homework
138
12742285
names = ['David','Herry','Army'] message1 = "hello " + names[0] print(message1) message1 = "hello " + names[1] print(message1) message1 = "hello " + names[2] print(message1)
quetz/authentication/jupyterhub.py
maresb/quetz
108
12742286
<reponame>maresb/quetz<gh_stars>100-1000 # Copyright 2020 QuantStack, Codethink Ltd # Distributed under the terms of the Modified BSD License. import json from typing import Any, List, overload from urllib.parse import quote from quetz.config import Config, ConfigEntry, ConfigSection from .oauth2 import OAuthAuthent...
custom_components/hacs/constrains.py
svkowalski/HAcore_QNAP
167
12742340
"""HACS Startup constrains.""" # pylint: disable=bad-continuation import os from .const import CUSTOM_UPDATER_LOCATIONS, CUSTOM_UPDATER_WARNING from .helpers.misc import version_left_higher_then_right from custom_components.hacs.globals import get_hacs MINIMUM_HA_VERSION = "0.110.0" def check_constrains(): """...
river/compose/func.py
fox-ds/river
2,184
12742345
<filename>river/compose/func.py import typing from river import base __all__ = ["FuncTransformer"] class FuncTransformer(base.Transformer): """Wraps a function to make it usable in a pipeline. There is often a need to apply an arbitrary transformation to a set of features. For instance, this could invo...
green/test/test_loader.py
jwaschkau/green
686
12742384
<gh_stars>100-1000 from __future__ import unicode_literals import os from os.path import dirname import platform import shutil import sys import tempfile from textwrap import dedent import unittest try: from unittest.mock import MagicMock, patch except: from mock import MagicMock, patch from green import load...
source/utils/bp5dbg/adios2/bp5dbg/utils.py
gregorweiss/ADIOS2
190
12742415
<reponame>gregorweiss/ADIOS2 LocalValueDim = 18446744073709551613 dataTypes = { -1: 'unknown', 0: 'byte', 1: 'short', 2: 'integer', 4: 'long', 50: 'unsigned_byte', 51: 'unsigned_short', 52: 'unsigned_integer', 54: 'unsigned_long', 5: 'real', 6: 'double', 7: 'long_doub...
imagenet/optim/qhm.py
batuozt/transformer-ls
177
12742437
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import torch from torch.optim import Optimizer class QHM(Optimizer): r""" Stochastic gradient method with Quasi-Hyperbolic Momentum (QHM): h(k) = (1 - \beta) * g(k) + \beta * h(k-1) d(k) = (1 - \nu) * g(k) + \nu * h(k) ...
mmdet/utils/__init__.py
Joanna0123/QueryInst
326
12742449
from .collect_env import collect_env from .logger import get_root_logger from .optimizer import OptimizerHook __all__ = ['get_root_logger', 'collect_env', 'OptimizerHook']
integration/tests/follow_redirect.py
youhavethewrong/hurl
1,013
12742490
<reponame>youhavethewrong/hurl<filename>integration/tests/follow_redirect.py from tests import app from flask import redirect @app.route('/follow-redirect') def follow_redirect(): return redirect('http://localhost:8000/following-redirect') @app.route('/following-redirect') def following_redirect(): return red...
heat/tests/convergence/scenarios/update_replace_missed_cleanup.py
noironetworks/heat
265
12742532
<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 wri...
third_party/blink/tools/blinkpy/common/net/git_cl_mock.py
zealoussnow/chromium
14,668
12742535
<gh_stars>1000+ # Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from blinkpy.common.net.git_cl import CLStatus, GitCL from blinkpy.common.system.executive import ScriptError # pylint: disable=unused-argum...
insights/parsers/ipaupgrade_log.py
mglantz/insights-core
121
12742541
<gh_stars>100-1000 """ IpaupgradeLog - file ``/var/log/ipaupgrade.log`` ================================================ This file records the information of IPA server upgrade process while executing command ``ipa-server-upgrade`` """ from .. import LogFileOutput, parser from insights.specs import Specs @parser(Sp...
dreamcoder/domains/regex/main.py
Dragon-hxl/LARC
290
12742550
<reponame>Dragon-hxl/LARC # analog of list.py for regex tasks. Responsible for actually running the task. from dreamcoder.domains.regex.makeRegexTasks import makeOldTasks, makeLongTasks, makeShortTasks, makeWordTasks, makeNumberTasks, makeHandPickedTasks, makeNewTasks, makeNewNumberTasks from dreamcoder.domains.regex....
ufora/networking/DemuxedTransport.py
ufora/ufora
571
12742553
<reponame>ufora/ufora # Copyright 2015 Ufora 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 applica...
hgtk/__init__.py
bluedisk/hangul-tools
271
12742576
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import division from . import text from . import letter from . import checker from . import josa
V2RaycSpider1225/src/BusinessLogicLayer/apis/cluster_api/sspanel_parser.py
QIN2DIM/V2RayCloudSpider
891
12742590
# -*- coding: utf-8 -*- # Time : 2021/7/25 13:59 # Author : QIN2DIM # Github : https://github.com/QIN2DIM # Description: import json import os from datetime import datetime from bs4 import BeautifulSoup from selenium.common.exceptions import ( StaleElementReferenceException, WebDriverException, ...
virl/cli/search/commands.py
tombry/virlutils
133
12742619
<filename>virl/cli/search/commands.py import click from virl.api import ViewerPlugin, NoPluginError from virl.api.github import get_repos from virl.cli.views.search import repo_table @click.command() @click.argument("query", required=False) @click.option("--org", default="virlfiles", required=False, help="GitHub orga...
test/qa-tests/buildscripts/resmokelib/testing/hooks.py
tfogo/mongo-tools
828
12742626
""" Customize the behavior of a fixture by allowing special code to be executed before or after each test, and before or after each suite. """ from __future__ import absolute_import import os import sys import bson import pymongo from . import fixtures from . import testcases from .. import errors from .. import lo...
configs/mmdet/detection/detection_openvino_dynamic-800x1344.py
zhiqwang/mmdeploy
746
12742646
_base_ = ['../_base_/base_openvino_dynamic-800x1344.py']
test_elasticsearch/test_client/__init__.py
jkbak/elasticsearch-py
3,353
12742669
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use ...
backend/api/actions/compose.py
wickedyoda/Yacht
1,452
12742690
<gh_stars>1000+ from fastapi import HTTPException from fastapi.responses import StreamingResponse from sh import docker_compose import os import yaml import pathlib import shutil import docker import io import zipfile from api.settings import Settings from api.utils.compose import find_yml_files settings = Settings()...
grr/client/grr_response_client/client_actions/network_test.py
khanhgithead/grr
4,238
12742719
#!/usr/bin/env python """Tests the Netstat client action.""" from absl import app from grr_response_client.client_actions import network from grr_response_core.lib.rdfvalues import client_action as rdf_client_action from grr.test_lib import client_test_lib from grr.test_lib import test_lib class NetstatActionTest(c...
gammapy/data/tests/test_observers.py
Rishank2610/gammapy
155
12742733
<reponame>Rishank2610/gammapy # Licensed under a 3-clause BSD style license - see LICENSE.rst from numpy.testing import assert_allclose from astropy.coordinates import Angle from gammapy.data import observatory_locations def test_observatory_locations(): location = observatory_locations["hess"] assert_allclos...
autoregressive_diffusion/experiments/language/architectures/arm.py
xxdreck/google-research
23,901
12742735
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
tests/test_notify.py
noi4eg/maigret
1,156
12742761
<reponame>noi4eg/maigret from maigret.errors import CheckError from maigret.notify import QueryNotifyPrint from maigret.result import QueryStatus, QueryResult def test_notify_illegal(): n = QueryNotifyPrint(color=False) assert ( n.update( QueryResult( username="test", ...
mmtbx/command_line/fake_f_obs.py
dperl-sol/cctbx_project
155
12742780
from __future__ import absolute_import, division, print_function # LIBTBX_SET_DISPATCHER_NAME phenix.fake_f_obs from cctbx import adptbx from cctbx.array_family import flex import random, math, sys, os import iotbx.pdb import mmtbx.utils from libtbx import easy_run import mmtbx.dynamics.cartesian_dynamics as cartesian...
tests/test_alpaca_crypto_data_loader.py
ksilo/LiuAlgoTrader
369
12742811
from datetime import date, datetime import pandas as pd import pytest from alpaca_trade_api.rest import TimeFrame from pytz import timezone from liualgotrader.common import config from liualgotrader.common.data_loader import DataLoader # type: ignore from liualgotrader.common.types import DataConnectorType, TimeScal...
core/polyaxon/polyflow/events/__init__.py
admariner/polyaxon
3,200
12742815
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
uliweb/i18n/i18ntool.py
timgates42/uliweb
202
12742817
<reponame>timgates42/uliweb import os from optparse import make_option from uliweb.core import SimpleFrame from uliweb.utils.common import pkg from uliweb.core.commands import Command #def getfiles(path): # files_list = [] # if os.path.exists(os.path.abspath(os.path.normpath(path))): # if os.path...
convokit/text_processing/textToArcs.py
CornellNLP/Cornell-Conversational-Analysis-Toolkit
371
12742825
from .textProcessor import TextProcessor def _use_text(tok, sent): return tok['tok'].isalpha() or tok['tok'][1:].isalpha() class TextToArcs(TextProcessor): """ Transformer that outputs a collection of arcs in the dependency parses of each sentence of an utterance. The returned collection is a list where each elem...
tests/protocols/airplay/test_airplay_scan.py
Jacobs4/pyatv
532
12742833
"""Scanning tests with fake mDNS responder..""" from ipaddress import ip_address import pytest from pyatv.const import Protocol from tests import fake_udns from tests.conftest import Scanner from tests.utils import assert_device IP_1 = "10.0.0.1" AIRPLAY_NAME = "AirPlay ATV" AIRPLAY_ID = "AA:BB:CC:DD:EE:FF" pyte...
python/examples/tic-tac-toe/tictactoebot.py
Vindexus/boardgame.io
7,080
12742836
#!/usr/bin/python # # Copyright 2018 The boardgame.io Authors # # Use of this source code is governed by a MIT-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/MIT. # # pylint: disable=invalid-name,multiple-imports,global-statement # To play against this bot, start the tict...
python/cuxfilter/charts/core/core_chart.py
Anhmike/cuxfilter
201
12742852
<gh_stars>100-1000 import functools import cudf import dask_cudf import logging import panel as pn from bokeh.models import ColumnDataSource from panel.config import panel_extension from panel.io import state from panel.util import edit_readonly from typing import Dict from ...assets import datetime as dt class Base...
falsy/utils/meta.py
marco-souza/falsy
127
12742872
<reponame>marco-souza/falsy<filename>falsy/utils/meta.py<gh_stars>100-1000 class Meta(dict): def __getattr__(self, name): try: return self[name] except KeyError: raise AttributeError(name) def __setattr__(self, name, value): self[name] = value def bind(self,...
python/tvm/relay/testing/nat.py
XiaoSong9905/tvm
4,640
12742881
<gh_stars>1000+ # 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"...
pxr/base/tf/testenv/testTfPyStaticTokens.py
DougRogers-DigitalFish/USD
3,680
12742887
#!/pxrpythonsubst # # Copyright 2016 Pixar # # Licensed under the Apache License, Version 2.0 (the "Apache License") # with the following modification; you may not use this file except in # compliance with the Apache License and the following modification to it: # Section 6. Trademarks. is deleted and replaced with: # ...
safedelete/tests/test_invisible.py
davidastephens/django-safedelete
505
12742894
from django.db import models from ..models import SafeDeleteModel from .testcase import SafeDeleteTestCase class InvisibleModel(SafeDeleteModel): # SafeDeleteModel subclasses automatically have their visibility set to invisible. name = models.CharField( max_length=100 ) class VisibilityTestCas...
clang/test/AST/gen_ast_dump_json_test.py
mkinsner/llvm
653
12742905
<reponame>mkinsner/llvm #!/usr/bin/env python3 from __future__ import print_function from collections import OrderedDict from shutil import copyfile import argparse import json import os import re import subprocess import sys import tempfile def normalize(dict_var): for k, v in dict_var.items(): if isins...
PaddleCV/adversarial/advbox/__init__.py
suytingwan/models
819
12742940
<gh_stars>100-1000 """ A set of tools for generating adversarial example on paddle platform """
examples/python/templates/multi-page-apps/responsive-collapsible-sidebar/sidebar.py
glsdown/dash-bootstrap-components
776
12742951
<reponame>glsdown/dash-bootstrap-components """ This app creates a collapsible, responsive sidebar layout with dash-bootstrap-components and some custom css with media queries. When the screen is small, the sidebar moved to the top of the page, and the links get hidden in a collapse element. We use a callback to toggl...
pypy2.7/module/_multiprocess/interp_win32.py
UniverseFly/multiprocess
356
12742993
from rpython.rlib import rwin32 from rpython.rlib.rarithmetic import r_uint from rpython.rtyper.lltypesystem import lltype, rffi from rpython.rtyper.tool import rffi_platform from rpython.translator.tool.cbuild import ExternalCompilationInfo from pypy.interpreter.error import oefmt, wrap_windowserror from pypy.interpr...
calvin/actorstore/systemactors/media/ImageSource.py
gabrielcercel/calvin-base
334
12743011
# -*- coding: utf-8 -*- # Copyright (c) 2016-17 Ericsson AB # # 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...
python/render_vision_dataset/render_verify_pixel2block.py
boldsort/craftassist
626
12743046
""" Copyright (c) Facebook, Inc. and its affiliates. """ import argparse import logging import os import subprocess import random import cv2 import numpy as np import sys python_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.insert(0, python_dir) from cuberite_process import CuberitePr...
tests/test_e01_link_options.py
simonvh/genomepy
112
12743061
import pytest skip = False if not skip: @pytest.fixture(scope="module", params=["primary_assembly", "toplevel"]) def assembly(request): return request.param @pytest.fixture(scope="module", params=["98", None]) def release_version(request): return request.param @pytest.fixture(sco...
anchore_engine/services/apiext/api/controllers/image_imports.py
rbrady/anchore-engine
1,484
12743073
<gh_stars>1000+ import datetime from connexion import request from anchore_engine.apis import exceptions as api_exceptions from anchore_engine.apis.authorization import ( ActionBoundPermission, RequestingAccountValue, get_authorizer, ) from anchore_engine.apis.context import ApiRequestContextProxy from an...
athena/utils/learning_rate.py
godjealous/athena
119
12743090
# coding=utf-8 # Copyright (C) ATHENA 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 ...
pythran/tests/cases/goodExpoMeasure.py
davidbrochart/pythran
1,647
12743112
#runas import numpy as np; n = 20; a = np.arange(n*n*n).reshape((n,n,n)).astype(np.uint8); b = 2. ; goodExpoMeasure(a, b) #pythran export goodExpoMeasure(uint8[][][], float) import numpy def goodExpoMeasure(inRGB, sigma): ''' Compute the good exposition image quality measure on 1 input image. ''' R = in...
wxpy/api/messages/message.py
yylingyun/wxpy
14,391
12743113
<reponame>yylingyun/wxpy # coding: utf-8 from __future__ import unicode_literals import logging import os import tempfile import weakref from datetime import datetime from xml.etree import ElementTree as ETree try: import html except ImportError: # Python 2.6-2.7 # noinspection PyUnresolvedReferences,PyUn...
zhaquirks/aduro/__init__.py
WolfRevo/zha-device-handlers
213
12743135
"""ADUROLIGHT module for custom device handlers."""
sdk/python/feast/infra/online_stores/datastore.py
kevjumba/feast
810
12743162
<filename>sdk/python/feast/infra/online_stores/datastore.py # Copyright 2021 The Feast 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 # # https://www.apache.org/licenses/LICENSE-...
elliot/hyperoptimization/model_coordinator.py
pkaram/elliot
175
12743169
""" Module description: """ __version__ = '0.3.1' __author__ = '<NAME>, <NAME>' __email__ = '<EMAIL>, <EMAIL>' from types import SimpleNamespace import typing as t import numpy as np import logging as pylog from elliot.utils import logging from hyperopt import STATUS_OK class ModelCoordinator(object): """ ...
src/RelativeDepthDataset.py
JasonQSY/YouTube3D
102
12743178
import numpy as np import random from utils import save_obj, load_obj import torch from torch.utils import data import cv2 import os import h5py from ReDWebNet import resNet_data_preprocess ####################################################################### ##### ATTENTION: ##### When using this dataset, set the...
rbtools/clients/errors.py
ngie-eign/rbtools
113
12743190
<reponame>ngie-eign/rbtools<filename>rbtools/clients/errors.py """Error definitions for SCMClient implementations.""" from __future__ import unicode_literals class SCMError(Exception): """A generic error from an SCM.""" class AuthenticationError(Exception): """An error for when authentication fails.""" c...
kitsune/motidings/tests/__init__.py
AndrewDVXI/kitsune
929
12743195
from factory import fuzzy from factory.django import DjangoModelFactory from tidings.models import Watch class WatchFactory(DjangoModelFactory): class Meta: model = Watch event_type = "fooevent" is_active = True secret = fuzzy.FuzzyText(length=10)