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
deeppy/expr/graph/util.py
purushothamgowthu/deeppy
1,170
11176081
<reponame>purushothamgowthu/deeppy import os import tempfile import subprocess import numpy as np from ..base import Output from . import digraph from .exprgraph import ( ExprSplit, ExprGraph, build_graph, _require_list, node_exception_msg, traceback_str ) def draw(sinks, filepath, omit_splits=True, emph_node...
convlab2/dst/trade/multiwoz/__init__.py
Malavikka/ConvLab-2
339
11176118
from convlab2.dst.trade.multiwoz.trade import MultiWOZTRADE as TRADE
setup_metadata.py
timgates42/Py2C
149
11176121
#!/usr/bin/python3 """Read options from [metadata] section from setup.cfg """ from os.path import dirname, abspath, join from configparser import ConfigParser THIS_FILE = __file__ def get_metadata(): """Read the [metadata] section of setup.cfg and return it as a dict. """ parser = ConfigParser() par...
monkeylearn/classification.py
monkeylearn/monkeylearn-python
169
11176128
# -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals, division, absolute_import from six.moves import range from monkeylearn.base import ModelEndpointSet from monkeylearn.response import MonkeyLearnResponse from monkeylearn.settings import DEFAULT_BATCH_SIZE from monkeylearn.validation impo...
gobigger/hyper/tests/test_config.py
jayyoung0802/GoBigger
189
11176198
import logging import pytest from gobigger.hyper.configs.config_2f2s import server_default_config as c1 from gobigger.hyper.configs.config_2f2s_v2 import server_default_config as c2 from gobigger.hyper.configs.config_2f2s_v3 import server_default_config as c3 from gobigger.server import Server logging.basicConfig(lev...
terrascript/resource/innovationnorway/azure_preview.py
mjuenema/python-terrascript
507
11176234
# terrascript/resource/innovationnorway/azure_preview.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:12:49 UTC) import terrascript class azurepreview_budget(terrascript.Resource): pass class azurepreview_subscription(terrascript.Resource): pass __all__ = [ "azurepreview_budget", ...
napari/layers/utils/_text_constants.py
mkitti/napari
1,345
11176246
from enum import auto from ...utils.misc import StringEnum class TextMode(StringEnum): """ TextMode: Text setting mode. NONE (default mode) no text is displayed PROPERTY the text value is a property value FORMATTED allows text to be set with an f-string like syntax """ NONE = auto() ...
autoremovetorrents/conditionlexer.py
cnpilot/autoremove-torrents
437
11176249
<gh_stars>100-1000 import ply.lex as lex from . import logger from .exception.illegalcharacter import IllegalCharacter class ConditionLexer(object): reserved = { 'and': 'AND', 'or': 'OR' } tokens = [ 'CONDITION', 'NUMBER', 'LT', 'GT', 'LPAREN', 'RPAREN', ] + list...
conda-verify/run_test.py
nikicc/anaconda-recipes
130
11176250
from conda_verify import __version__ assert __version__ == '2.0.0'
observations/r/shrimp.py
hajime9652/observations
199
11176265
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import csv import numpy as np import os import sys from observations.util import maybe_download_and_extract def shrimp(path): """Percentage of Shrimp in Shrimp Cocktail A numeric...
intake/gui/source/tests/test_source_select.py
tewf/intake
578
11176302
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc. and Intake contributors # All rights reserved. # # The full license is in the LICENSE file, distributed with this software. #------------------------------------------------------------------------...
pycon/sponsorship/migrations/0020_auto_20180821_1031.py
azkarmoulana/pycon
154
11176316
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sponsorship', '0019_auto_20180723_1655'), ] operations = [ migrations.AddField( model_name='sponsor', ...
pytorch_toolkit/action_recognition/tests/test_attention.py
morkovka1337/openvino_training_extensions
256
11176321
<reponame>morkovka1337/openvino_training_extensions<gh_stars>100-1000 import torch import numpy as np from action_recognition.models.modules.self_attention import ScaledDotProductAttention, MultiHeadAttention class TestScaledDotProductAttention: def test_shapes(self): layer = ScaledDotProductAttention(16...
tests/r/test_med_gpa.py
hajime9652/observations
199
11176333
<reponame>hajime9652/observations from __future__ import absolute_import from __future__ import division from __future__ import print_function import shutil import sys import tempfile from observations.r.med_gpa import med_gpa def test_med_gpa(): """Test module med_gpa.py by downloading med_gpa.csv and testing...
tests/functional/coercers/test_coercer_non_null_boolean_with_default_field.py
matt-koevort/tartiflette
530
11176445
import pytest from tests.functional.coercers.common import resolve_unwrapped_field @pytest.mark.asyncio @pytest.mark.ttftt_engine( name="coercion", resolvers={ "Query.nonNullBooleanWithDefaultField": resolve_unwrapped_field }, ) @pytest.mark.parametrize( "query,variables,expected", [ ...
tests/test_octodns_provider_digitalocean.py
nikolay-te/octodns
1,865
11176452
<reponame>nikolay-te/octodns # # # from __future__ import absolute_import, division, print_function, \ unicode_literals from unittest import TestCase class TestDigitalOceanShim(TestCase): def test_missing(self): with self.assertRaises(ModuleNotFoundError): from octodns.provider.digitalo...
plugin/flags_sources/flags_source.py
jeeb/EasyClangComplete
648
11176473
<reponame>jeeb/EasyClangComplete<filename>plugin/flags_sources/flags_source.py<gh_stars>100-1000 """Holds an abstract class defining a flags source.""" from os import path from ..utils.search_scope import TreeSearchScope class FlagsSource(object): """An abstract class defining a Flags Source.""" def __init_...
desktop_local_tests/macos/test_macos_public_ip_disrupt_reorder_services.py
UAEKondaya1/expressvpn_leak_testing
219
11176490
from desktop_local_tests.public_ip_during_disruption import PublicIPDuringDisruptionTestCase from desktop_local_tests.macos.macos_reorder_services_disrupter import MacOSDNSReorderServicesDisrupter class TestMacOSPublicIPDisruptReorderServices(PublicIPDuringDisruptionTestCase): '''Summary: Tests whether traff...
scripts/run_ppanggolin.py
AMARTELKE/Pangenome-with-Panaroo
116
11176530
<reponame>AMARTELKE/Pangenome-with-Panaroo<gh_stars>100-1000 import argparse import subprocess import sys, os import gffutils as gff def run_ppanggolin(input_files, out_dir, defrag=False, ncpus=1, verbose=False): # create input file input_gff_locations = out_dir + "gff_file_locations.tab" with open(input_...
setup.py
Kadantte/twist.moe
112
11176544
# To replace python with python3 with open("api.sh") as f: newText = f.read().replace('python', 'python3') newText = newText.replace('python33', 'python3') with open("api.sh", "w") as f: f.write(newText)
example/indexing/indexing.py
saloponov/faiss-server
106
11176555
<gh_stars>100-1000 import os import zipfile from urllib.request import urlretrieve import faiss from gensim.models import KeyedVectors, word2vec from tqdm import tqdm SRC_PATH = os.path.dirname(os.path.abspath(__file__)) DATASET_FILE_PATH = os.path.join(SRC_PATH, 'text8') DATASET_ZIP_PATH = os.path.join(SRC_PATH, '{}...
examples/python/statespace_news.py
CCHiggins/statsmodels
6,931
11176560
<reponame>CCHiggins/statsmodels<gh_stars>1000+ #!/usr/bin/env python # coding: utf-8 # DO NOT EDIT # Autogenerated from the notebook statespace_news.ipynb. # Edit the notebook and then sync the output with this file. # # flake8: noqa # DO NOT EDIT # ## Forecasting, updating datasets, and the "news" # # In this notebo...
data/task_scripts/main/task00018.py
k101w/phyre_ODE
432
11176638
<filename>data/task_scripts/main/task00018.py # Copyright (c) Facebook, Inc. and its affiliates. # # 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...
tests/integration/cattletest/core/test_machine_driver.py
lifecontrol/cattle
482
11176683
<reponame>lifecontrol/cattle from common_fixtures import * # NOQA def test_machine_driver_name(admin_user_client): n = random_str().replace('-', 'F') url = 'http://foo/bar/docker-machine-driver-{}-v1.0-tar.gz'.format(n) md = admin_user_client.create_machine_driver(url=url) assert md.name == n
challenges/TAINTEDLOVE/poller/for-release/machine.py
pingjuiliao/cb-multios
473
11176703
#!/usr/bin/env python # # Copyright (C) 2014 # <NAME> <<EMAIL>> # Narf Industries <<EMAIL>> # # 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 limit...
tools/sts-job-manager/constants/status.py
ruchirjain86/professional-services
2,116
11176719
<reponame>ruchirjain86/professional-services #!/usr/bin/env python3 # 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://www.apache.org/licenses/LICENSE...
leetcode/4.median-of-two-sorted-arrays.py
geemaple/algorithm
177
11176778
# # @lc app=leetcode id=4 lang=python # # [4] Median of Two Sorted Arrays # # https://leetcode.com/problems/median-of-two-sorted-arrays/description/ # # algorithms # Hard (28.77%) # Total Accepted: 644.1K # Total Submissions: 2.2M # Testcase Example: '[1,3]\n[2]' # # There are two sorted arrays nums1 and nums2 of s...
pulsar/cmds/__init__.py
PyCN/pulsar
1,410
11176827
"""Useful distutils commands for continuous integration and deployment These commands works in python 2 too """ from .test import Bench, Test from .linux_wheels import ManyLinux from .pypi_version import PyPi from .s3data import S3Data __all__ = [ 'Bench', 'Test', 'ManyLinux', 'PyPi', 'S3Data' ]
tests/file/test_handle.py
Ross1503/azure-storage-python
348
11176834
<gh_stars>100-1000 # coding: utf-8 # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------...
src/genie/libs/parser/iosxe/tests/ShowCtsRoleBasedCounters/cli/equal/golden_output1_expected.py
balmasea/genieparser
204
11176842
<filename>src/genie/libs/parser/iosxe/tests/ShowCtsRoleBasedCounters/cli/equal/golden_output1_expected.py expected_output = { "cts_rb_count": { 1: { "src_group": "*", "dst_group": "*", "sw_denied_count": 0, "hw_denied_count": 0, "sw_permit_count": ...
sentence-encoding/src/sentence_encoder.py
dumpmemory/serverless-transformers-on-aws-lambda
103
11176843
import warnings warnings.filterwarnings("ignore") from functools import lru_cache from sentence_transformers import SentenceTransformer from src import config, utils logger = utils.create_logger(project_name=config.PREDICTION_TYPE, level="INFO") class SentenceEncoder: def __init__(self): _ = self.get_...
vlogging/tests/basic.py
emrahyldrm/visual-logging
108
11176849
import unittest import sys if sys.path[0].endswith("dummies"): sys.path = sys.path[1:] import vlogging class BasicTestCase(unittest.TestCase): def test_nothing(self): s = str(vlogging.VisualRecord()) self.assertTrue("<hr/>" in s) def test_text_only(self): s = str(vlogging.Visua...
test/test_ig_interface.py
stungkit/TradingBot
218
11176850
<reponame>stungkit/TradingBot import pytest import toml from common.MockRequests import ( ig_request_account_details, ig_request_confirm_trade, ig_request_login, ig_request_market_info, ig_request_navigate_market, ig_request_open_positions, ig_request_prices, ig_request_search_market, ...
tests/repository/test_common.py
azadoks/aiida-core
180
11176854
<gh_stars>100-1000 # -*- coding: utf-8 -*- # pylint: disable=redefined-outer-name """Tests for the :mod:`aiida.repository.common` module.""" import pytest from aiida.repository import File, FileType @pytest.fixture def file_object() -> File: """Test fixture to create and return a ``File`` instance.""" name =...
test/terra/backends/test_compatibility.py
garrison/qiskit-aer
313
11176859
<filename>test/terra/backends/test_compatibility.py # This code is part of Qiskit. # # (C) Copyright IBM 2018, 2021. # # 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/li...
core/notification.py
0x20Man/Watcher3
320
11176873
<filename>core/notification.py import core import logging logging = logging.getLogger(__name__) def add(data, type_='success'): ''' Adds notification to core.NOTIFICATIONS data (dict): notification information type_ (str): style of notification, see javascript docs for available styles <optional - def...
benchexec/tools/cmaesfuzz.py
MartinSpiessl/benchexec
137
11176880
# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 <NAME> <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 import benchexec.tools.template class Tool(benchexec.tools.template.BaseTool2): """ ...
src/ralph/lib/transitions/__init__.py
DoNnMyTh/ralph
1,668
11176917
<gh_stars>1000+ # -*- coding: utf-8 -*- default_app_config = 'ralph.lib.transitions.apps.TransitionAppConfig'
CircleciScripts/prepare_xcframework_archives.py
hardikdevios/aws-sdk-ios
1,026
11176935
<gh_stars>1000+ import os import sys import shutil import re import logging from semver_util import validate_version from framework_list import xcframeworks from functions import run_command, setup_logging def create_archives(xcframework_path, archive_path, version): os.makedirs(archive_path, exist_ok=True) ...
tests/test_part_units.py
vkleen/skidl
700
11176961
# -*- coding: utf-8 -*- # The MIT License (MIT) - Copyright (c) 2016-2021 <NAME>. import pytest from skidl import Part from .setup_teardown import setup_function, teardown_function def test_part_unit_1(): vreg = Part("xess.lib", "1117") vreg.match_pin_regex = True vreg.make_unit("A", 1, 2) vreg.ma...
Vecihi/Backend/vecihi/ask/serializers.py
developertqw2017/migrationDjango
220
11176983
<gh_stars>100-1000 from rest_framework import serializers from rest_framework.serializers import HyperlinkedRelatedField from vecihi.users.serializers import UserSerializer from vecihi.users.models import User from .models import Question, Answer class QuestionSerializer(serializers.ModelSerializer): class Meta:...
desktop/core/ext-py/nose-1.3.7/functional_tests/test_issue_649.py
kokosing/hue
5,079
11177001
# -*- coding: utf-8 -*- import os import sys import unittest from nose.plugins.capture import Capture from nose.plugins import PluginTester support = os.path.join(os.path.dirname(__file__), 'support') class TestIssue649(PluginTester, unittest.TestCase): activate = '' args = ['-v'] plugins = [Capture()] ...
qf_lib/backtesting/events/time_flow_controller.py
webclinic017/qf-lib
198
11177007
<gh_stars>100-1000 # Copyright 2016-present CERN – European Organization for Nuclear Research # # 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...
data_management/databases/classification/convert_json_detections_to_pickle.py
dnarqq/WildHack
402
11177009
<reponame>dnarqq/WildHack<gh_stars>100-1000 # This file converts the JSON output of the batch processing API to a pickle file, which can be used by the # script ./make_classification_dataset.py import argparse import os import json import pickle import pandas import numpy as np import tqdm parser = argparse.Argume...
staintools/preprocessing/read_image.py
BostonMeditechGroup/StainTools
197
11177020
import cv2 as cv import os def read_image(path): """ Read an image to RGB uint8. Read with opencv (cv) and covert from BGR colorspace to RGB. :param path: The path to the image. :return: RGB uint8 image. """ assert os.path.isfile(path), "File not found" im = cv.imread(path) # Conve...
Lib/test/bugs/pr171.py
jeff5/jython-whinchat
577
11177056
# PR#171. pdb's "c" command fails. The underlying problem is that frame # objects didn't have a writeable f_trace attribute. import sys try: 1/0 except: frame = sys.exc_info()[2].tb_frame del frame.f_trace
Tests/test_strptime_stdlib.py
aisk/ironpython3
1,872
11177063
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. ## ## Run selected tests from test_strptime from StdLib ## import unittest import sys from iptest import run_t...
discord/auth/helpers/__init__.py
telugu-boy/discord.py-self
175
11177070
from .captcha import * from .email import *
tests/warp_drive/test_env_reset.py
salesforce/warp-drive
255
11177099
<reponame>salesforce/warp-drive # Copyright (c) 2021, salesforce.com, inc. # All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # For full license text, see the LICENSE file in the repo root # or https://opensource.org/licenses/BSD-3-Clause import unittest import numpy as np import torch from warp_drive.ma...
tests/nnapi/specs/Ex/batch_matmul_ex_dynamic_nnfw.mod.py
periannath/ONE
255
11177109
import dynamic_tensor model = Model() input1_shape = [2, 2, 3] dynamic_layer = dynamic_tensor.DynamicInputGenerator(model, input1_shape, "TENSOR_FLOAT32") input1 = dynamic_layer.getTestNodeInput() input2 = Input("op2", "TENSOR_FLOAT32", "{3, 4}") adj_x = False adj_y = False model_output = Output("output", "TENSOR_FL...
src/lib/modulefinder.py
DTenore/skulpt
2,671
11177123
import _sk_fail; _sk_fail._("modulefinder")
tests/python/twitter/common/lang/test_lockable.py
zhouyijiaren/commons
1,143
11177132
<filename>tests/python/twitter/common/lang/test_lockable.py # ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache...
pystock_crawler/exporters.py
breakhearts/pystock-crawler
320
11177138
<filename>pystock_crawler/exporters.py from scrapy.conf import settings from scrapy.contrib.exporter import BaseItemExporter, CsvItemExporter class CsvItemExporter2(CsvItemExporter): ''' The standard CsvItemExporter class does not pass the kwargs through to the CSV writer, resulting in EXPORT_FIELDS and E...
tests/test_who.py
listuser/jc
3,215
11177140
<filename>tests/test_who.py import os import sys import time import json import unittest import jc.parsers.who THIS_DIR = os.path.dirname(os.path.abspath(__file__)) # Set the timezone on POSIX systems. Need to manually set for Windows tests if not sys.platform.startswith('win32'): os.environ['TZ'] = 'America/Los_...
babi_runner.py
parakrama1995/mem
645
11177146
import glob import os import random import sys import argparse import numpy as np from config import BabiConfig, BabiConfigJoint from train_test import train, train_linear_start, test from util import parse_babi_task, build_model seed_val = 42 random.seed(seed_val) np.random.seed(seed_val) # for reproducing def r...
recipes/Python/577252_lreplace_rreplace_Replace_beginning_ends/recipe-577252.py
tdiprima/code
2,023
11177155
<gh_stars>1000+ import re def lreplace(pattern, sub, string): """ Replaces 'pattern' in 'string' with 'sub' if 'pattern' starts 'string'. """ return re.sub('^%s' % pattern, sub, string) def rreplace(pattern, sub, string): """ Replaces 'pattern' in 'string' with 'sub' if 'pattern' ends 'string'...
src/python/nimbusml/tests/test_data_stream.py
michaelgsharp/NimbusML
134
11177162
<gh_stars>100-1000 # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -------------------------------------------------------------------------------------------- import os import ...
chapter-04/recipe-09/example/test/benchmark-a.py
istupsm/cmake-cookbook
1,600
11177188
import sys import time # wait for 0.5 seconds time.sleep(0.5) # finally report success sys.exit(0)
flask__webservers/show_lunch_menu_from_email/config.py
DazEB2/SimplePyScripts
117
11177199
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' # Например: <<EMAIL> username = "<username>" password = "<password>" # Например: smtp.mail.ru smtp_server = "<smtp_server>" # email отправителя писем с прикрепленными файлами обеденных меню в docx lunch_email = "<lunch_email>" header_date_form...
musicautobot/multitask_transformer/transform.py
HalleyYoung/musicautobot
402
11177207
from ..music_transformer.transform import * class MultitrackItem(): def __init__(self, melody:MusicItem, chords:MusicItem, stream=None): self.melody,self.chords = melody, chords self.vocab = melody.vocab self._stream = stream @classmethod def from_file(cls, midi_file, vocab...
tests/python/twitter/checkstyle/test_common.py
zhouyijiaren/commons
1,143
11177208
<reponame>zhouyijiaren/commons<gh_stars>1000+ import ast import textwrap from twitter.checkstyle.common import ( CheckstylePlugin, Nit, OffByOneList, PythonFile ) import pytest def make_statement(statement): return '\n'.join(textwrap.dedent(statement).splitlines()[1:]) PYTHON_STATEMENT = make_st...
code_examples/miner.py
pavlovdog/bitcoin_in_a_nutshell
121
11177210
<filename>code_examples/miner.py import hashlib import struct import time import sys # ======= Header ======= ver = 2 prev_block = "000000000000000000e5fb3654e0ae9a2b7d7390e37ee0a7c818ca09fde435f0" mrkl_root = "6f3ef687979a1f4866cd8842dcbcebd2e47171e54d1cc76c540faecafe133c39" bits = 0x10004379 time_ = 0x58777e25 # Cal...
src/odb/test/unitTestsPython/TestITerm.py
erictaur/OpenROAD
525
11177213
import opendbpy as odb import helper import odbUnitTest class TestITerm(odbUnitTest.TestCase): def setUp(self): self.db, self.lib = helper.createSimpleDB() blockName = '1LevelBlock' self.block = odb.dbBlock_create(self.db.getChip(), blockName) self.and2 = self.lib.findMaster('and2')...
ote/ote/modules/compression/nncf_reid_config_transformer.py
dqawami/openvino_training_extensions
256
11177227
""" 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 Unless required by applicable law or agreed to i...
hardware/demo_i2c.py
708yamaguchi/MaixPy_scripts
485
11177232
from machine import I2C from fpioa_manager import fm # i2c = I2C(I2C.I2C0, freq=100000, scl=28, sda=29) # hardware i2c i2c = I2C(I2C.I2C3, freq=100000, scl=28, sda=29) # software i2c #i2c = I2C(I2C.I2C_SOFT, freq=100000, scl=28, sda=29, #gscl = fm.fpioa.GPIOHS1, gsda = fm.fpioa.GPIOHS2) # software i2c for th...
tempest/lib/services/image/v1/image_members_client.py
rishabh20111990/tempest
254
11177246
<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 writi...
tests/test_test_utils.py
decentral1se/purerpc
143
11177274
import os import sys import time import pytest import traceback import multiprocessing from purerpc.test_utils import run_tests_in_workers, _run_context_manager_generator_in_process def test_run_tests_in_workers_error(): def target_fn(): def inner_2(): def inner_1(): raise Val...
streamalert/shared/lookup_tables/errors.py
cninja1/streamalert
2,770
11177276
class LookupTablesError(RuntimeError): """Generic class for errors raised from LookupTables systems""" class LookupTablesInitializationError(LookupTablesError): """Any error raised when a specific table/driver is attempting to initialize""" class LookupTablesCommitError(LookupTablesError): """Any error...
office365/onedrive/analytics/item_activity.py
rikeshtailor/Office365-REST-Python-Client
544
11177277
<reponame>rikeshtailor/Office365-REST-Python-Client from office365.entity import Entity class ItemActivity(Entity): """ The itemActivity resource provides information about activities that took place on an item or within a container. Currently only available on SharePoint and OneDrive for Business. ""...
Src/StdLib/Lib/test/bad_coding3.py
cwensley/ironpython2
2,209
11177284
<gh_stars>1000+ # coding: string-escape \x70\x72\x69\x6e\x74\x20\x32\x2b\x32\x0a
tests/nnapi/specs/Ex/range_ex_float_1_all_constant_inputs.mod.py
periannath/ONE
255
11177310
<reponame>periannath/ONE # model model = Model() shape = Input("lhs", "TENSOR_INT32", "{2}") start = Parameter("start", "TENSOR_FLOAT32", "{}", [1]) limit = Parameter("limit", "TENSOR_FLOAT32", "{}", [5]) delta = Parameter("delta", "TENSOR_FLOAT32", "{}", [0.5]) range_out = Internal("range_out", "TENSOR_FLOAT32", "{8}"...
recnn/data/dataset_functions.py
XinruLiu/RecNN
495
11177313
<filename>recnn/data/dataset_functions.py from .pandas_backend import pd import numpy as np from typing import List, Dict, Callable """ What? +++++ RecNN is designed to work with your data flow. Set kwargs in the beginning of prepare_dataset function. Kwargs you set are immutable. args_mu...
OnePy/sys_module/base_cleaner.py
Chandlercjy/OnePyfx
321
11177338
import abc from collections import defaultdict, deque from functools import partial from itertools import count import arrow from OnePy.sys_module.components.market_maker import MarketMaker from OnePy.sys_module.metabase_env import OnePyEnvBase class CleanerBase(OnePyEnvBase): counter = count(1) def __init...
tests/ex03_company/models.py
RodrigoDeRosa/related
190
11177355
import related @related.mutable class Company(object): name = related.StringField() uuid = related.UUIDField() email = related.RegexField("[^@]+@[^@]+", required=False) is_active = related.BooleanField(required=False) url = related.URLField(required=False) meta = related.ChildField(dict, requi...
tests/config/test_config.py
kargaranamir/emerge
142
11177364
""" All unit tests that are related to configuration. """ # Authors: <NAME> <<EMAIL>> # License: MIT import unittest from emerge.config import Configuration from emerge.config import Analysis, YamlLoader import coloredlogs import logging LOGGER = logging.getLogger('TESTS') coloredlogs.install(level='INFO', logger=LO...
tests/client/base.py
Allerter/tekore
135
11177371
<filename>tests/client/base.py import pytest from unittest.mock import MagicMock from tekore import HTTPError from tekore.model import PlayerErrorReason from tekore import Spotify from ._resources import album_id @pytest.fixture def client(): return Spotify('token') class TestSpotifyBaseUnits: def test_re...
dnachisel/builtin_specifications/codon_optimization/BaseCodonOptimizationClass.py
simone-pignotti/DnaChisel
124
11177374
from ..CodonSpecification import CodonSpecification from python_codon_tables import get_codons_table import numpy as np from ...Location import Location from ...biotools import group_nearby_indices class BaseCodonOptimizationClass(CodonSpecification): best_possible_score = 0 # Don't forget to change in subclass...
examples/cloudml-sklearn-pipeline/trainer/metadata.py
ruchirjain86/professional-services
2,116
11177394
<gh_stars>1000+ # Copyright 2019 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 ap...
scripts/step3.py
awesome-archive/subreddit-analyzer
497
11177403
""" This script contains several functions that will create plots and generate insights from the 4 datasets (submissions, comments, tokens and entities). """ import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import wordcloud from pandas.plotting import register_matplotlib_con...
exercises/de/test_03_14_01.py
Jette16/spacy-course
2,085
11177415
def test(): assert ( "for doc in nlp.pipe(TEXTS)" in __solution__ ), "Iterierst du über die Docs, die per yield von nlp.pipe ausgegeben werden?" __msg__.good("Super!")
pysnmp/smi/mibs/SNMP-COMMUNITY-MIB.py
RKinsey/pysnmp
492
11177428
<reponame>RKinsey/pysnmp # # This file is part of pysnmp software. # # Copyright (c) 2005-2019, <NAME> <<EMAIL>> # License: http://snmplabs.com/pysnmp/license.html # # ASN.1 source http://mibs.snmplabs.com/asn1/SNMP-COMMUNITY-MIB.txt # Produced by pysmi-0.4.0 at Sat Feb 16 08:57:23 2019 # if 'mibBuilder' not in globals...
gcp_variant_transforms/libs/vcf_reserved_fields.py
tsa87/gcp-variant-transforms
113
11177432
<reponame>tsa87/gcp-variant-transforms<gh_stars>100-1000 # Copyright 2018 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/lice...
indy_node/test/upgrade/test_pool_upgrade_cancel.py
Rob-S/indy-node
627
11177573
<gh_stars>100-1000 from copy import deepcopy from indy_common.constants import CANCEL, \ ACTION, SCHEDULE, JUSTIFICATION from indy_node.test import waits from indy_node.test.upgrade.helper import checkNoUpgradeScheduled, sdk_send_upgrade from stp_core.loop.eventually import eventually whitelist = ['Failed to upgr...
tests/import/same-level.test/mod2.py
nanolikeyou/pysonar2
2,574
11177578
class B: a = 'hi' def foo(x): return x + 1
RunAll/makeRootWithAllLinks.py
san0808/websitesVulnerableToSSTI
288
11177591
import os.path fname = "../README.md" if os.path.isfile(fname): markup_file = open(fname,"r") else: markup_file = open("./README.md","r") lines = markup_file.readlines() markup_file.close() html='''<!DOCTYPE html><html><head><style>table { font-family: arial, sans-serif; border-collapse: collapse; } ...
notebooks/thunderdome/eth2spec/test/phase0/epoch_processing/test_process_slashings_reset.py
casparschwa/beaconrunner
2,161
11177604
<reponame>casparschwa/beaconrunner<filename>notebooks/thunderdome/eth2spec/test/phase0/epoch_processing/test_process_slashings_reset.py from eth2spec.test.context import spec_state_test, with_all_phases from eth2spec.test.helpers.epoch_processing import ( run_epoch_processing_with ) def run_process_slashings_rese...
examples/dbm_example.py
Ressmann/starthinker
138
11177608
########################################################################### # # Copyright 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 # # https://www.apache.org/l...
kubernetes-py-guestbook/simple/__main__.py
jandom/examples
1,628
11177616
# Copyright 2016-2020, Pulumi 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 ag...
tiler/tiler-scripts/bng2wgs84.py
Geovation/tiler
134
11177643
<filename>tiler/tiler-scripts/bng2wgs84.py import subprocess import sys import os from tiler_helpers import absolute_file_paths def bng2wgs84(file_path, out_path): """Convert a shapefiles coordinate reference system from British National Grid to WGS84""" gsb = "/tiler-scripts/bin/OSTN02_NTv2.gsb" if not o...
Lib/objc/_UserManagement.py
snazari/Pyto
701
11177656
<reponame>snazari/Pyto<filename>Lib/objc/_UserManagement.py """ Classes from the 'UserManagement' framework. """ try: from rubicon.objc import ObjCClass except ValueError: def ObjCClass(name): return None def _Class(name): try: return ObjCClass(name) except NameError: return ...
models/dvsa/dvsa.py
MichiganCOG/ViP
210
11177694
#Code heavily adapted from: https://github.com/MichiganCOG/Video-Grounding-from-Text/blob/master/model/dvsa.py import torch import torch.nn as nn import torch.nn.functional as F import math import numpy as np from functools import partial import os from models.dvsa.dvsa_utils.transformer import Transformer class DVS...
cloudify_types/cloudify_types/component/operations.py
cloudify-cosmo/cloudify-manager
124
11177703
<reponame>cloudify-cosmo/cloudify-manager<gh_stars>100-1000 # Copyright (c) 2017-2019 Cloudify Platform Ltd. 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 # # htt...
src/genie/libs/parser/iosxe/tests/ShowFlowMonitor/cli/equal/golden_output2_expected.py
balmasea/genieparser
204
11177720
expected_output = { "cache_type": "Normal (Platform cache)", "cache_size": 16, "current_entries": 1, "flows_added": 1, "flows_aged": 0, }
mmhuman3d/core/visualization/renderer/torch3d_renderer/pointcloud_renderer.py
ykk648/mmhuman3d
472
11177766
<reponame>ykk648/mmhuman3d import warnings from typing import Iterable, List, Optional, Tuple, Union import torch import torch.nn as nn from pytorch3d.renderer import ( AlphaCompositor, PointsRasterizationSettings, PointsRasterizer, ) from pytorch3d.structures import Meshes, Pointclouds from mmhuman3d.cor...
e0/h.py
daedalus/knob
151
11177780
<filename>e0/h.py #!/usr/bin/python2 # -*- coding: utf-8 -*- """ h.py Ar and Ar_prime uses SAFER+ We use https://github.com/aer0s/python-mcrypt that is ONLY compatible with python2 and it uses a str based API. SAFER+ is an enhanced version of an existing 64-bit block cipher SAFER-SK128 bitstring.BitArray API: ...
src/stringTesting.py
MarletteFunding/aws-kube-codesuite
184
11177785
import yaml, boto3, botocore, json, zipfile from os import path from kubernetes import client, config from string import Template s3 = boto3.resource('s3') code_pipeline = boto3.client('codepipeline') ssm = boto3.client('ssm') def main(): # Build config file from template and secrets in SSM CA = "THIS IS A C...
Pixel_Chase_Game/code.py
gamblor21/Adafruit_Learning_System_Guides
665
11177788
import time import random import board from rainbowio import colorwheel import neopixel import digitalio import adafruit_led_animation.color as color # button pin setup button = digitalio.DigitalInOut(board.D5) button.direction = digitalio.Direction.INPUT button.pull = digitalio.Pull.UP # neopixel setup pixel_pin =...
seahub/api2/endpoints/shareable_groups.py
weimens/seahub
101
11177819
# Copyright (c) 2011-2016 Seafile Ltd. import os import sys from rest_framework.authentication import SessionAuthentication from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework.views import APIView from seaserv import ccnet_api from seahub.utils impo...
ptranking/ltr_adhoc/util/bin_utils.py
ryo59/ptranking
236
11177829
#!/usr/bin/env python # -*- coding: utf-8 -*- """Description """ import torch def batch_count(batch_std_labels=None, max_rele_grade=None, descending=False, gpu=False): """ Todo now an api is already provided by pytorch :param batch_std_labels: :param max_rele_grade: :param descending: :para...
reviewboard/scmtools/tests/test_tool_manager.py
seekingalpha/reviewboard
921
11177840
<gh_stars>100-1000 """Unit tests for reviewboard.scmtools.managers.ToolManager.""" from __future__ import unicode_literals from django.db.models import Q from reviewboard.scmtools.models import Tool from reviewboard.testing import TestCase class ToolManagerTests(TestCase): """Unit tests for reviewboard.scmtool...