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
samples/order/capture.py
Hey-Marvelous/PayPal-Python-SDK
653
12703758
from paypalrestsdk import Order import logging logging.basicConfig(level=logging.INFO) order = Order.find("<ORDER_ID>") capture = order.capture({ "amount": { "currency": "USD", "total": "4.54"}, "is_final_capture": True}) if capture.success(): print("Capture[%s] successfully" % (capture.id...
ote_cli/ote_cli/datasets/__init__.py
opencv/openvino_training_extensions
775
12703765
""" File system based datasets registry. """ # Copyright (C) 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 ...
tests/unit/firewalls/test_domain.py
DoctorJohn/hcloud-python
156
12703776
import datetime from dateutil.tz import tzoffset from hcloud.firewalls.domain import Firewall class TestFirewall(object): def test_created_is_datetime(self): firewall = Firewall(id=1, created="2016-01-30T23:50+00:00") assert firewall.created == datetime.datetime( 2016, 1, 30, 23, 50, ...
rest-service/manager_rest/rest/resources_v1/executions.py
cloudify-cosmo/cloudify-manager
124
12703808
######### # Copyright (c) 2017 GigaSpaces Technologies 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
examples/adc/01-closed_shell.py
QuESt-Calculator/pyscf
501
12703832
#!/usr/bin/env python ''' IP/EA-RADC calculations for closed-shell N2 ''' from pyscf import gto, scf, adc mol = gto.Mole() r = 1.098 mol.atom = [ ['N', ( 0., 0. , -r/2 )], ['N', ( 0., 0. , r/2)],] mol.basis = {'N':'aug-cc-pvdz'} mol.build() mf = scf.RHF(mol) mf.conv_tol = 1e-12 mf.kernel() myadc ...
etl/parsers/etw/Microsoft_Windows_AppxPackagingOM.py
IMULMUL/etl-parser
104
12703885
<gh_stars>100-1000 # -*- coding: utf-8 -*- """ Microsoft-Windows-AppxPackagingOM GUID : ba723d81-0d0c-4f1e-80c8-54740f508ddf """ from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct from etl.utils import WString, CString, SystemTime, Guid from etl.d...
src/test/expect_in_atomic_printf.py
jalapenopuzzle/rr
5,156
12703900
<reponame>jalapenopuzzle/rr<gh_stars>1000+ from util import * import re send_gdb('bt') expect_gdb('atomic_printf') ok()
nncf/experimental/tensorflow/graph/transformations/commands.py
GreenWaves-Technologies/nncf
136
12703902
<reponame>GreenWaves-Technologies/nncf<filename>nncf/experimental/tensorflow/graph/transformations/commands.py """ Copyright (c) 2022 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 Licens...
components/cronet/tools_unittest.py
google-ar/chromium
2,151
12703914
#!/usr/bin/python # Copyright 2016 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. """Run tools/ unittests.""" import sys import unittest if __name__ == '__main__': suite = unittest.TestLoader().discover('tools', patte...
ch08/08_15.py
leeseedong/book-cryptocurrency
121
12703943
<filename>ch08/08_15.py import pykorbit email = "<EMAIL>" password = "<PASSWORD>" key = "<KEY>" secret = "<KEY>" korbit = pykorbit.Korbit(email, password, key, secret) balance = korbit.get_balances() print(balance)
scripts/rectify.py
d-m-bailey/openlane-openroad
354
12703958
#!/usr/bin/env python3 # Copyright 2020 Efabless 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 applica...
visualize/grid_attention_visualization/__init__.py
rentainhe/visualization
169
12703961
from .visualize_attention_map import visualize_grid_attention from .visualize_attention_map_V2 import visualize_grid_attention_v2
veros/core/external/solvers/scipy.py
AkasDutta/veros
111
12703982
import numpy as onp import scipy.sparse import scipy.sparse.linalg as spalg from veros import logger, veros_kernel, veros_routine, distributed, runtime_state as rst from veros.variables import allocate from veros.core.operators import update, at, numpy as npx from veros.core.external.solvers.base import LinearSolver f...
test/normalizer_issue_files/E71.py
bryanforbes/parso
6,989
12704000
#: E711:7 if res == None: pass #: E711:7 if res != None: pass #: E711:8 if None == res: pass #: E711:8 if None != res: pass #: E711:10 if res[1] == None: pass #: E711:10 if res[1] != None: pass #: E711:8 if None != res[1]: pass #: E711:8 if None == res[1]: pass # #: E712:7 if res == Tru...
maya/Tests/AbcExport_subframes_test.py
ryu-sw/alembic
921
12704029
<filename>maya/Tests/AbcExport_subframes_test.py ##-***************************************************************************** ## ## Copyright (c) 2009-2013, ## <NAME>ictures Imageworks, Inc. and ## Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. ## ## All rights reserved. ## ## Redist...
pypy/module/zipimport/moduledef.py
nanjekyejoannah/pypy
333
12704052
<gh_stars>100-1000 """ Zipimport module """ from pypy.interpreter.mixedmodule import MixedModule class Module(MixedModule): interpleveldefs = { 'zipimporter':'interp_zipimport.W_ZipImporter', '_zip_directory_cache' : 'space.wrap(interp_zipimport.zip_cache)', 'ZipImportError': 'interp_zip...
plugins/modules/oci_os_management_event_report_facts.py
slmjy/oci-ansible-collection
108
12704063
#!/usr/bin/python # Copyright (c) 2020, 2021 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
tests/test_instantiation.py
theblackcat102/REL
210
12704065
<filename>tests/test_instantiation.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- from pathlib import Path import torch from REL.entity_disambiguation import EntityDisambiguation from REL.mention_detection import MentionDetection from REL.mulrel_ranker import MulRelRanker, PreRank from REL.ner import Cmns def t...
tests/adapters/test_r_adapter.py
pietervans/viewflow
106
12704070
<gh_stars>100-1000 import viewflow from unittest.mock import patch, ANY, call @patch("viewflow.parsers.dependencies_r_patterns.custom_get_dependencies") @patch("viewflow.parsers.dependencies_r_patterns.get_dependencies_default") def test_default_dependencies_pattern(get_default_mock, get_custom_mock): viewflow.c...
candlestick/patterns/candlestick_finder.py
michalk21/candlestick-patterns
212
12704077
<reponame>michalk21/candlestick-patterns<gh_stars>100-1000 import pandas as pd from pandas.api.types import is_numeric_dtype class CandlestickFinder(object): def __init__(self, name, required_count, target=None): self.name = name self.required_count = required_count self.close_column = 'cl...
samples/migrateADCGen1/mappers/sqlserver.py
daniel-dqsdatalabs/pyapacheatlas
104
12704100
<filename>samples/migrateADCGen1/mappers/sqlserver.py from .assetmapper import AssetMapper class SqlServerTableMapper(AssetMapper): def __init__(self, asset, terms, typeName="azure_sql_table", columnTypeName="azure_sql_column"): super().__init__(asset, terms, typeName, columnTypeName) _address = s...
dashlivesim/vodanalyzer/dashanalyzer.py
Dash-Industry-Forum/dash-live-source-simulator
133
12704101
<reponame>Dash-Industry-Forum/dash-live-source-simulator """Analyze DASH content in live profile and extract parameters for VoD-config file for live source simulator. """ # The copyright in this software is being made available under the BSD License, # included below. This software may be subject to other third party ...
test/losses_test.py
timgates42/theanets
314
12704105
<reponame>timgates42/theanets import pytest import theanets import util as u class TestBuild: def test_mse(self): l = theanets.Loss.build('mse', target=2) assert callable(l) assert len(l.variables) == 1 def test_mse_weighted(self): l = theanets.Loss.build('mse', target=2, wei...
src/genie/libs/parser/iosxe/tests/ShowBgpSummary/cli/equal/golden_output1_expected.py
balmasea/genieparser
204
12704113
expected_output = { "bgp_id": 5918, "vrf": { "default": { "neighbor": { "192.168.10.253": { "address_family": { "vpnv4 unicast": { "activity_paths": "23637710/17596802", "activ...
watchmen/pipeline/core/case/function/case_then_for_storage.py
Insurance-Metrics-Measure-Advisory/watchman-data-connector
125
12704124
from typing import List from watchmen_boot.config.config import settings from watchmen.pipeline.core.case.model.parameter import Parameter MYSQL = "mysql" MONGO = "mongo" ORACLE = "oracle" def find_case_then_template(): if settings.STORAGE_ENGINE == MONGO: from watchmen.pipeline.core.case.function impor...
tensorflow_model_analysis/export_only/__init__.py
yifanmai/model-analysis
1,118
12704134
<filename>tensorflow_model_analysis/export_only/__init__.py # Copyright 2018 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/licenses/LICENSE-2.0 # #...
dynaconf/vendor/box/box.py
sephiartlist/dynaconf
2,293
12704151
_Z='keys' _Y='box_settings' _X='default_box_attr' _W='Box is frozen' _V='modify_tuples_box' _U='box_safe_prefix' _T='default_box_none_transform' _S='__created' _R='box_dots' _Q='box_duplicates' _P='ignore' _O='.' _N='strict' _M='box_recast' _L='box_intact_types' _K='default_box' _J='_' _I='utf-8' _H='_box_config' _G=Tr...
smt/utils/__init__.py
jbussemaker/smt
354
12704158
from .misc import compute_rms_error
python/seldon/shell/zk_utils.py
smsahu/seldon-server
1,645
12704204
import json def is_json_data(data): if (data != None) and (len(data)>0): return data[0] == '{' or data[0] == '[' else: return False def json_compress(json_data): d = json.loads(json_data) return json.dumps(d, sort_keys=True, separators=(',',':')) def node_set(zk_client, node_path, nod...
src/models/__init__.py
ashok-arjun/LCFCN-AI
170
12704276
import torch import tqdm import argparse import pandas as pd import pickle, os import numpy as np from . import base_networks from haven import haven_results as hr from haven import haven_chk as hc from . import lcfcn def get_model(model_dict, exp_dict=None, train_set=None): if model_dict['name'] in ["lcfcn"]: ...
quickbooks/helpers.py
varunbheemaiah/python-quickbooks
234
12704289
def qb_date_format(input_date): """ Converts date to quickbooks date format :param input_date: :return: """ return input_date.strftime("%Y-%m-%d") def qb_datetime_format(input_date): """ Converts datetime to quickbooks datetime format :param input_date: :return: """ re...
python/cpumenu.py
3mdeb/bits
215
12704306
<filename>python/cpumenu.py # Copyright (c) 2015, Intel Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice,...
qa/rpc-tests/electrum_transaction_get.py
gandrewstone/bitcoin
535
12704312
#!/usr/bin/env python3 # Copyright (c) 2020 The Bitcoin Unlimited developers """ Tests the electrum call 'blockchain.transaction.get' """ import asyncio from test_framework.util import assert_equal, p2p_port from test_framework.electrumutil import ElectrumTestFramework, ElectrumConnection from test_framework.nodemessag...
export_model_mediapipe.py
saj940826/youtube-8m
2,341
12704314
<reponame>saj940826/youtube-8m # Lint as: python3 import numpy as np import tensorflow as tf from tensorflow import app from tensorflow import flags FLAGS = flags.FLAGS def main(unused_argv): # Get the input tensor names to be replaced. tf.reset_default_graph() meta_graph_location = FLAGS.checkpoint_file + ".m...
xfdnn/rt/xdnn_io.py
yarenty/ml-suite
334
12704324
#!/usr/bin/env python # # // SPDX-License-Identifier: BSD-3-CLAUSE # # (C) Copyright 2018, Xilinx, Inc. # import os import json import argparse from collections import OrderedDict import h5py import ntpath import cv2 import numpy as np from xfdnn.rt.xdnn_util import literal_eval from ext.PyTurboJPEG import imread as ...
HeapInspect.py
IMULMUL/heapinspect
218
12704328
<filename>HeapInspect.py import argparse from heapinspect.core import * if __name__ == '__main__': parser = argparse.ArgumentParser( prog='HeapInspect.py', description='''Inspect your heap by a given pid. Author:matrix1001 Github:https://github.com/matrix1001/heapinspect''') parser.add_argumen...
tests/pytests/unit/pillar/test_netbox.py
waynegemmell/salt
9,425
12704330
""" :codeauthor: <NAME> <<EMAIL>> """ import pytest import salt.pillar.netbox as netbox from tests.support.mock import patch @pytest.fixture def default_kwargs(): return { "minion_id": "minion1", "pillar": None, "api_url": "http://netbox.example.com", "api_token": "ye<PASSWORD...
procrastinate/utils.py
ignaciocabeza/procrastinate
129
12704334
import asyncio import contextlib import datetime import functools import importlib import inspect import logging import pathlib import types from typing import Any, Awaitable, Callable, Iterable, Optional, Type, TypeVar import dateutil.parser from procrastinate import exceptions T = TypeVar("T") U = TypeVar("U") lo...
monitoring/prometheus/aliyun-exporter/aliyun_exporter/utils.py
smthkissinger/docker-images
264
12704340
def format_metric(text: str): return text.replace('.', '_') def format_period(text: str): return text.split(',', 1)[0] def try_or_else(op, default): try: return op() except: return default
tests/framework/DataObjects/DataobjectsAttributes/massflowrate_fake.py
rinelson456/raven
159
12704366
<filename>tests/framework/DataObjects/DataobjectsAttributes/massflowrate_fake.py # Copyright 2017 Battelle Energy Alliance, 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....
clif/python/slots.py
wangxf123456/clif
966
12704376
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
ivy/test/implement1.py
b1f6c1c4/cfg-enum
113
12704411
from ivy import ivy_module as im from ivy.ivy_compiler import ivy_from_string from ivy.tk_ui import new_ui from ivy import ivy_utils as iu from ivy import ivy_check as ick prog = """#lang ivy1.5 type packet object intf = { action send(x:packet) action recv(x:packet) } object spec = { relation sent(X:pac...
src/tree/1028.recover-a-tree-from-preorder-traversal/recover-a-tree-from-preorder-traversal.py
lyphui/Just-Code
782
12704419
class Solution: def recoverFromPreorder(self, S: str) -> TreeNode: if not S: return l = S.split('-') s, depth = [[TreeNode(l[0]), 0]], 1 for item in l[1:]: if not item: depth += 1 continue node = TreeNode(item) while...
CircuitPython_OLED_Watch/CircuitPython_OLED_Watch.py
joewalk102/Adafruit_Learning_System_Guides
665
12704428
<reponame>joewalk102/Adafruit_Learning_System_Guides import board import displayio import adafruit_displayio_ssd1306 import terminalio import adafruit_ds3231 from adafruit_display_text import label font = terminalio.FONT displayio.release_displays() i2c = board.I2C() display_bus = displayio.I2CDisplay(i2c, device_...
test/programytest/storage/stores/sql/store/test_conversations.py
cdoebler1/AIML2
345
12704431
import unittest from unittest.mock import patch import programytest.storage.engines as Engines from programy.dialog.conversation import Conversation from programy.dialog.question import Question from programy.parser.pattern.match import Match from programy.parser.pattern.matchcontext import MatchContext from programy.p...
docker-desktop/vnc/docker-ubuntu-vnc-desktop/image/usr/local/lib/web/backend/vnc/log.py
smthkissinger/docker-images
2,917
12704477
import logging log = logging.getLogger('novnc2')
workflows/pipe-common/pipeline/utils/ssh.py
ZMaratovna/cloud-pipeline
126
12704502
<reponame>ZMaratovna/cloud-pipeline<gh_stars>100-1000 # Copyright 2017-2021 EPAM Systems, Inc. (https://www.epam.com/) # # 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...
vel/api/metrics/__init__.py
tigerwlin/vel
273
12704505
<filename>vel/api/metrics/__init__.py from .base_metric import BaseMetric from .averaging_metric import AveragingMetric, AveragingNamedMetric, AveragingSupervisedMetric from .value_metric import ValueMetric from .summing_metric import SummingMetric, SummingNamedMetric
python/fate_client/pipeline/param/psi_param.py
hubert-he/FATE
3,787
12704515
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 The FATE 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/lic...
ecosystem_tools/mindconverter/mindconverter/graph_based_converter/mapper/onnx/ops/clip_mapper.py
mindspore-ai/mindinsight
216
12704584
<gh_stars>100-1000 # Copyright 2021 Huawei Technologies Co., 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
astroquery/jplspec/setup_package.py
rickynilsson/astroquery
577
12704625
<gh_stars>100-1000 # Licensed under a 3-clause BSD style license - see LICENSE.rst import os def get_package_data(): paths_test = [os.path.join('data', 'CO.data'), os.path.join('data', 'CO_6.data'), os.path.join('data', 'multi.data')] paths_data = [os.path.join('data', '...
Stock/Data/Viewer/IndexConsecutiveDayLineStats/DyStockDataIndexConsecutiveDayLineStatsTabWidget.py
Leonardo-YXH/DevilYuan
135
12704631
from PyQt5.QtWidgets import QTabWidget from ....Common.DyStockCommon import * from .DyStockDataIndexConsecutiveDayLineStatsWidget import * class DyStockDataIndexConsecutiveDayLineStatsTabWidget(QTabWidget): def __init__(self, dataWindow, startDate, endDate, indexCountedDfs, greenLine=True): super().__in...
src/main/APIClient.py
BMW-InnovationLab/BMW-Anonymization-API
108
12704636
<reponame>BMW-InnovationLab/BMW-Anonymization-API import os import time import io import sys import json import requests import jsonschema from exceptions import InvalidUrlConfiguration, ApplicationError class ApiClient: def __init__(self): self.configuration = [] self.url_list = self.get_url_conf...
core/clonesf.py
faslan1234/socialfish
2,970
12704652
<filename>core/clonesf.py<gh_stars>1000+ import requests import re import os # CLONING FUNCTIONS -------------------------------------------------------------------------------------------- def clone(url, user_agent, beef): try: u = url.replace('://', '-') q = 'templates/fake/{}/{}'.format(...
la/oblas/data/dpotrf01.py
wtsia/gosl
1,811
12704682
<gh_stars>1000+ import numpy as np import scipy.linalg as la from auxiliary import * a = np.matrix([ [+3, +0, -3, +0], [+0, +3, +1, +2], [-3, +1, +4, +1], [+0, +2, +1, +3], ],dtype=float) res = la.cholesky(a, lower=False) mprint('aUp', res) res = la.cholesky(a, lower=True) mprint('aLo', res)
mmdet/models/detectors/reasoning_rcnn.py
TaoBowoa180011/Reasoning-RCNN
178
12704683
from __future__ import division import torch import torch.nn as nn from .base import BaseDetector from .test_mixins import RPNTestMixin from .. import builder from ..registry import DETECTORS from mmdet.core import (assign_and_sample, bbox2roi, bbox2result, multi_apply, merge_aug_masks) impor...
wikipron/__init__.py
wannaphong/wikipron
111
12704689
<filename>wikipron/__init__.py """Scrapes grapheme-to-phoneme data from Wiktionary.""" import pkg_resources from wikipron.config import Config from wikipron.scrape import scrape __version__ = pkg_resources.get_distribution("wikipron").version __all__ = ["__version__", "Config", "scrape"]
scripts/legend.py
oscargus/cheatsheets
6,062
12704774
# ----------------------------------------------------------------------------- # Matplotlib cheat sheet # Released under the BSD License # ----------------------------------------------------------------------------- import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt fig = plt.figure(figsize...
setup.py
skypjsfly/bustag
4,197
12704807
import io import os import re from setuptools import find_packages from setuptools import setup from bustag import __version__ def read(filename): filename = os.path.join(os.path.dirname(__file__), filename) text_type = type(u"") with io.open(filename, mode="r", encoding='utf-8') as fd: return re...
tests/test_tls.py
mguc/aiocoap
229
12704824
<reponame>mguc/aiocoap<gh_stars>100-1000 # This file is part of the Python aiocoap library project. # # Copyright (c) 2012-2014 <NAME> <http://sixpinetrees.blogspot.com/>, # 2013-2014 <NAME> <<EMAIL>> # # aiocoap is free software, this file is published under the MIT license as # described in the accompan...
tests/test_parser/test_rdfxml.py
cthoyt/pronto
182
12704843
<reponame>cthoyt/pronto import io import os import unittest import warnings import xml.etree.ElementTree as etree import pronto class TestRdfXMLParser(unittest.TestCase): @staticmethod def get_ontology(content): xml = f""" <rdf:RDF xmlns="http://purl.obolibrary.org/obo/TEMP#" x...
examples/comparison.py
dojitza/ddnn
110
12704846
import os import sys sys.path.append('..') import argparse import chainer from elaas.elaas import Collection from elaas.family.simple import SimpleHybridFamily from elaas.family.binary import BinaryFamily from elaas.family.float import FloatFamily from elaas.family.multi_input_edge_with_dropout import MultiInputEdgeD...
utils/dcrf.py
loserbbb/1-stage-wseg
364
12704866
import numpy as np import pydensecrf.densecrf as dcrf from pydensecrf.utils import unary_from_softmax def crf_inference(img, probs, t=10, scale_factor=1, labels=21): h, w = img.shape[:2] n_labels = labels d = dcrf.DenseCRF2D(w, h, n_labels) unary = unary_from_softmax(probs) unary = np.ascontigu...
courses/unstructured/01-dataprocML.py
laurenzberger/training-data-analyst
6,140
12704888
<gh_stars>1000+ #!/usr/bin/env python # Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
mesh/node.py
eric-downes/mesh-networking
368
12704912
# -*- coding: utf-8 -*- # MIT License: <NAME> import random import threading import time from collections import defaultdict try: from queue import Queue except ImportError: from Queue import Queue from .filters import LoopbackFilter # Physical Layer (copper, fiber, audio, wireless) # Link Layer (ethernet, ...
h2o-py/tests/testdir_misc/pyunit_backend_errors.py
vishalbelsare/h2o-3
6,098
12704919
<filename>h2o-py/tests/testdir_misc/pyunit_backend_errors.py import sys sys.path.insert(1,"../../") import h2o from h2o.estimators import H2OGradientBoostingEstimator from h2o.exceptions import H2OResponseError from h2o.schemas import H2OErrorV3, H2OModelBuilderErrorV3 from tests import pyunit_utils as pu def test_b...
test/game/test_tree.py
MAWUT0R/PokerRL
247
12704974
<filename>test/game/test_tree.py # Copyright (c) 2019 <NAME> import unittest from unittest import TestCase import numpy as np from PokerRL.game._.tree.PublicTree import PublicTree from PokerRL.game.games import StandardLeduc, DiscretizedNLLeduc from PokerRL.game.wrappers import HistoryEnvBuilder class TestGameTre...
tractseg/experiments/pretrained_models/TractSeg_All_xtract_PeakRot4.py
inaccel/TractSeg
148
12704985
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- import os from tractseg.data import dataset_specific_utils from tractseg.experiments.tract_seg import Config as TractSegConfig class Config(TractSegConfig): EXP_NAME = os.path.basename(__file__).split(".")[0] DATASET = "HCP_all" DATASET_FOL...
xar/xar_util.py
backwardn/xar
1,477
12704997
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. from __future__ import absolute_import, division, print_function, unicode_literals import collections import contex...
preprocessors/abstract_preprocessor.py
slowy07/tensor2robot
456
12705002
# coding=utf-8 # Copyright 2021 The Tensor2Robot Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
{{cookiecutter.project_slug}}/pages/migrations/0013_videopage_videopagecarouselitem.py
lendlsmith/wagtail-cookiecutter-foundation
182
12705003
<filename>{{cookiecutter.project_slug}}/pages/migrations/0013_videopage_videopagecarouselitem.py # -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-08-08 13:59 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import modelcluster.fields import w...
tests/SampleApps/python/flask-setup-py-requirement-txt/app.py
samruddhikhandale/Oryx
403
12705004
from flask import Flask from datetime import datetime app = Flask(__name__) @app.route("/") def hello(): return "Hello World! " + str(datetime.now())
exps/stage3_root2/test.py
zju3dv/SMAP
209
12705011
<reponame>zju3dv/SMAP<filename>exps/stage3_root2/test.py """ @author: <NAME> @contact: <EMAIL> """ import os import argparse import json import cv2 from tqdm import tqdm from torch.utils.data import DataLoader from cvpack.utils.logger import get_logger from model.smap import SMAP from model.refinenet import RefineNe...
tests/debug/__init__.py
int19h/ptvsd
349
12705019
<gh_stars>100-1000 # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root # for license information. from __future__ import absolute_import, division, print_function, unicode_literals # Expose Session directly. def Session(*args, **kwargs): f...
matrix-python-project/material_sync/sync_cronjob.py
hokaso/hocassian-media-matrix
141
12705140
import schedule, time, sys, os, traceback sys.path.append(os.getcwd()) from material_sync.sync_to_baidu_cloud import Sync2Cloud p = Sync2Cloud().main schedule.every(1).days.at("03:00").do(p) # schedule.every(1).minutes.do(p) print("脚本已启动") while True: try: schedule.run_pending() time.sleep(1) ...
corehq/apps/users/migrations/0001_add_location_permission.py
dimagilg/commcare-hq
471
12705155
<reponame>dimagilg/commcare-hq # Generated by Django 1.9.12 on 2017-03-09 02:05 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ] operations = []
jarviscli/plugins/blackjack.py
WWFelina/Jarvis
2,605
12705169
import random from plugin import plugin from colorama import Fore def delay(): # method to pause after a series of actions have been completed. n = input("Press enter to continue") def wiped_slate(player): # resets all hands and bets player['hands'] = [] player['suits'] = [] player['bets'] = [] ...
RecoEgamma/EgammaTools/python/gbrwrappermaker_cfi.py
ckamtsikis/cmssw
852
12705172
<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms gbrwrappermaker = cms.EDAnalyzer('GBRWrapperMaker' )
test/question.py
guoweikuang/zhihu-api
1,065
12705183
<filename>test/question.py # encoding: utf-8 import unittest from zhihu import Question class QuestionTestCase(unittest.TestCase): def test_follow_question_with_id(self): data = Question(id=32096743).follow_question() self.assertEqual({"is_following": True}, data) def test_unfollow_question_...
src/ansible_navigator/image_manager/__init__.py
ekmixon/ansible-navigator
134
12705189
"""image manager""" from .puller import ImagePuller from .inspector import inspect_all
visualize.py
AnTao97/PointCloudDataset
184
12705198
<filename>visualize.py import os import numpy as np def standardize_bbox(pcl, points_per_object): pt_indices = np.random.choice(pcl.shape[0], points_per_object, replace=False) np.random.shuffle(pt_indices) pcl = pcl[pt_indices] # n by 3 mins = np.amin(pcl, axis=0) maxs = np.amax(pcl, axis=0) ce...
safedelete/tests/test_many2many.py
GustavoNagel/django-safedelete
505
12705201
<filename>safedelete/tests/test_many2many.py import unittest from django.db import models from ..config import DELETED_VISIBLE from ..models import SafeDeleteModel from .testcase import SafeDeleteTestCase class ManyToManyChild(models.Model): pass class ManyToManyOtherChild(models.Model): pass class Many...
contrib/od/test/test_live.py
backwardn/ccs-calendarserver
462
12705203
## # Copyright (c) 2014-2017 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
venv/lib/python3.8/site-packages/statsmodels/tsa/arima_model.py
johncollinsai/post-high-frequency-data
6,931
12705253
""" See statsmodels.tsa.arima.model.ARIMA and statsmodels.tsa.SARIMAX. """ ARIMA_DEPRECATION_ERROR = """ statsmodels.tsa.arima_model.ARMA and statsmodels.tsa.arima_model.ARIMA have been removed in favor of statsmodels.tsa.arima.model.ARIMA (note the . between arima and model) and statsmodels.tsa.SARIMAX. statsmodels....
spacy_transformers/span_getters.py
thomashacker/spacy-transformers
744
12705275
<reponame>thomashacker/spacy-transformers from typing import Callable, Iterable, List from functools import partial from spacy.tokens import Doc, Span from .util import registry SpannerT = Callable[[List[Doc]], List[List[Span]]] def get_strided_spans( docs: Iterable[Doc], window: int, stride: int ) -> List[List...
homeassistant/components/tractive/device_tracker.py
MrDelik/core
30,023
12705313
<gh_stars>1000+ """Support for Tractive device trackers.""" from __future__ import annotations from typing import Any from homeassistant.components.device_tracker import ( SOURCE_TYPE_BLUETOOTH, SOURCE_TYPE_GPS, ) from homeassistant.components.device_tracker.config_entry import TrackerEntity from homeassistan...
digits/dataset/__init__.py
wills2133/digits-ssd
4,552
12705319
<gh_stars>1000+ # Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import from .images import ImageClassificationDatasetJob, GenericImageDatasetJob from .generic import GenericDatasetJob from .job import DatasetJob __all__ = [ 'ImageClassificationDatasetJob', ...
test/test_memcpy.py
dendisuhubdy/coriander
644
12705348
# Copyright <NAME> 2017 """ 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 writing, software distri...
common.py
BerSerK/LianjiaSpider
143
12705350
<gh_stars>100-1000 # -*- coding: utf-8 -*- import pandas as pd imgfilename = 'table.png' import numpy as np import os import datetime import six import matplotlib.pyplot as plt import matplotlib from matplotlib import gridspec from pypinyin import pinyin import numpy as np from matplotlib.font_manager import FontPrope...
pretty_xml/pretty_xml.py
DazEB2/SimplePyScripts
117
12705353
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' def process_xml_string(xml_string): """ Функция из текста выдирает строку с xml -- она должна начинаться на < и заканчиваться > """ start = xml_string.index('<') end = xml_string.rindex('>') return xml_string[start:e...
lib/datasets/cityscapes/coco_to_cityscapes_id.py
jcjs/FPN-Pytorch
271
12705397
# Copyright (c) 2017-present, Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
core/polyaxon/polypod/init/custom.py
admariner/polyaxon
3,200
12705400
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
basicsr/metrics/psnr_ssim.py
DEMVSNet/HINet
237
12705410
<reponame>DEMVSNet/HINet # ------------------------------------------------------------------------ # Copyright (c) 2021 megvii-model. All Rights Reserved. # ------------------------------------------------------------------------ # Modified from BasicSR (https://github.com/xinntao/BasicSR) # Copyright 2018-2020 BasicS...
tests/sockets/socket_relay.py
albertobarri/idk
9,724
12705434
# Copyright 2013 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. """Listens on 2 ports and relays between them. Listens to ports A an...
seahub/api2/endpoints/ocm_repos.py
weimens/seahub
101
12705467
<reponame>weimens/seahub import logging import requests import json from rest_framework import status 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 seahub...
setup.py
ZeekoZhu/viscm
122
12705478
<reponame>ZeekoZhu/viscm<filename>setup.py from setuptools import setup, find_packages import sys import os.path import numpy as np # Must be one line or PyPI will cut it off DESC = ("A colormap tool") LONG_DESC = open("README.rst").read() setup( name="viscm", version="0.9", description=DESC, long_d...
pixiedust/__init__.py
elgalu/pixiedust
598
12705495
<reponame>elgalu/pixiedust<gh_stars>100-1000 # ------------------------------------------------------------------------------- # Copyright IBM Corp. 2017 # # 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...
sealion/neural_networks/loss.py
anish-lakkapragada/sealion
341
12705522
""" @author : <NAME> @date : 1 - 23 - 2021 The loss functions are really simple. You just need to understand whether it is a classification or regression task. All losses will be set in the model.finalize() model. """ import numpy as np import warnings from scipy.special import softmax as sfmx_indiv warnings.filterwa...
python/part2/initialize.py
enjalot/adventures_in_opencl
152
12705539
from OpenGL.GL import * import timing timings = timing.Timing() @timings def fountain_np(num): """numpy way of initializing data using ufuncs instead of loops""" import numpy pos = numpy.ndarray((num, 4), dtype=numpy.float32) col = numpy.ndarray((num, 4), dtype=numpy.float32) vel = numpy.ndarray(...
maro/cli/grass/executors/grass_azure_executor.py
yangboz/maro
598
12705566
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import collections import json import os import secrets import shutil import string import threading import time from multiprocessing.pool import ThreadPool import yaml from maro.cli.grass.executors.grass_executor import GrassExecutor from mar...