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
tests/functional/basic/test_basic.py
tomasfarias/dbt-core
799
12752529
import pytest from dbt.tests.util import run_dbt, get_manifest my_model_sql = """ select 1 as fun """ @pytest.fixture(scope="class") def models(): return {"my_model.sql": my_model_sql} def test_basic(project): # Tests that a project with a single model works results = run_dbt(["run"]) assert len...
test/nn/test_reshape.py
mrmotallebi/pytorch_geometric
12,651
12752532
import torch from torch_geometric.nn.reshape import Reshape def test_reshape(): x = torch.randn(10, 4) op = Reshape(5, 2, 4) assert op.__repr__() == 'Reshape(5, 2, 4)' assert op(x).size() == (5, 2, 4) assert op(x).view(10, 4).tolist() == x.tolist()
src/genie/libs/parser/nxos/show_system.py
balmasea/genieparser
204
12752559
<filename>src/genie/libs/parser/nxos/show_system.py """show_system.py NXOS parsers for the following show commands: * 'show system internal sysmgr service name <WORD>' * 'show system internal l2fwder Mac' * 'show system internal processes memory' """ # Python import re # Metaparser from genie.metaparser ...
ib/ext/EWrapperMsgGenerator.py
LewisW/IbPy
1,260
12752574
<filename>ib/ext/EWrapperMsgGenerator.py #!/usr/bin/env python """ generated source for module EWrapperMsgGenerator """ # # Original file copyright original author(s). # This file copyright <NAME>, <EMAIL>. # # WARNING: all changes to this file will be lost. from ib.ext.AnyWrapperMsgGenerator import AnyWrapperMsgGener...
model-optimizer/extensions/front/onnx/cast_ext.py
monroid/openvino
2,406
12752579
<filename>model-optimizer/extensions/front/onnx/cast_ext.py # Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 from extensions.ops.Cast import Cast from mo.front.extractor import FrontExtractorOp from mo.front.onnx.extractors.utils import get_onnx_datatype_as_numpy, onnx_attr class Cas...
src/genie/libs/parser/ios/show_prefix_list.py
nujo/genieparser
204
12752581
"""show_prefix_list.py IOS parsers for the following show commands: * show ip prefix-list detail * show ipv6 prefix-list detail """ from genie.libs.parser.iosxe.show_prefix_list import ShowIpPrefixListDetail as ShowIpPrefixListDetail_iosxe,\ ShowIpv6Prefix...
samples/keras/mnist.py
elgalu/labml
463
12752589
<reponame>elgalu/labml<gh_stars>100-1000 # This example is based on the following examples # https://www.tensorflow.org/tutorials/quickstart/beginner import tensorflow as tf from labml import experiment from labml.utils.keras import LabMLKerasCallback def main(): experiment.create(name='MNIST Keras') (x_tr...
src/azure-cli/azure/cli/command_modules/eventgrid/commands.py
YuanyuanNi/azure-cli
3,287
12752594
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
tests/metrics/test_token_classification.py
techthiyanes/rubrix
888
12752609
<reponame>techthiyanes/rubrix import httpx import pytest import rubrix import rubrix as rb from rubrix.metrics.token_classification import ( Annotations, entity_capitalness, entity_consistency, entity_density, entity_labels, f1, mention_length, tokens_length, token_length, token...
tests/test_termcounts_asscs.py
flying-sheep/goatools
477
12752622
#!/usr/bin/env python """Test TermCounts object used in Resnik and Lin similarity calculations.""" from __future__ import print_function import os import sys import timeit import datetime from goatools.base import get_godag from goatools.semantic import TermCounts from goatools.semantic import get_info_content from g...
tests/test_level4/test_playing.py
kianmeng/soupsieve
130
12752633
"""Test playing selectors.""" from .. import util class TestPlaying(util.TestCase): """Test playing selectors.""" MARKUP = """ <!DOCTYPE html> <html> <body> <video id="vid" width="320" height="240" controls> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="...
redbot/message/headers/tcn.py
kinow/redbot
167
12752634
<reponame>kinow/redbot #!/usr/bin/env python from redbot.message import headers class tcn(headers.HttpHeader): canonical_name = "TCN" description = """\ The `TCN` header field is part of an experimental transparent content negotiation scheme. It is not widely supported in clients. """ reference = "https...
skater/core/local_interpretation/lime/lime_tabular.py
RPUTHUMA/Skater
718
12752653
""" Making LimeTabularExplainer Accessible """ from lime.lime_tabular import LimeTabularExplainer
sktime/forecasting/croston.py
marcio55afr/sktime
5,349
12752664
<reponame>marcio55afr/sktime # -*- coding: utf-8 -*- # !/usr/bin/env python3 -u # copyright: sktime developers, BSD-3-Clause License (see LICENSE file) """Croston's Forecasting Method.""" import numpy as np import pandas as pd from sktime.forecasting.base import BaseForecaster from sktime.forecasting.base._base impor...
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_shellutil_cfg.py
CiscoDevNet/ydk-py
177
12752669
""" Cisco_IOS_XR_shellutil_cfg This module contains a collection of YANG definitions for Cisco IOS\-XR shellutil package configuration. This module contains definitions for the following management objects\: host\-names\: Container Schema for hostname configuration Copyright (c) 2013\-2018 by Cisco Systems, Inc. ...
rtools/install_package.py
scw/r-tools-install
193
12752691
# Py3 compat layer from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import import arcpy import glob import os import shutil import sys # create a handle to the windows kernel; want to make Win API calls try: import ctypes from ctypes import wintype...
tests/capi2_cores/misc/generate/testgen.py
idex-biometrics/fusesoc
829
12752697
<reponame>idex-biometrics/fusesoc # Copyright FuseSoC contributors # Licensed under the 2-Clause BSD License, see LICENSE for details. # SPDX-License-Identifier: BSD-2-Clause import sys import yaml template = """CAPI=2: name : {} targets: default: parameters: [p] parameters: p: datatype : str paramty...
demo/demo_bbox_detector.py
realblack0/eft
241
12752751
<filename>demo/demo_bbox_detector.py # Copyright (c) Facebook, Inc. and its affiliates. import os import sys import numpy as np import cv2 import torch import torchvision.transforms as transforms from PIL import Image ##Yolo related yolo_path = './PyTorch-YOLOv3' sys.path.append(yolo_path) try: from models impo...
dmb/data/loaders/__init__.py
jiaw-z/DenseMatchingBenchmark
160
12752797
<reponame>jiaw-z/DenseMatchingBenchmark from .builder import build_data_loader
reinforcement_learning/dqn/atari_utils.py
AaratiAkkapeddi/nnabla-examples
228
12752800
<filename>reinforcement_learning/dqn/atari_utils.py # Copyright 2019,2020,2021 Sony Corporation. # Copyright 2021 Sony Group Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
django_covid19/apps.py
zhangguoyuanshuai/Python-Covid19API
103
12752814
<filename>django_covid19/apps.py from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ class DjangoCovid19Config(AppConfig): name = 'django_covid19' verbose_name = _('django_covid19') def ready(self): import django_covid19.signals
urduhack/tokenization/wtk.py
cinfotech94/urduhackk
252
12752838
<reponame>cinfotech94/urduhackk """SentencePiece based word tokenizer module""" from pathlib import Path from typing import List import sentencepiece as spm from urduhack.stop_words import STOP_WORDS def _is_token(pieces: list, special_symbol: str = "▁") -> List[str]: """ Check for stopwords and actual word...
interactive_control_train.py
mohamedSabry0/new_autoRCCar
333
12752870
#!/usr/bin/env python """Interactive control for the car""" import time import io import pygame import pygame.font import picamera import configuration import helpers.motor_driver as motor_driver_helper import helpers.image as image_helper UP = LEFT = DOWN = RIGHT = ACCELERATE = DECELERATE = False def get_keys(): ...
Trakttv.bundle/Contents/Libraries/Shared/plex_database/models/directory.py
disrupted/Trakttv.bundle
1,346
12752883
<gh_stars>1000+ from plex_database.core import db from plex_database.models.library_section import LibrarySection from peewee import * class Directory(Model): class Meta: database = db db_table = 'directories' library_section = ForeignKeyField(LibrarySection, null=True, related_name='directo...
commands/uninstall/__init__.py
tamarindmonkey/.oh-my-comma
102
12752884
#!/usr/bin/python # -*- coding: utf-8 -*- from commands.base import CommandBase from py_utils.emu_utils import run, error, input_with_options, UNINSTALL_PATH class Uninstall(CommandBase): def __init__(self): super().__init__() self.name = 'uninstall' self.description = '👋 Uninstalls emu' @staticmeth...
tests/test_crc32c.py
shirui-japina/tensorboardX
5,378
12752886
import unittest from tensorboardX.crc32c import _crc32c, _crc32c_native, crc32c class CRC32CTest(unittest.TestCase): def test_crc32c(self): data = b'abcd' assert crc32c(data) == 0x92c80a31 def test_crc32c_python(self): data = b'abcd' assert _crc32c(data) == 0x92c80a31 def...
util/security/test/test_jwtutil.py
giuseppe/quay
2,027
12752921
<gh_stars>1000+ import time import pytest import jwt from cryptography.hazmat.primitives.asymmetric import rsa from cryptography.hazmat.primitives import serialization from authlib.jose import jwk from util.security.jwtutil import ( decode, exp_max_s_option, jwk_dict_to_public_key, InvalidTokenError,...
setup.py
sliderSun/scrapy-djangoitem
509
12752933
<gh_stars>100-1000 from setuptools import setup, find_packages setup( name='scrapy-djangoitem', version='1.1.1', url='https://github.com/scrapy-plugins/scrapy-djangoitem', description='Scrapy extension to write scraped items using Django models', long_description=open('README.rst').read(), aut...
game/sdl/nacl/generate_nmf.py
spiffcode/hostile-takeover
113
12752936
<filename>game/sdl/nacl/generate_nmf.py<gh_stars>100-1000 #!/usr/bin/python # # Copyright (c) 2011, The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys import optparse # This script generates a JSON .nmf file...
testing/scripts/test_benchmark.py
MichaelXcc/seldon-core
3,049
12752981
<reponame>MichaelXcc/seldon-core<filename>testing/scripts/test_benchmark.py import json import numpy as np import pytest import tensorflow as tf from google.protobuf import json_format from seldon_e2e_utils import post_comment_in_pr, run_benchmark_and_capture_results @pytest.mark.benchmark @pytest.mark.usefixtures(...
python/dlbs/result_processor.py
joehandzik/dlcookbook-dlbs
123
12752991
# (c) Copyright [2017] Hewlett Packard Enterprise Development LP # # 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...
yotta/version.py
microbit-foundation/yotta
176
12753014
<filename>yotta/version.py # Copyright 2014 ARM Limited # # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. # standard library modules, , , import argparse import logging import os # version, , represent versions and specifications, internal from yotta.lib import version # Component, , ...
test/programytest/utils/logging/test_snapshot.py
cdoebler1/AIML2
345
12753028
<reponame>cdoebler1/AIML2 import unittest from programy.utils.logging.ylogger import YLoggerSnapshot class YLoggerSnapshotTests(unittest.TestCase): def test_snapshot_with_defaults(self): snapshot = YLoggerSnapshot() self.assertIsNotNone(snapshot) self.assertEquals("Critical(0) Fatal(0) ...
src/version.py
copyit/picbed
115
12753039
__version__ = "1.13.3"
homeassistant/components/oem/__init__.py
domwillcode/home-assistant
30,023
12753057
"""The oem component."""
utils_cv/action_recognition/dataset.py
muminkoykiran/computervision-recipes
7,899
12753070
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import os import copy import math from pathlib import Path import warnings from typing import Callable, Tuple, Union, List import decord from einops.layers.torch import Rearrange import matplotlib.pyplot as plt import numpy ...
hwt/hdl/types/string.py
ufo2011/hwt
134
12753097
from hwt.doc_markers import internal from hwt.hdl.types.hdlType import HdlType class HString(HdlType): def all_mask(self): return 1 @internal @classmethod def getValueCls(cls): try: return cls._valCls except AttributeError: from hwt.hdl.types.stringVal...
contrib/packs/tests/test_action_aliases.py
muyouming/st2
4,920
12753098
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme 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 ...
docs/source/internals/includes/snippets/api.py
azadoks/aiida-core
180
12753110
#!/usr/bin/env python # -*- coding: utf-8 -*- from flask_restful import Resource from aiida.restapi.api import AiidaApi, App from aiida.restapi.run_api import run_api class NewResource(Resource): """ resource containing GET and POST methods. Description of each method follows: GET: returns id, ctime...
scrapcore/tools.py
lantip/SerpScrap
199
12753119
<reponame>lantip/SerpScrap<gh_stars>100-1000 # -*- coding: utf-8 -*- from collections import namedtuple import csv import json import os import threading from scrapcore import database class JsonStreamWriter(): """Writes consecutive objects to an json output file.""" def __init__(self, filename): se...
yasql/apps/sqlorders/apps.py
Fanduzi/YaSQL
443
12753123
<filename>yasql/apps/sqlorders/apps.py<gh_stars>100-1000 from django.apps import AppConfig class SqlordersConfig(AppConfig): name = 'sqlorders' verbose_name = 'SQL工单配置'
pkg/codegen/testing/test/testdata/output-funcs-edgeorder/python/pulumi_myedgeorder/_enums.py
goverdhan07/pulumi
12,004
12753129
<reponame>goverdhan07/pulumi # coding=utf-8 # *** WARNING: this file was generated by test. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** from enum import Enum __all__ = [ 'SupportedFilterTypes', ] class SupportedFilterTypes(str, Enum): """ Type of product filter. ...
EventFilter/CSCRawToDigi/python/cscPacker_cfi.py
Purva-Chaudhari/cmssw
852
12753157
import FWCore.ParameterSet.Config as cms ## baseline configuration in the class itself from EventFilter.CSCRawToDigi.cscPackerDef_cfi import cscPackerDef cscpacker = cscPackerDef.clone() ## In Run-2 common: update the format version for new OTMBs in ME1/1 ## Note: in the past, the packing with triggers and pretrigger...
server/www/packages/packages-windows/x86/ldap3/utils/config.py
tinygg/teleport
640
12753194
<filename>server/www/packages/packages-windows/x86/ldap3/utils/config.py<gh_stars>100-1000 """ """ # Created on 2016.08.31 # # Author: <NAME> # # Copyright 2013 - 2020 <NAME> # # This file is part of ldap3. # # ldap3 is free software: you can redistribute it and/or modify # it under the terms of the GNU Le...
google/ads/googleads/v8/resources/types/conversion_value_rule.py
JakobSteixner/google-ads-python
285
12753208
<filename>google/ads/googleads/v8/resources/types/conversion_value_rule.py # -*- coding: utf-8 -*- # 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 # # http://w...
lldb/packages/Python/lldbsuite/test/commands/expression/radar_9673664/TestExprHelpExamples.py
dan-zheng/llvm-project
765
12753219
""" Test example snippets from the lldb 'help expression' output. """ from __future__ import print_function import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class Radar9673644TestCase(TestBase): mydir = TestBase.compute_mydir(__file_...
site/flask/lib/python2.7/site-packages/whoosh/multiproc.py
theholyhades1/tartanHacks2015
319
12753230
# Copyright 2011 <NAME>. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the foll...
tests/integration/services/policy_engine/test_loaders.py
rbrady/anchore-engine
1,484
12753258
<gh_stars>1000+ import json import time import pytest from anchore_engine.configuration import localconfig from anchore_engine.db import ( FeedGroupMetadata, FeedMetadata, GemMetadata, Image, NpmMetadata, NvdMetadata, Vulnerability, session_scope, ) from anchore_engine.services.policy_...
tests/test_handler_metric_logger.py
KohYoungResearchAmerica/MONAI
2,971
12753272
<reponame>KohYoungResearchAmerica/MONAI # Copyright 2020 - 2021 MONAI Consortium # 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 requir...
AWS Management Scripts/AWS Automation Script for AWS endorsement management/ec2.py
avinashkranjan/PraticalPythonProjects
930
12753276
<reponame>avinashkranjan/PraticalPythonProjects from datetime import datetime, timedelta, timezone import boto3 def get_delete_data(older_days): delete_time = datetime.now(tz=timezone.utc) - timedelta(days=older_days) return delete_time def is_ignore_shutdown(tags): for tag in tags: print("K " ...
tests/integration_tests/db_engine_specs/presto_tests.py
delorenzosoftware/superset
18,621
12753314
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python3/790.py
rakhi2001/ecom7
854
12753324
<gh_stars>100-1000 __________________________________________________________________________________________________ sample 28 ms submission class Solution: def numTilings(self, N: int) -> int: #dp[N]=dp[N-1]+dp[N-2] + 2*(dp[N-3]+dp[N-4]+...dp[1]+dp[0]) ...eq(1) #dp[N-1] =dp[N-2]+dp[N-3] + 2*(dp[N-...
engines/ep/scripts/evictionVisualiser.py
BenHuddleston/kv_engine
104
12753336
<gh_stars>100-1000 #!/usr/bin/env python2.7 # # Copyright 2017-Present Couchbase, Inc. # # Use of this software is governed by the Business Source License included in # the file licenses/BSL-Couchbase.txt. As of the Change Date specified in that # file, in accordance with the Business Source License, use of this soft...
tools/vcrpy/tests/unit/test_vcr_import.py
rsdoherty/azure-sdk-for-python
2,728
12753376
<gh_stars>1000+ import sys def test_vcr_import_deprecation(recwarn): if "vcr" in sys.modules: # Remove imported module entry if already loaded in another test del sys.modules["vcr"] import vcr # noqa: F401 if sys.version_info[0] == 2: assert len(recwarn) == 1 assert iss...
homeassistant/components/temper/__init__.py
domwillcode/home-assistant
30,023
12753387
<filename>homeassistant/components/temper/__init__.py<gh_stars>1000+ """The temper component."""
theano_lstm/__init__.py
JonathanRaiman/theano_lstm
348
12753393
<filename>theano_lstm/__init__.py """ Small Theano LSTM recurrent network module. @author: <NAME> @date: December 10th 2014 Implements most of the great things that came out in 2014 concerning recurrent neural networks, and some good optimizers for these types of networks. Note (from 5 January 2015): Dropout api is ...
lib/django-1.5/django/contrib/gis/geos/__init__.py
MiCHiLU/google_appengine_sdk
790
12753400
""" The GeoDjango GEOS module. Please consult the GeoDjango documentation for more details: http://geodjango.org/docs/geos.html """ from django.contrib.gis.geos.geometry import GEOSGeometry, wkt_regex, hex_regex from django.contrib.gis.geos.point import Point from django.contrib.gis.geos.linestring import LineStrin...
pytorch_toolkit/face_recognition/model/blocks/shufflenet_v2_blocks.py
AnastasiaaSenina/openvino_training_extensions
158
12753427
<gh_stars>100-1000 """ Copyright (c) 2018 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
utils/export_utils.py
Mithilesh1609/assembled-cnn
363
12753430
# coding=utf8 # This code is adapted from the https://github.com/tensorflow/models/tree/master/official/r1/resnet. # ========================================================================================== # NAVER’s modifications are Copyright 2020 NAVER corp. All rights reserved. # ==================================...
apps/xcode.py
zachbarrow/talon_community
125
12753434
# Talon voice commands for Xcode # <NAME> <EMAIL> from talon.voice import Key, Context from ..misc.mouse import control_shift_click ctx = Context("xcode", bundle="com.apple.dt.Xcode") ctx.keymap( { "build it": Key("cmd-b"), "stop it": Key("cmd-."), "run it": Key("cmd-r"), "go bac...
tools/deep_memory_profiler/subcommands/cat.py
iplo/Chain
231
12753445
# Copyright 2013 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. import json import logging import sys from lib.bucket import BUCKET_ID, COMMITTED, ALLOC_COUNT, FREE_COUNT from lib.ordered_dict import OrderedDict from lib...
scripts/mi_tests/test_mutual_information.py
vishalbelsare/crosscat
207
12753448
<reponame>vishalbelsare/crosscat<gh_stars>100-1000 # # Copyright (c) 2010-2016, MIT Probabilistic Computing Project # # Lead Developers: <NAME> and <NAME> # Authors: <NAME>, <NAME>, <NAME>, <NAME> # Research Leads: <NAME>, <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may ...
xdl-algorithm-solution/ESMM/data/third_party/protobuf/protobuf-3.5.0/conformance/update_failure_list.py
hitflame/x-deeplearning
4,071
12753477
<gh_stars>1000+ # Copyright (C) 2016-2018 Alibaba Group Holding Limited # # 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 requir...
common_test.py
iostermann/deeplab2
587
12753491
<reponame>iostermann/deeplab2 # coding=utf-8 # Copyright 2021 The Deeplab2 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 # # Unle...
benchmarks/report.py
nammingi/haste
291
12753516
<gh_stars>100-1000 # Copyright 2020 LMNT, 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 ap...
boto3_type_annotations/boto3_type_annotations/elasticbeanstalk/client.py
cowboygneox/boto3_type_annotations
119
12753525
<reponame>cowboygneox/boto3_type_annotations 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): ...
src/exabgp/bgp/message/update/attribute/med.py
pierky/exabgp
1,560
12753528
<gh_stars>1000+ # encoding: utf-8 """ med.py Created by <NAME> on 2009-11-05. Copyright (c) 2009-2017 Exa Networks. All rights reserved. License: 3-clause BSD. (See the COPYRIGHT file) """ from struct import pack from struct import unpack from exabgp.bgp.message.update.attribute.attribute import Attribute # ======...
tests/test_managed_object.py
zhgcao/pyvmomi
1,894
12753537
<reponame>zhgcao/pyvmomi<filename>tests/test_managed_object.py # VMware vSphere Python SDK # Copyright (c) 2008-2015 VMware, 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 Lic...
yolo_tf2/core/evaluation.py
emadboctorx/yolov3-keras-tf2
650
12753544
<gh_stars>100-1000 import numpy as np import pandas as pd def get_true_positives(actual, detections, iou_threshold): """ Identify and flag true positive detections. Args: actual: Ground truth data as `pd.DataFrame` having `image`, `object_name`, `object_index`, `x0`, `y0`, `x1`, `y1` ...
tests/thread/stress_heap.py
learnforpractice/micropython-cpp
692
12753546
<filename>tests/thread/stress_heap.py # stress test for the heap by allocating lots of objects within threads # allocates about 5mb on the heap # # MIT license; Copyright (c) 2016 <NAME> on behalf of Pycom Ltd try: import utime as time except ImportError: import time import _thread def last(l): return l[-...
test/integration/component/test_ss_volume_usage.py
ycyun/ablestack-cloud
1,131
12753559
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
ocr/utils/sclite_helper.py
vee51/Hand
435
12753578
<gh_stars>100-1000 import os import subprocess import re import uuid class ScliteHelper(): ''' The Sclite helper class calculates the word error rate (WER) and charater error rate (CER) given a predicted and actual text. This class uses sclite2.4 (ftp://jaguar.ncsl.nist.gov/pub/sctk-2.4.10-20151007-131...
tests/ssr.py
xuhao1/taichi_three
152
12753584
<filename>tests/ssr.py import taichi as ti import tina ti.init(ti.gpu) scene = tina.Scene((640, 480), smoothing=True, ssr=True, taa=True) monkey_material = tina.PBR(metallic=0.0, roughness=0.4) monkey = tina.MeshModel('assets/monkey.obj') scene.add_object(monkey, monkey_material) param_metallic = tina.Param() param...
tests/unit/sagemaker/test_deserializers.py
LastRemote/sagemaker-python-sdk
1,690
12753646
<reponame>LastRemote/sagemaker-python-sdk<gh_stars>1000+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.am...
python/ht/pyfilter/utils.py
Hengle/Houdini-Toolbox
136
12753664
<gh_stars>100-1000 """This module contains functions related to Mantra Python filtering.""" # ============================================================================= # IMPORTS # ============================================================================= # Standard Library import logging import os from typing ...
sortedm2m_tests/compat.py
Freston2021/dfconfecciones
187
12753669
def m2m_set(instance, field_name, objs): getattr(instance, field_name).set(objs)
Codes/gracekoo/4_find_median_sorted_array.py
ghoslation/algorithm
256
12753689
<filename>Codes/gracekoo/4_find_median_sorted_array.py<gh_stars>100-1000 # -*- coding: utf-8 -*- # @Time: 2019/12/4 12:14 上午 # @Author: GraceKoo # @File: 4_find_median_sorted_array.py # @Desc: https://leetcode-cn.com/problems/median-of-two-sorted-arrays/ import timeit class Solution: def findMedianSortedArrays(se...
fonts/vector/symbol.py
szczys/st7789_mpy
153
12753697
<gh_stars>100-1000 WIDTH = 87 HEIGHT = 87 FIRST = 0x20 LAST = 0x7f _font =\ b'\x00\x4a\x5a\x02\x44\x60\x44\x52\x60\x52\x02\x44\x60\x44\x60'\ b'\x60\x44\x02\x52\x52\x52\x3e\x52\x66\x02\x44\x60\x44\x44\x60'\ b'\x60\x02\x44\x60\x44\x52\x60\x52\x02\x46\x5e\x46\x59\x5e\x4b'\ b'\x02\x4b\x59\x4b\x5e\x59\x46\x02\x52\x52\x52\x...
scripts/release18/colorchooser/colorchooser_savePreset.py
tdapper/cinema4d_py_sdk
113
12753704
<reponame>tdapper/cinema4d_py_sdk # This example loads the swatches of the given BaseDocument and stores them as a preset. # Note: The ColorSwatchData of the active document must contain some colors. import c4d from c4d.modules import colorchooser as cc def main(): # Creates a new ColorSwatchData swatchData =...
satchless/process/test_process.py
sahil2128/satchless
381
12753710
from unittest import TestCase from . import ProcessManager, Step, InvalidData class AddSwallows(Step): def __init__(self, data): self.data = data def __str__(self): return 'swallows-needed' def validate(self): if self.data.swallows < 2: raise InvalidData('Not enough...
tests/models/torchvision_models/retinanet/lightning/test_train.py
ai-fast-track/mantisshrimp
580
12753729
import pytest from icevision.all import * from icevision.models.torchvision import retinanet @pytest.fixture def light_model_cls(): class LightModel(retinanet.lightning.ModelAdapter): def configure_optimizers(self): return SGD(self.parameters(), lr=1e-4) return LightModel @pytest.mark.p...
tests/test_cwa.py
al3pht/cloud-custodian
2,415
12753732
<reponame>al3pht/cloud-custodian # Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 from .common import BaseTest class AlarmTest(BaseTest): def test_delete(self): alarm_name = "c7n-test-alarm-delete" factory = self.replay_flight_data("test_alarm_delete") client...
venv/Lib/site-packages/IPython/utils/shimmodule.py
ajayiagbebaku/NFL-Model
6,989
12753741
"""A shim module for deprecated imports """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import sys import types from importlib import import_module from .importstring import import_item class ShimWarning(Warning): """A warning to show when a module has mo...
datasets/data.py
gongda0e/AVT
102
12753744
<reponame>gongda0e/AVT<gh_stars>100-1000 # Copyright (c) Facebook, Inc. and its affiliates. import os import torch from importlib import import_module from tqdm import tqdm import omegaconf import hydra from common import utils __all__ = [ "get_dataset", ] def get_dataset(dataset_cfg, data_cfg, transform, log...
rl_coach/tests/exploration_policies/test_additive_noise.py
Lpallett4/coach
1,960
12753794
<gh_stars>1000+ import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) import pytest from rl_coach.spaces import DiscreteActionSpace, BoxActionSpace from rl_coach.exploration_policies.additive_noise import AdditiveNoise from rl_coach.schedules import LinearSchedule import nu...
test-framework/test-suites/integration/files/list/mock_switch_mac_test_x1052.py
kmcm0/stacki
123
12753813
from unittest.mock import patch, create_autospec, PropertyMock from stack.expectmore import ExpectMore from stack.switch.x1052 import SwitchDellX1052 # Switch data to mock MAC address table SWITCH_DATA = """ show mac address-table show mac address-table Flags: I - Internal usage VLAN Aging time is 300 sec Vla...
src/azure-cli/azure/cli/command_modules/eventhubs/_completers.py
YuanyuanNi/azure-cli
3,287
12753827
<filename>src/azure-cli/azure/cli/command_modules/eventhubs/_completers.py<gh_stars>1000+ # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for l...
setup.py
nadabyte/openmaptiles-tools
254
12753832
<reponame>nadabyte/openmaptiles-tools import setuptools import re from pathlib import Path path = Path('.') with (path / "README.md").open() as fh: long_description = fh.read() version_file = path / "openmaptiles" / "__init__.py" with version_file.open() as fh: m = re.search(r"^__version__\s*=\s*(['\"])([^'\...
src/saml2/ws/wsutil.py
cnelson/pysaml2
5,079
12753853
#!/usr/bin/env python # # Generated Sun Jun 14 12:18:10 2015 by parse_xsd.py version 0.5. # import saml2 from saml2 import SamlBase NAMESPACE = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd' class TTimestampFault_(SamlBase): """The http://docs.oasis-open.org/wss/2004/01/oas...
argoverse/utils/plane_visualization_utils.py
gargrohin/argoverse-api
560
12753868
# <Copyright 2019, Argo AI, LLC. Released under the MIT license.> from typing import List, Optional import numpy as np from argoverse.utils import mayavi_wrapper from argoverse.utils.mesh_grid import get_mesh_grid_as_point_cloud from argoverse.visualization.mayavi_utils import ( Figure, draw_mayavi_line_segm...
{{ cookiecutter.project_slug }}/tests/test_sample.py
gphillips8frw/cookiecutter-docker-science
308
12753877
import unittest class TestSample(unittest.TestCase): def setUp(self): pass def test_add(self): self.assertEqual((3 + 4), 7)
tools/coresctostandoff.py
pombredanne/brat
1,406
12753879
<gh_stars>1000+ #!/usr/bin/env python import re import sys try: import cElementTree as ET except BaseException: import xml.etree.cElementTree as ET # tags of elements to exclude from standoff output # (not used now; anything not explicitly converted is excluded) EXCLUDED_TAGS = [ # "SP", # "I...
nogotofail/mitm/util/tls/types/errors.py
kbfl0912/nogotofail
1,594
12753896
<reponame>kbfl0912/nogotofail<gh_stars>1000+ r''' Copyright 2015 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 Unl...
tests/esp32/uart2.py
rodgergr/pycom-micropython-sigfox-1
198
12753956
<gh_stars>100-1000 ''' P11 and P12 must be connected together for this test to pass. ''' from machine import UART from machine import Pin import os import time # do not execute this test on the GPy and FiPy if os.uname().sysname == 'GPy' or os.uname().sysname == 'FiPy': print("SKIP") import sys sys.exit()...
salt/utils/error.py
markgras/salt
9,425
12753960
<gh_stars>1000+ """ Utilities to enable exception reraising across the master commands """ import builtins import salt.exceptions import salt.utils.event def raise_error(name=None, args=None, message=""): """ Raise an exception with __name__ from name, args from args If args is None Otherwise message f...
sdk/batch/microsoft-azure-batch/tools/publish.py
ppartarr/azure-sdk-for-java
1,350
12753981
#!/usr/bin/python import sys import os import fnmatch import shutil import re def main(argv): # validation if len(argv) < 4: print "Usage: " + get_usage() exit(1) # figure out source dir folder = os.path.dirname(os.path.realpath(__file__)) if len(argv) == 5: folder = argv[4...
paco/thunk.py
lmicra/paco
208
12753997
# -*- coding: utf-8 -*- import asyncio from .assertions import assert_corofunction def thunk(coro): """ A thunk is a subroutine that is created, often automatically, to assist a call to another subroutine. Creates a thunk coroutine which returns coroutine function that accepts no arguments and wh...
dts/utils/__init__.py
albertogaspar/dts
139
12754004
<filename>dts/utils/__init__.py from dts.utils.utils import get_args from dts.utils.losses import r2, smape, nrmse_a, nrmse_b, nrmse_c, nrmsd from dts.utils.experiments import DTSExperiment, log_metrics, run_single_experiment, run_grid_search metrics = ['mse', 'mae', nrmse_a, nrmse_b, ...
mammoth/cli.py
cockcrow/python-mammoth
557
12754018
import argparse import io import os import shutil import sys import mammoth from . import writers def main(): args = _parse_args() if args.style_map is None: style_map = None else: with open(args.style_map) as style_map_fileobj: style_map = style_map_fileobj.read() ...
2018-evaluation-script/program/task1_eval.py
yolochai/scisumm-corpus
198
12754026
import os import sys import json, csv from bs4 import BeautifulSoup import xml.etree.ElementTree as ET from copy import copy def dictify(r,root=True): if root: return {r.tag : dictify(r, False)} d=copy(r.attrib) if r.text: d["_text"]=r.text for x in r.findall("./*"): if x.tag n...