max_stars_repo_path
string
max_stars_repo_name
string
max_stars_count
int64
id
string
content
string
add_param_types
int64
add_return_types
int64
add_class_field_types
int64
add_instance_field_types
int64
add_total
int64
add_error
int64
modules/api/functional_test/live_tests/internal/health_test.py
slandry90/vinyldns
333
145616
<filename>modules/api/functional_test/live_tests/internal/health_test.py import pytest from hamcrest import * from vinyldns_python import VinylDNSClient def test_health(shared_zone_test_context): """ Tests that the health check endpoint works """ client = shared_zone_test_context.ok_vinyldns_client ...
0
0
0
0
0
0
gtsfm/averaging/rotation/rotation_averaging_base.py
swershrimpy/gtsfm
122
145617
<filename>gtsfm/averaging/rotation/rotation_averaging_base.py """Base class for the rotation averaging component of the GTSFM pipeline. Authors: <NAME>, <NAME> """ import abc from typing import Dict, List, Optional, Tuple import dask from dask.delayed import Delayed from gtsam import Rot3 class RotationAveragingBas...
0
0
0
0
0
0
utils/eval/geometry.py
wx-b/patch2pix
157
145623
<reponame>wx-b/patch2pix import numpy as np from transforms3d.quaternions import quat2mat, mat2quat # The skew-symmetric matrix of vector skew = lambda v: np.array([[0, -v[2], v[1]], [v[2], 0, -v[0]], [-v[1], v[0], 0]]) # Essential matrix & fundamental matrix ess2fund = lambda K1, K2, E: np.linalg.inv(K2).T @ E @ n...
0
0
0
0
0
0
onmt/train_single.py
memray/OpenNMT-kpg-release
152
145657
#!/usr/bin/env python from __future__ import annotations """Training on a single process.""" import os import shutil import torch from onmt.inputters.inputter import build_dataset_iter, \ load_old_vocab, old_style_vocab, build_dataset_iter_multiple, make_tgt, reload_news_fields from onmt.inputters.news_dataset im...
2
1
0
0
3
0
platform/coredb/coredb/migrations/0006_auto_20201020_1705.py
admariner/polyaxon
3,200
145667
#!/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 ...
0
0
2
0
2
0
jupyter_book/utils.py
dlukes/jupyter-book
108
145679
from __future__ import annotations from pathlib import Path from textwrap import dedent from jupyter_client.kernelspec import find_kernel_specs SUPPORTED_FILE_SUFFIXES = [".ipynb", ".md", ".markdown", ".myst", ".Rmd", ".py"] def _filename_to_title(filename, split_char: str="_") -> object: """Convert a file path ...
5
3
0
0
8
0
060_hair_segmentation/01_float32/01_hair_segmentation_tflite2h5_weight_int_fullint_float16_quant.py
IgiArdiyanto/PINTO_model_zoo
1,529
145690
### tensorflow==2.3.0 ### https://ai.googleblog.com/2020/08/on-device-real-time-body-pose-tracking.html ### https://google.github.io/mediapipe/solutions/pose ### https://www.tensorflow.org/api_docs/python/tf/keras/Model ### https://www.tensorflow.org/lite/guide/ops_compatibility ### https://www.tensorflow.org/api_do...
2
4
0
0
6
0
enteletaor_lib/modules/brute/cmd_list_wordlists.py
Seabreg/enteletaor
159
145694
# -*- coding: utf-8 -*- import os import logging log = logging.getLogger() # ---------------------------------------------------------------------- def cmd_list_wordlists(config): """ Get all internal wordlist """ base_wordlists = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "resources",...
0
0
0
0
0
0
moneywagon/services/exchange_services.py
Detrous/moneywagon
147
145762
from __future__ import annotations import json import os from requests.auth import HTTPBasicAuth from moneywagon.core import ( Service, NoService, NoData, ServiceError, SkipThisService, currency_to_protocol, decompile_scriptPubKey ) from bitcoin import deserialize import arrow from bs4 import BeautifulSoup im...
56
259
129
1
445
0
cocos/symbolic/__init__.py
michaelnowotny/cocos
101
145820
from ._lambdification import ( DUMMY_TIME_SYMBOL, lambdify, LambdifiedArrayExpressions, LambdifiedMatrixExpressions, LambdifiedVectorExpressions, LambdifiedArrayExpression, LambdifiedMatrixExpression, LambdifiedVectorExpression, LambdifiedScalarExpression ) from .utilities import fi...
0
0
0
0
0
0
recipes/Python/578973_Easy_attribute_setting_pretty/recipe-578973.py
tdiprima/code
2,023
145821
"""Mix-in classes for easy attribute setting and pretty representation >>> class T(HasInitableAttributes, HasTypedAttributes, IsCallable): ... spam = str ... def __init__(self, eggs, ham = 'ham'): pass ... >>> t = T('bacon'); t(ham = 'eggs'); t.spam += 'sausage'; t __main__.T('bacon', ham = 'eggs', spam = 'sau...
0
3
0
0
3
0
lightnion/consensus.py
pthevenet/lightnion
120
145831
<gh_stars>100-1000 from base64 import b64encode, b64decode import datetime import binascii import time import os import re import urllib.request import lightnion as lnn from tools.keys import get_signing_keys_info # TODO: remove extra (useless) checks/exceptions within this file def scrap(consensus, end_of_field):...
0
0
0
0
0
0
volttron/platform/keystore.py
cloudcomputingabc/volttron
406
145836
<filename>volttron/platform/keystore.py # -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # # Copyright 2020, Battelle Memorial Institute. # # Licensed under the Apache License, Version 2.0 (the "License"); # ...
0
0
0
0
0
0
python/my-widget-service/my_widget_service/my_widget_service_stack.py
marclyo/aws-cdk-examples
2,941
145837
<filename>python/my-widget-service/my_widget_service/my_widget_service_stack.py from aws_cdk import ( core, aws_apigateway as apigw, aws_s3 as s3, aws_iam as iam ) class MyWidgetServiceStack(core.Stack): def __init__(self, app: core.App, id: str, **kwargs) -> None: super().__init__(app, i...
0
0
0
0
0
0
histoqc/tests/test_data_cli.py
kaczmarj/HistoQC
140
145859
<reponame>kaczmarj/HistoQC import os from histoqc.data.__main__ import main def test_data_cli_write_output(tmp_path): assert main([os.fspath(tmp_path)]) == 0 assert set(x.name for x in tmp_path.iterdir()) == {'templates', 'models', 'pen'} def test_data_cli_incorrect_output(capsys): assert main(['does-n...
0
0
0
0
0
0
test/make_sln.py
j123123/llilc
1,712
145871
#!/usr/bin/env python # # title : make_sln.py # description : Make a Visual Studio solution to debug a managed # application using LLILC jit. # # This script has been tested running on both Python 2.7 and Python 3.4. # # usage: make_sln.py [-h] [-d {summary,verbose}] [-x [EXTRA [EXTRA ....
0
5
0
0
5
0
misc/find-cids.py
S-YOU/quicly
8,657
145891
#!/usr/bin/env python import sys import json if len(sys.argv) != 2: print "Usage: find-cids.py inTrace.jsonl" sys.exit(1) cids = {} f = open(sys.argv[1], 'r') for line in f: event = json.loads(line) if event["type"] != "" and event["type"] == "accept": cids[event["conn"]] = None print "Connec...
0
0
0
0
0
0
mock_data_generators/channel_program_name_gen.py
tzooming/bigquery-ml-templates
154
145896
<reponame>tzooming/bigquery-ml-templates ''' Copyright 2019 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 Unless required by applicable...
0
0
0
0
0
0
home/museum.py
pwqbot/eoj3
107
145897
<gh_stars>100-1000 from datetime import datetime, timedelta from django.db.models import Count from django.db.models.functions import TruncDate, TruncYear from django.shortcuts import render from account.models import User from dispatcher.manage import ping from dispatcher.models import Server from problem.models imp...
0
0
0
0
0
0
vertx-web/src/test/sockjs-protocol/websocket/tests/test_cookiejar.py
yeikel/vertx-web
1,553
145916
<filename>vertx-web/src/test/sockjs-protocol/websocket/tests/test_cookiejar.py<gh_stars>1000+ import unittest from websocket._cookiejar import SimpleCookieJar try: import Cookie except: import http.cookies as Cookie class CookieJarTest(unittest.TestCase): def testAdd(self): cookie_jar = SimpleCo...
0
0
0
0
0
0
terrascript/provider/Mongey/hellosign.py
mjuenema/python-terrascript
507
145932
# terrascript/provider/Mongey/hellosign.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:18:22 UTC) import terrascript class hellosign(terrascript.Provider): """""" __description__: str = "" __namespace__: str = "Mongey" __name__: str = "hellosign" __source__: str = "https://git...
0
0
7
0
7
0
vh-nginx/__init__.py
rEinve/ajenti-v
150
145940
import ajenti from ajenti.api import * from ajenti.plugins import * info = PluginInfo( title='Ajenti VH - NGINX Support', icon='globe', dependencies=[ PluginDependency('vh'), PluginDependency('services'), #BinaryDependency('nginx'), ], ) def init(): from ajenti.plugins.vh...
0
0
0
0
0
0
tests/test_flask_kvsession.py
ldruschk/flask-kvsession
102
145951
#!/usr/bin/env python # coding=utf8 from datetime import timedelta import json import time from itsdangerous import Signer from six import b import pytest def json_dec(bs) -> object: return json.loads(bs.decode('ascii')) def split_cookie(app, rv) -> tuple[object, object]: signer = Signer(app.secret_key) ...
0
2
0
0
2
0
insights/combiners/x86_page_branch.py
lhuett/insights-core
121
145956
""" X86PageBranch - combiner for x86 kernel features: ================================================= x86 kernel features includes: * PTI (Page Table Isolation) * IBPB (Indirect Branch Prediction Barrier) * IBRS (Indirect Branch Restricted Speculation) This combiner reads information from debugfs: Exam...
0
0
0
1
1
0
dsgn/layers/smooth_l1_loss.py
fangchengji/DSGN
192
145961
<gh_stars>100-1000 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch import numpy as np # TODO maybe push this to nn? def smooth_l1_loss(input, target, beta=1. / 9, size_average=True): """ very similar to the smooth_l1_loss from pytorch, but with the extra beta parameter ...
0
0
0
0
0
0
tests/test_sampler.py
nylas/stackcollector
592
145976
import time from stacksampler import Sampler def slp(): time.sleep(0.00001) def fn(): for i in range(50000): slp() s = Sampler() def test_foo(): s.start() fn() print s.output_stats() if __name__ == '__main__': test_foo()
0
0
0
0
0
0
chapter13/ShortCorridor.py
zhaoletian/reinforcement-learning-an-introduction
220
146012
####################################################################### # Copyright (C) # # 2018 <NAME> (<EMAIL>) # # Permission given to modify the code as long as you keep this # # declaration at the top ...
0
1
0
0
1
0
coordinator/SwitchOracles/oracle.py
TotalKnob/muse
122
146016
<filename>coordinator/SwitchOracles/oracle.py from switch_oracle import * def get_switch_oracle(config, proj_dir): return SwitchOracles(config, proj_dir)
0
0
0
0
0
0
modules/dbnd/src/dbnd/_vendor/pygtrie.py
ipattarapong/dbnd
224
146029
<reponame>ipattarapong/dbnd<filename>modules/dbnd/src/dbnd/_vendor/pygtrie.py # -*- coding: utf-8 -*- """Implementation of a trie data structure. `Trie data structure <http://en.wikipedia.org/wiki/Trie>`_, also known as radix or prefix tree, is a tree associating keys to values where all the descendants of a node have ...
0
0
0
0
0
0
examples/basic.py
SamiAlsubhi/fastapi-jwt-auth
357
146030
from fastapi import FastAPI, HTTPException, Depends, Request from fastapi.responses import JSONResponse from fastapi_jwt_auth import AuthJWT from fastapi_jwt_auth.exceptions import AuthJWTException from pydantic import BaseModel app = FastAPI() class User(BaseModel): username: str password: str # in producti...
5
4
3
0
12
0
PyInstaller/building/splash.py
hawkhai/pyinstaller
9,267
146049
<filename>PyInstaller/building/splash.py # ----------------------------------------------------------------------------- # Copyright (c) 2005-2021, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # T...
0
0
0
0
0
0
service_catalog/models/tower_server.py
Sispheor/squest
112
146070
<gh_stars>100-1000 from django.db import models from towerlib import Tower class TowerServer(models.Model): name = models.CharField(max_length=100) host = models.CharField(max_length=200, unique=True) token = models.CharField(max_length=200) secure = models.BooleanField(default=True) ssl_verify = ...
0
0
0
0
0
0
contrib/opencensus-ext-azure/examples/metrics/simple.py
Flared/opencensus-python
650
146082
# Copyright 2019, OpenCensus 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 law or agreed to in w...
0
0
0
0
0
0
gtfspy/import_loaders/route_loader.py
Leo-Ryu/gtfspy
118
146087
from gtfspy.import_loaders.table_loader import TableLoader, decode_six class RouteLoader(TableLoader): fname: str = 'routes.txt' table: str = 'routes' tabledef = '(route_I INTEGER PRIMARY KEY, ' \ 'route_id TEXT UNIQUE NOT NULL, ' \ 'agency_I INT, ' \ 'name TEX...
0
0
4
0
4
0
cyclegan/data/celeba_faceswap/paste_faces.py
dingyanna/DepthNets
114
146092
<filename>cyclegan/data/celeba_faceswap/paste_faces.py from skimage.io import imread, imsave import numpy as np import glob import os import sys dest_folder = "extracted_images_pasted" if not os.path.exists(dest_folder): os.makedirs(dest_folder) for filename in glob.glob("extracted_images/*.png"): print("Proc...
0
0
0
0
0
0
pythran/tests/test_math.py
davidbrochart/pythran
1,647
146117
from pythran.tests import TestEnv @TestEnv.module class TestMath(TestEnv): def test_cos_(self): self.run_test("def cos_(a):\n from math import cos\n return cos(a)", 1, cos_=[int]) def test_exp_(self): self.run_test("def exp_(a):\n from math import exp\n return exp(a)", 1, exp_=[int]) de...
0
0
0
0
0
0
datmo/cli/command/tests/test_workspace.py
dmh43/datmo
331
146157
<reponame>dmh43/datmo """ Tests for Project Commands """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals # TODO: include builtin libraries for the appropriate Python # try: # import __builtin__ # except ImportError: # # Python 3 # import builtin...
0
0
0
0
0
0
psonic/samples/misc.py
m-roberts/python-sonic
263
146177
<filename>psonic/samples/misc.py """Miscellaneous Sounds""" from . import Sample MISC_BURP = Sample('misc_burp', 0.7932879818594104) MISC_CINEBOOM = Sample('misc_cineboom', 7.922675736961451) MISC_CROW = Sample('misc_crow', 0.48063492063492064)
0
0
0
0
0
0
modules/dbnd/src/dbnd/_vendor/psutil/vendorized_psutil.py
ipattarapong/dbnd
224
146185
<reponame>ipattarapong/dbnd<gh_stars>100-1000 import errno import os def pid_exists(pid): """Check whether pid exists in the current process table.""" if pid == 0: # According to "man 2 kill" PID 0 has a special meaning: # it refers to <<every process in the process group of the # call...
0
0
0
0
0
0
src/sagemaker/cli/compatibility/v2/modifiers/matching.py
LastRemote/sagemaker-python-sdk
1,690
146190
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompan...
0
6
0
0
6
0
Giveme5W1H/extractor/tools/mapper.py
bkrrr/Giveme5W
410
146206
from __future__ import annotations """ Helper to get relation to extractors, questions and their weights """ def weight_to_string(extractor, weight_index, question: str = None) -> str: """ naming for a weight :param extractor: :param weight_index: :return: """ if extractor == 'action': ...
3
3
0
0
6
0
tests/test_DumpCreds.py
sc979/jenkins-attack-framework
451
146211
<filename>tests/test_DumpCreds.py<gh_stars>100-1000 import unittest import warnings from libs.JAF.BaseCommandLineParser import BaseCommandLineParser from libs.JAF.plugin_DumpCreds import DumpCreds, DumpCredsParser from .configuration import ( server, user_admin, user_bad, user_noaccess, user_norma...
0
0
0
0
0
0
python/ql/src/Statements/SysExitUsed.py
vadi2/codeql
4,036
146221
<filename>python/ql/src/Statements/SysExitUsed.py import sys def main(): try: process() except Exception as ex: print(ex) sys.exit(1)
0
0
0
0
0
0
plugins/assets/__init__.py
qrilka/this-week-in-rust
533
146255
from .assets import *
0
0
0
0
0
0
tests/vcd_ext.py
gpooja3/pyvcloud
168
146257
<reponame>gpooja3/pyvcloud<gh_stars>100-1000 # VMware vCloud Director Python SDK # Copyright (c) 2017-2018 VMware, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # ...
0
0
0
0
0
0
Python/other/Wave_Array.py
Khushboo85277/NeoAlgo
897
146312
""" Sorting the array into a wave-like array. For eg: arr[] = {1,2,3,4,5} Output: 2 1 4 3 5 """ def convertToWave(length,array) -> object: for i in range(0, length - length%2, 2): #swapping alternatively temp=array[i] array[i]=array[i+1] array[i+1]=temp return array arr ...
0
1
0
0
1
0
setup.py
11010cy/airflow-client-python
115
146320
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
0
0
0
0
0
0
tests/test_position.py
nervecell23/qstrader_c
113
146324
<reponame>nervecell23/qstrader_c import unittest from qstrader.position import Position from qstrader.price_parser import PriceParser class TestRoundTripXOMPosition(unittest.TestCase): """ Test a round-trip trade in Exxon-Mobil where the initial trade is a buy/long of 100 shares of XOM, at a price of ...
0
0
0
0
0
0
whispers/plugins/traverse.py
nidogski/whispers
415
146381
from __future__ import annotations from whispers.plugins.uri import Uri from whispers.rules import WhisperRules class StructuredDocument: def __init__(self, rules: WhisperRules): self.breadcrumbs: list[object] = [] self.rules = rules def traverse(self, code, key: object | None=None): ...
2
1
0
1
4
0
grappelli/views/switch.py
browniebroke/django-grappelli
2,210
146383
# coding: utf-8 from django.conf import settings from django.contrib import messages from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth import load_backend, login from django.core.exceptions import ObjectDoesNotExist from django.http import Http404 from django.shortcuts im...
0
1
0
0
1
0
hypergan/search/default_configurations.py
limberc/HyperGAN
889
146413
<filename>hypergan/search/default_configurations.py<gh_stars>100-1000 class DefaultConfigurations: @staticmethod def get(): return {}
0
0
0
0
0
0
filter_images.py
allendred/train-DeepLab
199
146417
<reponame>allendred/train-DeepLab #!/usr/bin/env python # <NAME>, <EMAIL> # 2016/03/24 # TODO check if directories and file exist from __future__ import print_function import os import sys from skimage.io import imread, imsave import numpy as np from utils import get_id_classes, convert_from_color_segmentation, crea...
0
0
0
0
0
0
rlgraph/components/common/noise_components.py
RLGraph/RLGraph
290
146448
<filename>rlgraph/components/common/noise_components.py # Copyright 2018/2019 The RLgraph 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.apac...
0
0
0
0
0
0
src/execution/execution_service.py
tomgilbertson/script-server-v1
833
146472
from __future__ import annotations import logging from collections import namedtuple from typing import Optional, Dict, Callable, Any from auth.authorization import Authorizer, is_same_user from auth.user import User from execution.executor import ScriptExecutor from model import script_config from model.model_helper ...
7
25
0
5
37
0
example.py
aangelopoulos/conformal_classification
112
146480
<reponame>aangelopoulos/conformal_classification<filename>example.py import argparse import torch import torchvision import torchvision.transforms as transforms import numpy as np import matplotlib.pyplot as plt import time from utils import * from conformal import ConformalModel import torch.backends.cudnn as cudnn ...
0
0
0
0
0
0
examples/cls_svm_demo.py
msgi/nlp-tour
1,559
146506
from smartnlp.classfication.svm_classifier import SVMClassifier if __name__ == '__main__': svm_model = SVMClassifier('model/svm/model.pkl', './data/imdb/aclImdb.txt', train=True) # svm_model = SVMClassifier('model/svm/model.pkl') svm_model.predict...
0
0
0
0
0
0
main.py
kant/open-solution-toxic-comments
119
146508
<gh_stars>100-1000 import os import shutil import subprocess import click import numpy as np import pandas as pd from deepsense import neptune from sklearn.model_selection import StratifiedKFold from pipeline_config import SOLUTION_CONFIG, Y_COLUMNS, CV_LABELS, ID_LABEL from pipelines import PIPELINES from preprocess...
0
0
0
0
0
0
dataprofiler/labelers/__init__.py
gautomdas/DataProfiler
690
146514
<filename>dataprofiler/labelers/__init__.py<gh_stars>100-1000 """ The following will list the built-in models, processors, and data labelers. Models: 1. CharacterLevelCnnModel - character classification of text. 2. RegexModel - character classification of text. Processors: Preprocessors 1. CharPre...
0
0
0
0
0
0
tests/inferences/klpq_test.py
zhangyewu/edward
5,200
146523
<filename>tests/inferences/klpq_test.py from __future__ import absolute_import from __future__ import division from __future__ import print_function import edward as ed import numpy as np import tensorflow as tf from edward.models import Bernoulli, Normal class test_klpq_class(tf.test.TestCase): def _test_normal...
0
0
0
0
0
0
predict.py
kisel4363/CountNet
131
146541
import numpy as np import soundfile as sf import argparse import os import keras import sklearn import librosa from keras import backend as K eps = np.finfo(np.float).eps def class_mae(y_true, y_pred) -> object: return K.mean( K.abs( K.argmax(y_pred, axis=-1) - K.argmax(y_true, axis=-1) ...
0
2
0
0
2
0
src/programy/dynamic/maps/roman.py
cdoebler1/AIML2
345
146550
<reponame>cdoebler1/AIML2<gh_stars>100-1000 """ Copyright (c) 2016-2020 <NAME> http://www.keithsterling.com 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 l...
0
0
0
0
0
0
finalists/yc14600/PyTorch-Encoding/encoding/datasets/imagenet.py
lrzpellegrini/cvpr_clvision_challenge
2,190
146578
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ## Created by: <NAME> ## Email: <EMAIL> ## Copyright (c) 2018 ## ## This source code is licensed under the MIT-style license found in the ## LICENSE file in the root directory of this source tree ##++++++++++++++++++++++++++++++++++++++++++++++...
3
0
1
0
4
0
Alignment/CommonAlignmentProducer/python/GlobalTrackerMuonAlignment_cfi.py
ckamtsikis/cmssw
852
146598
<reponame>ckamtsikis/cmssw<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms GlobalTrackerMuonAlignment = cms.EDAnalyzer('GlobalTrackerMuonAlignment', isolated = cms.bool(False), cosmics = cms.bool(False), ...
0
0
0
0
0
0
args.py
hujilin1229/P-GNN
352
146618
from argparse import ArgumentParser def make_args() -> object: parser = ArgumentParser() # general parser.add_argument('--comment', dest='comment', default='0', type=str, help='comment') parser.add_argument('--task', dest='task', default='link', type=str, ...
0
1
0
0
1
0
haskell/private/cabal_wrapper.py
guibou/rules_haskell
222
146665
<reponame>guibou/rules_haskell #!/usr/bin/env python3 # cabal_wrapper.py <FILE.JSON> # # This wrapper calls Cabal's configure/build/install steps one big # action so that we don't have to track all inputs explicitly between # steps. It receives the path to a json file with the following schema: # # { "component": stri...
0
0
0
0
0
0
src/convert_transforms.py
Shuhei-YOSHIDA/tagslam
210
146672
import tf import numpy as np """ convert multicam_calib transforms to tagslam format: example session: ipython import numpy as np from convert_transforms import multicam_to_tagslam %load_ext autoreload %autoreload 2 # copy T_cn_cnm1 from multicam_calibration file: T=np.array([[0.99995273841, 0.00284628684, 0.0092962...
0
0
0
0
0
0
utils/box/__init__.py
pzheng2018/MutualGuide
124
146706
from .box_utils import * from .seq_matcher import SeqBoxMatcher from .detection import Detect from .prior_box import PriorBox
0
0
0
0
0
0
source/models/mann_net.py
SizheWei/OpenCompoundDomainAdaptation-OCDA
136
146717
from __future__ import annotations import numpy as np import torch import torch.nn as nn from .utils import register_model, get_model from . import cos_norm_classifier @register_model('MannNet') class MannNet(nn.Module): """Defines a Dynamic Meta-Embedding Network.""" def __init__(self, num_cls: int=10, mod...
7
1
0
1
9
0
parsifal/utils/test.py
ShivamPytho/parsifal
342
146722
<gh_stars>100-1000 from django.conf import settings from django.shortcuts import resolve_url from django.utils.http import urlencode def login_redirect_url(url): """ Utility function to be used as the "expected_url" param of the test case assertRedirects. :param url: Model instance, url pattern, url ...
0
0
0
0
0
0
src/pretix/base/migrations/0127_auto_20190711_0705.py
pajowu/pretix
1,248
146726
# Generated by Django 2.2.1 on 2019-07-11 07:05 from django.db import migrations import pretix.base.models.fields class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [ ('pretixbase', '0126_item_show_quota_left'), ] operations: list[object] = [ migrations.Rename...
0
0
2
0
2
0
tools/ipynb2md.py
xudong-sun/mxnet
399
146734
<reponame>xudong-sun/mxnet #!/usr/bin/env python # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache Lic...
0
0
0
0
0
0
src/aria_actions.py
Wildog/Ariafred
191
146741
<reponame>Wildog/Ariafred<filename>src/aria_actions.py # -*- coding: utf-8 -*- from __future__ import print_function import os import sys import xmlrpclib from workflow import Workflow3 def escape(s, char=' '): return s.replace(char, '\\' + char) def notify(msg, title='Ariafred', gid=''): notifier = os.path...
0
0
0
0
0
0
extra_tests/snippets/name.py
dbrgn/RustPython
11,058
146783
#when name.py is run __name__ should equal to __main__ assert __name__ == "__main__" from import_name import import_func #__name__ should be set to import_func import_func() assert __name__ == "__main__"
0
0
0
0
0
0
tests/px_integration_test.py
walles/px
149
146815
import os import sys from px import px def test_run_on_pid(capfd): """ Just run px on a PID. The only verification done here is that it doesn't crash, there is room for improvement... """ argv = [ sys.argv[0], "--no-pager", # Paging causes problems on Travis CI # Not...
0
0
0
0
0
0
pysph/examples/sloshing/sloshing_tank_pitch.py
nauaneed/pysph
293
146823
<reponame>nauaneed/pysph """Dam break flow against a tall structure The case is from "<NAME>, <NAME>, Sloshing in a three-dimensional rectangular tank: Numerical simulation and experimental validation, Ocean Engineering, Volume 33, Issue 16, 2006, Pages 2135-2149, ISSN 0029-8018" DOI: https://doi.org/10.1016/j.oceanen...
0
0
0
0
0
0
paperboy/resources/login.py
chris-aeviator/paperboy
233
146825
import falcon import jinja2 from .base import BaseResource from .html import read class LoginResource(BaseResource): '''Falcon resource for user authentication''' auth_required: bool = False def __init__(self, *args, **kwargs): super(LoginResource, self).__init__(*args, **kwargs) def on_get...
0
0
1
0
1
0
third_party/blink/tools/move_blink_source.py
zipated/src
2,151
146849
#!/usr/bin/env vpython # Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import annotations """Tool to move Blink source from third_party/WebKit to third_party/blink. See https://docs.google...
3
25
10
5
43
0
vimfiles/bundle/vim-python/submodules/pylama/tests/test_core.py
ciskoinch8/vimrc
463
146854
import os.path as op from pylama.check_async import check_async from pylama.config import parse_options from pylama.core import filter_errors, parse_modeline, run from pylama.errors import Error, remove_duplicates from pylama.hook import git_hook, hg_hook from pylama.main import shell, check_path def test_filter_err...
0
0
0
0
0
0
wal_e/worker/gs/__init__.py
paalkr/wal-e
2,739
146868
<filename>wal_e/worker/gs/__init__.py from wal_e.worker.gs.gs_deleter import Deleter from wal_e.worker.gs.gs_worker import BackupFetcher from wal_e.worker.gs.gs_worker import BackupList from wal_e.worker.gs.gs_worker import DeleteFromContext from wal_e.worker.gs.gs_worker import TarPartitionLister __all__ = [ 'Del...
0
0
0
0
0
0
tencentcloud/tbp/v20190627/models.py
PlasticMem/tencentcloud-sdk-python
465
146869
# -*- coding: utf8 -*- # Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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...
0
0
0
36
36
0
app/build/pip/debug/common/pyquery/text.py
hjlogzw/CrawlOnAndroid
1,758
146879
from __future__ import annotations import re # https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements#Elements INLINE_TAGS = { 'a', 'abbr', 'acronym', 'b', 'bdo', 'big', 'br', 'button', 'cite', 'code', 'dfn', 'em', 'i', 'img', 'input', 'kbd', 'label', 'map', 'object', 'q', 'samp', 'script', 'se...
5
6
0
0
11
0
plenum/test/node_catchup_with_3pc/test_catchup_with_skipped_commits.py
andkononykhin/plenum
148
146886
<reponame>andkononykhin/plenum<filename>plenum/test/node_catchup_with_3pc/test_catchup_with_skipped_commits.py from logging import getLogger from typing import Iterable import pytest from plenum.common.constants import DOMAIN_LEDGER_ID, AUDIT_LEDGER_ID from plenum.common.messages.node_messages import Commit from plen...
0
0
0
0
0
0
algorithms/PPO/train_PPO.py
borgwang/reinforce_py
119
146916
import os import time import logger import random import tensorflow as tf import gym import numpy as np from collections import deque from config import args from utils import set_global_seeds, sf01, explained_variance from agent import PPO from env_wrapper import make_env def main(): env = make_env() set_gl...
0
1
0
0
1
0
src/picktrue/logger.py
winkidney/PickTrue
118
146923
<gh_stars>100-1000 import logging import sys def __get_logger(name): __log_level = logging.INFO if "--debug-%s" % name in sys.argv: __log_level = logging.DEBUG fmt = "%(levelname)s - %(asctime)-15s - %(filename)s - line %(lineno)d --> %(message)s" date_fmt = "%a %d %b %Y %H:%M:%S" format...
0
0
0
0
0
0
tests/integration_tests/resources/dsl/deployment_update/modify_relationship_operation/modification/custom_workflow.py
TS-at-WS/cloudify-manager
124
146928
from cloudify.workflows import ctx, parameters ctx.logger.info(parameters.node_id) instance = [n for n in ctx.node_instances if n.node_id == parameters.node_id][0] for relationship in instance.relationships: relationship.execute_source_operation('custom_lifecycle.custom_operation')
0
0
0
0
0
0
qf_lib_tests/integration_tests/backtesting/test_scenarios_generator.py
webclinic017/qf-lib
198
146931
# 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/licenses/LICENSE-2...
0
0
0
0
0
0
tools/perf/page_sets/system_health/browsing_stories.py
iridium-browser/iridium-browser
575
146932
# encoding: utf-8 # 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. # The number of lines will be reduced after 2018 update is complete and # the old stories are removed: https://crbug.com/878390. # pylint:...
3
4
327
1
335
0
src/genie/libs/parser/iosxr/tests/AdminShowDiagChassis/cli/equal/golden_output_1_expected.py
balmasea/genieparser
204
146934
<gh_stars>100-1000 expected_output = { 'chassis_feature': 'V2 AC PEM', 'clei': 'IPMUP00BRB', 'desc': 'ASR 9006 4 Line Card Slot Chassis with V2 AC PEM', 'device_family': 'ASR', 'device_series': '9006', 'num_line_cards': 4, 'pid': 'ASR-9006-AC-V2', 'rack_num': 0, 'sn': 'FOX1810G8LR'...
0
0
0
0
0
0
h2o-bindings/bin/custom/R/gen_aggregator.py
kernelrich/h2o-3
6,098
147009
rest_api_version = 99 extensions = dict( required_params=['training_frame', 'x'], validate_required_params="", set_required_params=""" parms$training_frame <- training_frame if(!missing(x)) parms$ignored_columns <- .verify_datacols(training_frame, x)$cols_ignore """, with_model=""" model@model$aggreg...
0
0
0
0
0
0
tests/bulk_importer/test_bulk_importer.py
alessiamarcolini/hangar-py
202
147029
from __future__ import annotations import pytest import numpy as np def assert_equal(arr, arr2): assert np.array_equal(arr, arr2) assert arr.dtype == arr2.dtype def test_bulk_importer_ndarray(repo): from hangar.bulk_importer import run_bulk_import from hangar.bulk_importer import UDF_Return def...
1
0
0
0
1
0
code/generic/policies.py
ElliotMunro200/reinforcement_learning_an_introduction
234
147069
<filename>code/generic/policies.py<gh_stars>100-1000 #!/usr/bin/env python """ -------------------------------- project: code created: 26/06/2018 17:26 --------------------------------- """ from collections import defaultdict import numpy as np from generic.utils import choose_from def greedy(state_action_values):...
0
0
0
0
0
0
nn_pruning/tests/test_patch.py
ebell495/nn_pruning
250
147074
import unittest from unittest import TestCase from transformers import BertConfig, BertForQuestionAnswering from nn_pruning.model_structure import BertStructure from nn_pruning.modules.masked_nn import ( ChannelPruningModulePatcher, JointPruningModulePatcher, LinearPruningArgs, LinearPruningModulePatc...
0
0
0
0
0
0
test/test_vectors/generators/01_radar.py
ZJUGuoShuai/MatX
280
147080
<filename>test/test_vectors/generators/01_radar.py #!/usr/bin/env python3 import numpy as np from scipy import signal from scipy import io from numpy import random import math import os import matx_common import cupy as cp from typing import Dict, List class simple_pipeline: def __init__(self, dtype: str, size: ...
0
0
0
0
0
0
data_validation/jellyfish_distance.py
ajw0100/professional-services-data-validator
167
147098
<gh_stars>100-1000 # 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-2.0 # # Unless required by applicable law or agr...
0
0
0
0
0
0
tests/daemon_chdir.py
santosh653/daemonize
377
147126
#!/usr/bin/env python from sys import argv from daemonize import Daemonize pid = argv[1] working_dir = argv[2] file_name = argv[3] def main(): with open(file_name, "w") as f: f.write("test") daemon = Daemonize(app="test_app", pid=pid, action=main, chdir=working_dir) daemon.start()
0
0
0
0
0
0
project/tests/helpers.py
InStateTeam/virtual-identities
267
147128
<gh_stars>100-1000 # project/tests/helpers.py
0
0
0
0
0
0
tests/test_elements/test_ui_horizontal_scroll_bar.py
glipR/pygame_gui
339
147152
import os import pytest import pygame from tests.shared_fixtures import _init_pygame, default_ui_manager from tests.shared_fixtures import default_display_surface, _display_surface_return_none from tests.shared_comparators import compare_surfaces from pygame_gui.ui_manager import UIManager from pygame_gui.elements.ui...
7
0
0
0
7
0
osrc/asyncdl.py
dmessing/osrc
279
147153
<filename>osrc/asyncdl.py # -*- coding: utf-8 -*- __all__ = ["Downloader"] from functools import partial from tornado import ioloop from tornado import httpclient class Downloader(object): def download(self, urls, **kwargs): self.urls = urls self.errors = [] self.results = [] ...
0
0
0
0
0
0
tests/test_compiler_builtins.py
Ivanovitchk/EasyClangComplete
648
147169
"""Tests for CompilerBuiltIns class.""" import imp from unittest import TestCase from EasyClangComplete.plugin.flags_sources import compiler_builtins imp.reload(compiler_builtins) CompilerBuiltIns = compiler_builtins.CompilerBuiltIns class TestFlag(TestCase): """Test getting built in flags from a target compil...
0
0
0
0
0
0
babble/utils.py
rit-git/vanilla-snorkel
130
147172
from __future__ import annotations from collections import Counter, defaultdict import csv import json import os import random import sys from time import time from metal.contrib.info_extraction.mentions import RelationMention from metal.contrib.info_extraction.utils import mark_entities import numpy as np import torc...
4
4
0
2
10
0