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
deprecated/examples/simnet_bow/py_reader_generator.py
hutuxian/FleetX
170
12661457
#!/usr/bin/python # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
flocker/control/test/test_diffing.py
stackriot/flocker
2,690
12661458
<gh_stars>1000+ # Copyright ClusterHQ Inc. See LICENSE file for details. """ Tests for ``flocker.node._diffing``. """ from json import dumps from uuid import uuid4 from eliot.testing import capture_logging, assertHasMessage from hypothesis import given import hypothesis.strategies as st from pyrsistent import PClas...
torchsparse/nn/utils/kernel.py
collector-m/torchsparse
428
12661463
from typing import Tuple, Union import numpy as np import torch from torchsparse.utils import make_ntuple __all__ = ['get_kernel_offsets'] def get_kernel_offsets(size: Union[int, Tuple[int, ...]], stride: Union[int, Tuple[int, ...]] = 1, dilation: Union[int, Tuple[int,...
tensorflow_toolkit/action_detection/action_detection/nn/parameters/common.py
morkovka1337/openvino_training_extensions
256
12661509
<gh_stars>100-1000 # Copyright (C) 2019 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 ...
tools/perf/contrib/vr_benchmarks/vr_benchmarks.py
zipated/src
2,151
12661525
# 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. import logging from benchmarks import memory from core import perf_benchmark from measurements import smoothness from telemetry import benchmark from teleme...
packages/pyright-internal/src/tests/samples/final2.py
Microsoft/pyright
3,934
12661529
<filename>packages/pyright-internal/src/tests/samples/final2.py # This sample tests the handling of the @final method decorator. from typing import final class ClassA: def func1(self): pass @classmethod def func2(cls): pass @final def func3(self): pass @final @c...
Binary_Search/Python/jiang42/binary_search.py
Mynogs/Algorithm-Implementations
1,184
12661540
def binary_search(arr, target): low, high = 0, len(arr)-1 while low < high: mid = (low + high)/2 if arr[mid] == target: return mid elif arr[mid] > target: high = mid - 1 else: low = mid + 1 try: if arr[high] == target: return high else: return -1 except Ind...
settings.py
123456pop00/Traffic_sign_Test
533
12661545
''' Global settings ''' import tensorflow as tf # Default boxes # DEFAULT_BOXES = ((x1_offset, y1_offset, x2_offset, y2_offset), (...), ...) # Offset is relative to upper-left-corner and lower-right-corner of the feature map cell DEFAULT_BOXES = ((-0.5, -0.5, 0.5, 0.5), (0.2, 0.2, -0.2, -0.2), (-0.8, -0.2, 0.8, 0.2),...
pyqubo/integer/log_encoded_integer.py
dmiracle/pyqubo
124
12661589
# Copyright 2018 Recruit Communications Co., Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
dataprep/eda/staged.py
Waterpine/dataprep-1
1,229
12661688
<filename>dataprep/eda/staged.py<gh_stars>1000+ """Decorator to make it cope with two staged computation easily.""" from typing import Any, Callable, Generator, Tuple, Union, cast import dask from .intermediate import Intermediate Decoratee = Callable[..., Generator[Any, Any, Intermediate]] Completion = Callable[[...
dojo/components/urls.py
mtcolman/django-DefectDojo
1,772
12661701
from django.conf.urls import url from dojo.components import views urlpatterns = [ url(r'^components$', views.components, name='components'), ]
lib/asn1/test/asn1_SUITE_data/XSeqOf.py
jjhoo/otp
8,238
12661707
XSeqOf DEFINITIONS ::= BEGIN -- F.2.10.1 -- Use a sequence-of type to model a collection of variables whose -- types are the same, -- whose number is large or unpredictable, and whose order is significant. -- EXAMPLE NamesOfMemberNations ::= SEQUENCE OF VisibleString -- in alphabetical order firstTwo NamesOfMem...
tests/integrate_test/robustness_test.py
baajur/cita
930
12661722
#! /usr/bin/env python3 # coding=utf-8 import os import subprocess import time import toml from jsonrpcclient.http_client import HTTPClient def block_number(host="127.0.0.1", port=1337): """ url: str port: int """ url = "http://" + host + ":" + str(port) try: response = HTTPClient(ur...
aries_cloudagent/protocols/coordinate_mediation/v1_0/handlers/mediation_request_handler.py
kuraakhilesh8230/aries-cloudagent-python
247
12661729
<filename>aries_cloudagent/protocols/coordinate_mediation/v1_0/handlers/mediation_request_handler.py """Handler for mediate-request message.""" from .....messaging.base_handler import BaseHandler, HandlerException from .....messaging.request_context import RequestContext from .....messaging.responder import BaseRespon...
myia/operations/prim_extract_kwarg.py
strint/myia
222
12661741
"""Definitions for the primitive `extract_kwarg`.""" from ..lib import Inferrer, standard_prim from . import primitives as P @standard_prim(P.extract_kwarg) class _ExtractKwArgInferrer(Inferrer): """Infer the return type of primitive `extract_kwarg`.""" async def normalize_args(self, args): return a...
savevariables.py
dav009/nextitnet
112
12661768
# encoding:utf-8 import tensorflow as tf import os from tensorflow.python.framework import graph_util from tensorflow.python.platform import gfile def save_mode_pb(pb_file_path): x = tf.placeholder(tf.int32, name='x') y = tf.placeholder(tf.int32, name='y') b = tf.Variable(2, name='b') xy = tf.multiply...
tests/basic/class2.py
MoonStarCZW/py2rb
124
12661778
class Class1(object): def __init__(self): pass def test1(self): return 5 class Class2(object): def test1(self): return 6 class Class3(object): def test1(self, x): return self.test2(x)-1 def test2(self, x): return 2*x a = Class1() print(a.test1()) a = ...
python/ctranslate2/specs/__init__.py
funboarder13920/CTranslate2
259
12661779
from ctranslate2.specs.model_spec import LayerSpec from ctranslate2.specs.model_spec import ModelSpec from ctranslate2.specs.transformer_spec import TransformerSpec
mayan/apps/dynamic_search/__init__.py
eshbeata/open-paperless
2,743
12661812
from __future__ import unicode_literals default_app_config = 'dynamic_search.apps.DynamicSearchApp'
nodes/1.x/python/InternalUnit.ToDisplayUnit.py
jdehotin/Clockworkfordynamo
147
12661863
<reponame>jdehotin/Clockworkfordynamo<filename>nodes/1.x/python/InternalUnit.ToDisplayUnit.py import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * vals = IN[0] dispunit = IN[1] elementlist = [] for val in vals: elementlist.append(UnitUtils.ConvertFromInternalUnits(val,dispunit)) OUT = elementlist
integration_tests/projects/005_functions_and_variables/fal_scripts/write_to_source_twice.py
emekdahl/fal
360
12661902
<gh_stars>100-1000 import pandas as pd from functools import reduce import os model_name = context.current_model.name output = "" df: pd.DataFrame = ref(model_name) df.columns = df.columns.str.lower() # Snowflake has uppercase columns output += f"my_float {df.my_float[0]}\n" write_to_source(df, "results", "some_s...
tests/test_basic_normal.py
ahartikainen/pystan
1,030
12661937
<filename>tests/test_basic_normal.py<gh_stars>1000+ import pytest import stan program_code = "parameters {real y;} model {y ~ normal(0,1);}" @pytest.fixture(scope="module") def normal_posterior(): return stan.build(program_code) def test_normal_stepsize(normal_posterior): fit = normal_posterior.sample(ste...
pysymoro/screw6.py
songhongxiang/symoro
109
12661949
# -*- coding: utf-8 -*- """ This module contains the Screw6 data structure. """ from sympy import zeros from sympy import ShapeError class Screw6(object): """ Data structure: Represent the data structure (base class) to hold a 6x6 matrix which in turn contains four 3x3 matrices. """ ...
src/python/twitter/common/python/marshaller.py
zhouyijiaren/commons
1,143
12661961
from __future__ import absolute_import from pex.marshaller import *
route/recent_app_submit.py
k0000k/openNAMU
126
12662010
<reponame>k0000k/openNAMU<gh_stars>100-1000 from .tool.func import * def recent_app_submit_2(conn): curs = conn.cursor() div = '' curs.execute(db_change('select data from other where name = "requires_approval"')) requires_approval = curs.fetchall() if requires_approval and requires_approval[0][0]...
awkward0/arrow.py
kgizdov/awkward-0.x
224
12662018
#!/usr/bin/env python # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-0.x/blob/master/LICENSE import codecs import json import numpy import awkward0.array.base import awkward0.array.chunked import awkward0.array.indexed import awkward0.array.jagged import awkward0.array.masked import awkward0.arra...
tests/pyboard.py
learnforpractice/micropython-cpp
692
12662023
<reponame>learnforpractice/micropython-cpp<filename>tests/pyboard.py ../tools/pyboard.py
scripts/reports/old_logs.py
shatadru99/archai
344
12662035
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import argparse from typing import Dict, Type import glob import os import pathlib from runstats import Statistics def main(): parser = argparse.ArgumentParser(description='NAS E2E Runs') parser.add_argument('--logdir', typ...
uxy/uxy_w.py
sustrik/uxy
735
12662053
<gh_stars>100-1000 # Copyright (c) 2019 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merg...
2012/plugins_python/htmlize_main.py
mikiec84/code-for-blog
1,199
12662064
<reponame>mikiec84/code-for-blog #------------------------------------------------------------------------------- # htmlize: htmlize_main.py # # Main user-facing program. Usage: pipe some input text to its stdin. # # <NAME> (<EMAIL>) # This code is in the public domain #-------------------------------------------------...
cpmpy/remainders.py
tias/hakank
279
12662071
""" Remainder problem in cpmpy. ''' 11. Is there a number which when divided by 3 gives a remainder of 1; when divided by 4, gives a remainder of 2; when divided by 5, gives a remainder of 3; and when divided by 6, gives a remainder of 4? (Kordemsky) ''' Model created by <NAME>, <EMAIL> See also my CPMpy page: http...
calvin/actorstore/systemactors/text/WordCount.py
gabrielcercel/calvin-base
334
12662072
<gh_stars>100-1000 # -*- coding: utf-8 -*- # Copyright (c) 2015 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 requ...
tests/pytests/unit/modules/file/test_file_basics.py
tomdoherty/salt
9,425
12662078
import logging import os import shutil import pytest import salt.config import salt.loader import salt.modules.cmdmod as cmdmod import salt.modules.config as configmod import salt.modules.file as filemod import salt.utils.data import salt.utils.files import salt.utils.platform import salt.utils.stringutils from tests....
scripts/test_GRSIMatch.py
Ni-Chen/replicability.optics
156
12662079
<gh_stars>100-1000 from slugify import slugify filepath = 'GRSI.dat' GRSI=[] with open(filepath) as fp: GRSI = fp.readlines() print(GRSI)
aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/__init__.py
PushyamiKaveti/kalibr
2,690
12662086
<filename>aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/__init__.py from IccCalibrator import * import IccUtil as util import IccPlots as plots import IccSensors as sens
tests/data/mfoo.py
snakers4/pyarmor
1,463
12662115
import multiprocessing as mp import pub_foo def hello(q): print('module name: %s' % __name__) q.put('hello') if __name__ == '__main__': try: ctx = mp.get_context('spawn') except Exception: ctx = mp q = ctx.Queue() p = ctx.Process(target=pub_foo.proxy_hello, args=(q,)) p....
tests/test_application.py
boroviksergey/web-app-from-scratch
120
12662120
<gh_stars>100-1000 from io import BytesIO from scratch.application import Application from scratch.headers import Headers from scratch.request import Request from scratch.response import Response app = Application() @app.route("/") def static_handler(request): return Response(content="static") @app.route("/pe...
omnizart/patch_cnn/__init__.py
nicolasanjoran/omnizart
1,145
12662121
"""Vocal pitch contour transcription PatchCNN ver. Transcribes monophonic pitch contour of vocal in the given polyphonic audio by using the PatchCNN approach. Re-implementation of the repository `VocalMelodyExtPatchCNN <https://github.com/leo-so/VocalMelodyExtPatchCNN>`_. Feature Storage Format ----------------------...
absl/testing/tests/absltest_env.py
em10100/abseil-py
1,969
12662131
<filename>absl/testing/tests/absltest_env.py """Helper library to get environment variables for absltest helper binaries.""" import os _INHERITED_ENV_KEYS = frozenset({ # This is needed to correctly use the Python interpreter determined by # bazel. 'PATH', # This is used by the random module on Windo...
utils/tracing/python/test_tracing.py
tom-kuchler/vhive
138
12662137
# MIT License # # Copyright (c) 2021 <NAME> and EASE lab # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify,...
am4/rom/tools/plm.py
yshestakov/cpu11
118
12662179
#!/usr/bin/python3 # # M4 processor PDP-11 instruction decoding PLM Analyzer # Copyright (c) 2020 <NAME> <<EMAIL>> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 # as published by the Free Software Foundation. # # This program is...
accelerator/examples/build_dsexample-chain.py
eBay/accelerator
143
12662199
from os.path import dirname, join from .printer import prt description = "Dataset: Create a chained dataset." # Files are stored in same directory as this python file, # see comment below. path = dirname(__file__) def main(urd): prt.source(__file__) prt() prt('Create a chain of datasets using csvimport.') imp =...
release/stubs.min/Autodesk/Revit/UI/__init___parts/DockablePane.py
htlcnn/ironpython-stubs
182
12662204
<filename>release/stubs.min/Autodesk/Revit/UI/__init___parts/DockablePane.py class DockablePane(object,IDisposable): """ A user interface pane that participates in Revit's docking window system. DockablePane(other: DockablePane) DockablePane(id: DockablePaneId) """ def Dispose(self): """ Dispose...
pywick/models/segmentation/testnets/mixnet/__init__.py
achaiah/pywick
408
12662205
""" Source: https://github.com/zsef123/MixNet-PyTorch """
alipay/aop/api/response/AlipaySocialAntforestPlantConsultResponse.py
antopen/alipay-sdk-python-all
213
12662267
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AlipaySocialAntforestPlantConsultResponse(AlipayResponse): def __init__(self): super(AlipaySocialAntforestPlantConsultResponse, self).__init__() self._current_energy ...
src/algo/export_tx.py
wengzilla/staketaxcsv
140
12662284
from algo.asset import Algo, Asset from algo.config_algo import localconfig from common.make_tx import ( make_borrow_tx, make_deposit_collateral_tx, make_excluded_tx, make_income_tx, make_liquidate_tx, make_lp_deposit_tx, make_lp_stake_tx, make_lp_unstake_tx, make_lp_wit...
supar/utils/common.py
zysite/biaffine-parser
102
12662289
<filename>supar/utils/common.py # -*- coding: utf-8 -*- import os PAD = '<pad>' UNK = '<unk>' BOS = '<bos>' EOS = '<eos>' MIN = -1e32 CACHE = os.path.expanduser('~/.cache/supar')
iot_hunter/util.py
byamao1/HaboMalHunter
727
12662314
# # Tencent is pleased to support the open source community by making IoTHunter available. # Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. # Licensed under the MIT License (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the ...
miner.py
Aareon/tinycoin
105
12662334
<filename>miner.py from base import * from node import GET_WORK, NEW_BLOCK from block import BlockHeader msg = str({"type": GET_WORK, "hops": 0}) resp = Queue(10) @gen.coroutine def response(message): if message is None: print None else: bh, b = ast.literal_eval(message) bh = BlockHeade...
src/dataloaders/audio.py
dumpmemory/state-spaces
513
12662358
<reponame>dumpmemory/state-spaces import torch import torchaudio import numpy as np import os from os import listdir from os.path import join def minmax_scale(tensor, range_min=0, range_max=1): """ Min-max scaling to [0, 1]. """ min_val = torch.amin(tensor, dim=(1, 2), keepdim=True) max_val = torc...
language/nqg/model/parser/inference/eval_model.py
urikz/language
1,199
12662361
<gh_stars>1000+ # coding=utf-8 # Copyright 2018 The Google AI Language Team 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 # # Unl...
StonePaperScissor - GUI/StonePaperScissors.py
avinashkranjan/PraticalPythonProjects
930
12662403
# -*- coding: utf-8 -*- import random from tkinter import * #variables and Dictionary # These are total events that could occur if/else can also be used but they are pain to implement schema = { "rock": {"rock": 1, "paper": 0, "scissors": 2}, "paper": {"rock": 2, "paper": 1, "scissors": 0}, "scissors": ...
cleo/io/io.py
Ivoz/cleo
859
12662407
from typing import Iterable from typing import Optional from typing import Union from .inputs.input import Input from .outputs.output import Output from .outputs.output import Type as OutputType from .outputs.output import Verbosity from .outputs.section_output import SectionOutput class IO: def __init__(self, i...
tests/components/zwave_js/test_humidifier.py
MrDelik/core
30,023
12662409
<gh_stars>1000+ """Test the Z-Wave JS humidifier platform.""" from zwave_js_server.const import CommandClass from zwave_js_server.const.command_class.humidity_control import HumidityControlMode from zwave_js_server.event import Event from homeassistant.components.humidifier import HumidifierDeviceClass from homeassist...
scripts/artifacts/cashApp.py
Krypterry/ALEAPP
187
12662459
<gh_stars>100-1000 import sqlite3 import textwrap from scripts.artifact_report import ArtifactHtmlReport from scripts.ilapfuncs import logfunc, tsv, timeline, is_platform_windows, open_sqlite_db_readonly def get_cashApp(files_found, report_folder, seeker, wrap_text): for file_found in files_found: file_fo...
src/rayoptics/parax/idealimager.py
ajeddeloh/ray-optics
106
12662478
<filename>src/rayoptics/parax/idealimager.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright © 2019 <NAME> """ module to setup an ideal imager .. Created on Thu May 16 19:57:47 2019 .. codeauthor: <NAME> """ import math from collections import namedtuple ideal_imager_keys = ['m', 's', 'sp', 'tt', 'f'] i...
tests/propagate_uncertainty_test.py
sethvargo/vaex
337
12662512
<reponame>sethvargo/vaex import vaex def test_propagate_uncertainty(): ds = vaex.from_scalars(x=1, y=2, e_x=2, e_y=4) ds['r'] = ds.x + ds.y ds.propagate_uncertainties([ds.r]) print(ds.r_uncertainty.expression) assert ds.r_uncertainty.expand().expression == 'sqrt(((e_x ** 2) + (e_y ** 2)))' def test_matrix(): ...
projects/Task017_CADA/scripts/prepare.py
joeranbosma/nnDetection
242
12662518
<reponame>joeranbosma/nnDetection import os import shutil from pathlib import Path import SimpleITK as sitk from nndet.io import save_json from nndet.utils.check import env_guard from nndet.utils.info import maybe_verbose_iterable def run_prep(source_data: Path, source_label: Path, target_data_dir, tar...
test_project/select2_nestedadmin/__init__.py
epoiate/django-autocomplete-light
1,368
12662590
default_app_config = 'select2_nestedadmin.apps.TestApp'
scripts/generateTestcase.py
DataFinnovation/Arelle
292
12662593
<reponame>DataFinnovation/Arelle<filename>scripts/generateTestcase.py #!/usr/bin/env python # # this script generates a testcase variations file for entry point checking # import os, fnmatch, xml.dom.minidom, datetime def main(): # the top directory where to generate the test case (and relative file names in the ...
leetcode.com/python/528_Random_Pick_with_Weight.py
vansh-tiwari/coding-interview-gym
713
12662596
<filename>leetcode.com/python/528_Random_Pick_with_Weight.py<gh_stars>100-1000 import bisect import random class Solution(object): def __init__(self, w): """ :type w: List[int] """ self.prefisSum = w for i in range(1, len(self.prefisSum)): self.prefisSum[i] = sel...
docs/conf.py
bvanhou/infrastructure-components
101
12662643
master_doc = 'index' project = u'Infrastructure-Components' copyright = '2019, <NAME>' htmlhelp_basename = 'Infrastructure-Components-Doc' language = 'en' gettext_compact = False html_theme = 'sphinx_rtd_theme' #html_logo = 'img/logo.svg' html_theme_options = { 'logo_only': True, 'display_version': False, }...
demo/fourier_poisson1D.py
spectralDNS/shenfun
138
12662654
<reponame>spectralDNS/shenfun r""" Solve Poisson equation on (-2\pi, 2\pi) with periodic bcs .. math:: \nabla^2 u = f, u(2\pi) = u(-2\pi) Use Fourier basis and find u in V such that:: (v, div(grad(u))) = (v, f) for all v in V V is the Fourier basis span{exp(1jkx)}_{k=-N/2}^{N/2-1} Use the method of man...
tests/test_providers_package.py
xkortex/ulid
303
12662678
<gh_stars>100-1000 """ test_providers_package ~~~~~~~~~~~~~~~~~~~~~~ Tests for the :mod:`~ulid.providers` package. """ from ulid import providers from ulid.providers import default, monotonic def test_package_has_dunder_all(): """ Assert that :pkg:`~ulid.providers` exposes the :attr:`~ulid.provid...
venv/Lib/site-packages/langdetect/tests/test_detector.py
GuilhermeJC13/storIA
1,269
12662702
<filename>venv/Lib/site-packages/langdetect/tests/test_detector.py import unittest import six from langdetect.detector_factory import DetectorFactory from langdetect.utils.lang_profile import LangProfile class DetectorTest(unittest.TestCase): TRAINING_EN = 'a a a b b c c d e' TRAINING_FR = 'a b b c c c d d ...
testing/MLDB-2161-utf8-in-script-apply.py
kstepanmpmg/mldb
665
12662727
<filename>testing/MLDB-2161-utf8-in-script-apply.py # coding=utf-8 # # MLDB-2161-utf8-in-script-apply.py # <NAME>, 2017-03-08 # This file is part of MLDB. Copyright 2017 mldb.ai inc. All rights reserved. # from mldb import mldb, MldbUnitTest, ResponseException class MLDB2161Utf8InScriptApply(MldbUnitTest): # noqa ...
a00_Bert/train_bert_toy_task.py
sunshinenum/text_classification
7,723
12662747
# coding=utf-8 """ train bert model """ import modeling import tensorflow as tf import numpy as np import argparse parser = argparse.ArgumentParser(description='Describe your program') parser.add_argument('-batch_size', '--batch_size', type=int,default=128) args = parser.parse_args() batch_size=args.batch_size print("...
tools/build_defs/fb_python_library.bzl
tjzhou23/profilo
1,466
12662816
def fb_python_library(name, **kwargs): native.python_library( name = name, **kwargs )
angrgdb/explore.py
janbbeck/angrgdb
170
12662828
<filename>angrgdb/explore.py<gh_stars>100-1000 from cmd import Cmd class GUICallbackBaseClass(): def update_ip(self, ip): pass class BinjaCallback(GUICallbackBaseClass): def __init__(self, bv): self.bv = bv def update_ip(self, ip): self.bv.file.navigate(self.bv.file.view, ip) ...
third_party/bi_att_flow/my/tensorflow/__init__.py
jmrf/active-qa
327
12662864
from third_party.bi_att_flow.my.tensorflow import *
tests/pykafka/utils/test_struct_helpers.py
Instamojo/pykafka
1,174
12662878
import unittest2 from pykafka.utils import struct_helpers class StructHelpersTests(unittest2.TestCase): def test_basic_unpack(self): output = struct_helpers.unpack_from( 'iiqhi', b'\x00\x00\x00\x01\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00\n\x00<\x00\x00\x00\x04' ) ...
src/richie/plugins/lti_consumer/urls.py
leduong/richie
174
12662913
<reponame>leduong/richie<filename>src/richie/plugins/lti_consumer/urls.py """LTI Consumer plugin URLs configuration.""" from django.urls import include, path from rest_framework.routers import DefaultRouter from . import models from .api import LTIConsumerViewsSet router = DefaultRouter() router.register( model...
credentials.py
ghzwireless/control
293
12662924
<filename>credentials.py #!/usr/bin/env python """credentials - the login credentials for all of the modules are stored here and imported into each module. Please be sure that you are using restricted accounts (preferably with read-only access) to your servers. """ __author__ = '<EMAIL> (<NAME>)' # VMware VMWARE_...
mac/pyobjc-framework-Quartz/PyObjCTest/test_qlpreviewpanel.py
albertz/music-player
132
12662937
from PyObjCTools.TestSupport import * import objc from Foundation import NSObject try: from Quartz import * except ImportError: pass class TestQLPreviewPanelHelper (NSObject): def acceptsPreviewPanelControl_(self, panel): return 1 def previewPanel_handleEvent_(self, panel, event): return 1 def pr...
data/TACoS/merge_npys_to_hdf5.py
frostinassiky/2D-TAN
249
12662989
<filename>data/TACoS/merge_npys_to_hdf5.py import glob import h5py import numpy as np import os import tqdm import json def convert_tall_c3d_features(sampling_rate): stride = sampling_rate//5 data_root = "./data/TACoS/" hdf5_file = h5py.File(os.path.join(data_root, 'tall_c3d_{}_features.hdf5'.format(sampli...
benchmarks/sparse/dlmc/utils.py
Hacky-DH/pytorch
60,067
12663004
import torch from pathlib import Path from scipy import sparse import math def to_coo_scipy(x): indices_1 = x._indices().numpy() values_1 = x._values().numpy() return sparse.coo_matrix((values_1, (indices_1[0], indices_1[1])), shape=x.shape) def sparse_grad_output(a, b): ...
archivebox/cli/archivebox_config.py
sarvex/ArchiveBox
6,340
12663029
<filename>archivebox/cli/archivebox_config.py #!/usr/bin/env python3 __package__ = 'archivebox.cli' __command__ = 'archivebox config' import sys import argparse from typing import Optional, List, IO from ..main import config from ..util import docstring from ..config import OUTPUT_DIR from ..logging_util import Sma...
test/shared/test_utils.py
AMHesch/aws-allowlister
180
12663033
import json import unittest from aws_allowlister.shared.utils import clean_service_name, get_service_name_matching_iam_service_prefix, \ clean_service_name_after_brackets_and_parentheses, chomp_keep_single_spaces, chomp class UtilsTestCase(unittest.TestCase): def test_get_service_name_matching_iam_service_pre...
src/gausskernel/dbmind/tools/sqldiag/main.py
Yanci0/openGauss-server
360
12663038
""" Copyright (c) 2020 Huawei Technologies Co.,Ltd. openGauss is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WI...
src/app/conf/healthchecks.py
denkasyanov/education-backend
151
12663051
HEALTH_CHECKS_ERROR_CODE = 503 HEALTH_CHECKS = { 'db': 'django_healthchecks.contrib.check_database', }
test.py
abhi-kumar/blitznet
331
12663057
#!/usr/bin/env python3 from glob import glob import logging import logging.config import os import tensorflow as tf import numpy as np from PIL import ImageFont from config import get_logging_config, args, evaluation_logfile from config import config as net_config from paths import CKPT_ROOT import matplotlib matpl...
bibliopixel/project/attributes.py
rec/leds
253
12663074
<reponame>rec/leds def check(kwds, name): if kwds: msg = ', '.join('"%s"' % s for s in sorted(kwds)) s = '' if len(kwds) == 1 else 's' raise ValueError('Unknown attribute%s for %s: %s' % (s, name, msg)) def set_reserved(value, section, name=None, data=None, **kwds): check(kwds, '%s %s'...
kitty/kitty-themes/.tools/preview.py
adicco/dotconfig
1,464
12663099
import sys import os import sys theme_keys = [ "cursor", "foreground", "background", "background_opacity", "dynamic_background_opacity", "dim_opacity", "selection_foreground", "selection_background", "color0", "color8", "color1", "color9", "color2", "color10", "color3", "color11", "color4", "color12", "col...
loudml/loudml/influx.py
jkbrandt/loudml
245
12663100
<gh_stars>100-1000 """ InfluxDB module for Loud ML """ import logging import influxdb.exceptions import numpy as np import requests.exceptions from voluptuous import ( Required, Optional, All, Length, Boolean, ) from influxdb import ( InfluxDBClient, ) from . import ( errors, schemas...
packages/python/plotly/plotly/matplotlylib/mplexporter/tests/__init__.py
mastermind88/plotly.py
11,750
12663108
<reponame>mastermind88/plotly.py import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt
anomalib/utils/metrics/anomaly_score_distribution.py
ashwinvaidya17/anomalib
689
12663137
<gh_stars>100-1000 """Module that computes the parameters of the normal data distribution of the training set.""" from typing import Optional, Tuple import torch from torch import Tensor from torchmetrics import Metric class AnomalyScoreDistribution(Metric): """Mean and standard deviation of the anomaly scores o...
src/netius/extra/dhcp_s.py
timgates42/netius
107
12663177
#!/usr/bin/python # -*- coding: utf-8 -*- # Hive Netius System # Copyright (c) 2008-2020 Hive Solutions Lda. # # This file is part of Hive Netius System. # # Hive Netius System is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by the Apache # Foun...
skyline/functions/settings/manage_external_settings.py
datastreaming/skyline-1
396
12663219
<filename>skyline/functions/settings/manage_external_settings.py """ external_settings_configs """ import logging import traceback import requests import simplejson as json from ast import literal_eval from skyline_functions import get_redis_conn_decoded import settings # @added 20210601 - Feature #4000: EXTERNAL_SET...
test/parse/t01.py
timmartin/skulpt
2,671
12663252
<reponame>timmartin/skulpt<gh_stars>1000+ print x+2*3
frontend/tests/unit/models/test_data_issue.py
defendercrypt/amundsen
2,072
12663279
# Copyright Contributors to the Amundsen project. # SPDX-License-Identifier: Apache-2.0 import unittest from amundsen_application.models.data_issue import DataIssue, Priority class DataIssueTest(unittest.TestCase): def setUp(self) -> None: self.issue_key = 'key' self.title = 'title' self...
tests/test_summarizers/test_random.py
isarth/sumy
2,880
12663285
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from sumy._compat import to_unicode from sumy.summarizers.random import RandomSummarizer from ..utils import build_document, build_document_from_string def test_empty_document(): document = build_document(...
office-plugin/windows-office/program/wizards/fax/FaxWizardDialog.py
jerrykcode/kkFileView
6,660
12663308
<gh_stars>1000+ # # This file is part of the LibreOffice project. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # This file incorporates work covered by the follow...
cartography/intel/aws/ec2/reserved_instances.py
ramonpetgrave64/cartography
2,322
12663359
<filename>cartography/intel/aws/ec2/reserved_instances.py<gh_stars>1000+ import logging from typing import Dict from typing import List import boto3 import neo4j from botocore.exceptions import ClientError from .util import get_botocore_config from cartography.util import aws_handle_regions from cartography.util impo...
tests/clpy_tests/random_tests/test_permutations.py
fixstars/clpy
142
12663391
<reponame>fixstars/clpy import unittest import clpy from clpy import testing @testing.gpu class TestPermutations(unittest.TestCase): _multiprocess_can_split_ = True @testing.gpu class TestShuffle(unittest.TestCase): _multiprocess_can_split_ = True # Test ranks @testing.numpy_clpy_raises() d...
src/textual/drivers/win32.py
eduard93/textual
2,177
12663408
<gh_stars>1000+ import ctypes import msvcrt import sys import threading from asyncio import AbstractEventLoop, run_coroutine_threadsafe from ctypes import Structure, Union, byref, wintypes from ctypes.wintypes import BOOL, CHAR, DWORD, HANDLE, SHORT, UINT, WCHAR, WORD from typing import IO, Callable, List, Optional fr...
alipay/aop/api/domain/AlipayInsAutoUserMsgSendModel.py
snowxmas/alipay-sdk-python-all
213
12663409
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.AutoMktTouchExtendInfoEntry import AutoMktTouchExtendInfoEntry from alipay.aop.api.domain.AutoMktTouchExtendInfoEntry import AutoMktTouchExtendInfoEntry class AlipayInsAutoUserMsg...
moldesign/_tests/test_io.py
Autodesk/molecular-design-toolkit
147
12663411
""" Tests for molecule creation and file i/o """ import io import os import subprocess from future.utils import PY2, native_str from builtins import str import collections import pathlib import gzip import bz2 import pickle import numpy import pytest import moldesign as mdt mdt.compute.config.engine_type = 'docker' ...
tests/test_subhd.py
appotry/subfinder
718
12663423
# -*- coding: utf -*- import pytest from subfinder.subsearcher import SubHDSubSearcher from subfinder.subfinder import SubFinder from subfinder.subsearcher.exceptions import LanguageError, ExtError @pytest.fixture(scope='module') def subhd(): s = SubFinder() z = SubHDSubSearcher(s) return z def test_lan...
pypasser/reCaptchaV2/__init__.py
renatowow14/PyPasser
108
12663438
from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.common.exceptions import NoSuchElementException from selenium.webdriver import Chrome impo...
python/pmercury/protocols/http_server.py
raj-apoorv/mercury
299
12663442
<filename>python/pmercury/protocols/http_server.py """ Copyright (c) 2019 Cisco Systems, Inc. All rights reserved. License at https://github.com/cisco/mercury/blob/master/LICENSE """ import os import sys sys.path.append(os.path.dirname(os.path.abspath(__file__))) sys.path.append(os.path.dirname(os.path.abspath(__fi...