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
src/IronPythonWrapper/InferNetExamples/InferNetExamples/TwoCoins.py
ThePiranha/infer
1,416
1724137
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the MIT license. # See the LICENSE file in the project root for more information. #----------------------------------------------------------------------------------- # Infer.NET IronPython example: Two...
0
0
0
0
0
0
src/web/cookies.py
anderson-attilio/runbook
155
1724173
###################################################################### # Cloud Routes Web Application # ------------------------------------------------------------------- # Cookies Class ###################################################################### from __future__ import annotations from itsdangerous import ...
0
2
0
0
2
0
PG/7-PPO/model.py
g6ling/Pytorch-Cartpole
116
1724184
<reponame>g6ling/Pytorch-Cartpole import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import random from memory import BatchMaker from config import gamma, lambda_gae, epsilon_clip, ciritic_coefficient, entropy_coefficient, epoch_k, batch_size import warnings class PPO(nn.Module): ...
0
0
0
0
0
0
vakt/__init__.py
chuxuantinh/vakt
132
1724235
<gh_stars>100-1000 """ Vakt is an SDK for access policies. """ import logging ########################### # Public API Imports # ########################### from .version import version_info, __version__ from .policy import Policy, PolicyDeny, PolicyAllow from .guard import ( Inquiry, Guard, ) from ....
0
0
0
0
0
0
extensions/RichardHe.you-complete-me-1.0.36/ycmd/ycmd/completers/typescript/typescript_completer.py
Sunshengjin/RoboWare-Studio
239
1724239
#!/usr/bin/env python # # Copyright (C) 2015 Google Inc. # # This file is part of YouCompleteMe. # # YouCompleteMe is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your...
2
13
0
1
16
0
tests/test_draw.py
ablavatski/draw
396
1724273
<reponame>ablavatski/draw import unittest from blocks.bricks.recurrent import SimpleRecurrent, LSTM from blocks.initialization import Constant, IsotropicGaussian, Orthogonal from draw.draw import * # class TestDRAW(unittest.TestCase): def setUp(self): n_iter = 2 x_dim = 8 z_dim = 10 ...
0
0
0
0
0
0
notebook/seaborn_pairplot.py
vhn0912/python-snippets
174
1724284
# %matplotlib inline import pandas as pd import seaborn as sns df = pd.read_csv('data/src/iris.csv', index_col=0) # df = sns.load_dataset("iris") print(df.head()) # sepal_length sepal_width petal_length petal_width species # 0 5.1 3.5 1.4 0.2 setosa # 1 4.9 ...
0
0
0
0
0
0
train/train.py
chineseocr/table-detect
152
1724291
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Sep 9 23:11:51 2020 @author: chineseocr """ import sys sys.path.append('.') from table_line import model from tensorflow.keras.optimizers import Adam from tensorflow.keras.callbacks import ModelCheckpoint, ReduceLROnPlateau from sklearn.model_selection...
0
0
0
0
0
0
tests/unit/util/test_compat.py
jahodfra/datadogpy
520
1724293
# coding: utf8 # Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2015-Present Datadog, Inc import logging import unittest from mock import patch from datadog.uti...
0
4
0
0
4
0
analysis/util/h5comp.py
leozz37/makani
1,178
1724295
# Copyright 2020 Makani Technologies 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 agreed to...
0
0
0
0
0
0
socket/basic-UDP/main.py
whitmans-max/python-examples
140
1724360
#!/usr/bin/env python3 # # you can test with `netcat` as client with `-u` for UDP # # $ nc -u localhost 3000 # import socket s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.bind(('127.0.0.1', 3000)) while True: data, address = s.recvfrom(1024) print(data.decode('ascii'), end='') s.sendto(data, a...
0
0
0
0
0
0
tests/acceptance/pam/steps/when_steps.py
natekspencer/pubnub-python
146
1724385
<reponame>natekspencer/pubnub-python import json from behave import when import pubnub from pubnub.exceptions import PubNubException def execute_pam_call(context): context.grant_result = context.peer.grant_token().channels( list(context.resources_to_grant["CHANNEL"].values()) ).groups( list(c...
0
0
0
0
0
0
tests/semantics.py
anhnamtran/cozy
188
1724410
<filename>tests/semantics.py<gh_stars>100-1000 import unittest from cozy.target_syntax import * from cozy.syntax_tools import mk_lambda, pprint, fresh_var, free_vars, alpha_equivalent from cozy.typecheck import retypecheck from cozy.solver import satisfy, valid from cozy.evaluation import eval, construct_value from co...
0
0
0
0
0
0
cooka/test/run_test_train_job.py
highboo52na/Cooka
222
1724415
# -*- encoding: utf-8 -*- from cooka.core.analyzer import PandasAnalyzer from cooka.common.model import TrainJobConf, FrameworkType, ExperimentConf, TrainValidationHoldout from cooka.common.model import TaskType, SampleConf from hypernets.core.searcher import OptimizeDirection class TestTrainJob: def _make_train...
0
1
0
0
1
0
maya/Tests/animPointPrimitive_test.py
ryu-sw/alembic
921
1724422
<gh_stars>100-1000 ##-***************************************************************************** ## ## Copyright (c) 2009-2011, ## <NAME> Imageworks, Inc. and ## Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. ## ## All rights reserved. ## ## Redistribution and use in source and binary...
0
0
0
0
0
0
scripts/automation/trex_control_plane/examples/trex_root_path.py
timgates42/trex-core
956
1724435
#!/router/bin/python import os import sys def add_root_to_path () -> None: """adds trex_control_plane root dir to script path, up to `depth` parent dirs""" root_dirname = 'trex_control_plane' file_path = os.path.dirname(os.path.realpath(__file__)) components = file_path.split(os.sep) ...
0
1
0
0
1
0
test/test_raw-ip-vhost.py
farrar142/nginx-proxy
12,930
1724459
<filename>test/test_raw-ip-vhost.py import pytest def test_raw_ipv4_vhost_forwards_to_web1(docker_compose, nginxproxy): r = nginxproxy.get("http://172.20.0.4") assert r.status_code == 200 web1_container = docker_compose.containers.get("web1") assert r.text == f"I'm {web1_container.id[:12]}\n" def te...
0
0
0
0
0
0
rltime/exploration/__init__.py
frederikschubert/rltime
147
1724468
<reponame>frederikschubert/rltime<gh_stars>100-1000 from .epsilon_greedy import EpsilonGreedyExplorationManager def get_types(): return { "epsilon_greedy": EpsilonGreedyExplorationManager, }
0
0
0
0
0
0
manga_py/default_config/actions.py
sonvt1710/manga-py
337
1724480
from toml import load, dump from . import DefaultConfig, CONFIG_FILE def load_config() -> DefaultConfig: if not CONFIG_FILE.is_file(): return DefaultConfig() with CONFIG_FILE.open('r') as r: data = load(r) return DefaultConfig(data.get('default', {})) def dump_config(config: Default...
1
1
0
0
2
0
OmniMarkupLib/Renderers/TextileRenderer.py
henumohe/OmniMarkupPreviewer
476
1724489
<gh_stars>100-1000 from .base_renderer import * import textile @renderer class TextileRenderer(MarkupRenderer): @classmethod def is_enabled(cls, filename, syntax): if syntax == 'text.html.textile': return True return filename.endswith(".textile") def render(self, text, **kwarg...
0
0
0
0
0
0
wotan/slide_clipper.py
danielrios12/Wotan---filtro-de-dados
118
1724531
from __future__ import annotations import numpy as np def clipit(data, low, high, method, center) -> object: """Clips data in the current segment""" # For the center point, take the median (if center_code==0), else the mean if center == 'mad': mid = np.nanmedian(data) else: mid = np.n...
4
2
0
0
6
0
plugins/goalert/alerta_goalert.py
sainivinit/alerta-contrib
114
1724547
<reponame>sainivinit/alerta-contrib import logging import os import re import requests try: from alerta.plugins import app # alerta >= 5.0 except ImportError: from alerta.app import app # alerta < 5.0 from alerta.plugins import PluginBase LOG = logging.getLogger('alerta.plugins.goalert') LOG.info('Initializ...
0
0
0
0
0
0
dataset/__init__.py
jmelm93/MLTS
117
1724579
<filename>dataset/__init__.py from torchtext import * from dataset.bert_ds import load_bert_df from dataset.pandas_ds import load_pandas
0
0
0
0
0
0
utils/wfuzzbasicauthbrute/wfuzz/framework/fuzzer/fuzzobjects.py
ismailbozkurt/kubebot
171
1724581
import types import time import hashlib import re from urlparse import urljoin from threading import Lock from externals.reqresp import Request from framework.core.myexception import FuzzException from framework.fuzzer.base import BaseFuzzRequest class FuzzRequest(BaseFuzzRequest, Request): def __init__(self): R...
0
0
0
0
0
0
eth/vm/forks/homestead/opcodes.py
ggs134/py-evm
1,641
1724583
<reponame>ggs134/py-evm<gh_stars>1000+ import copy from typing import Dict from eth_utils.toolz import merge from eth import constants from eth.abc import OpcodeAPI from eth.vm import mnemonics from eth.vm import opcode_values from eth.vm.logic import ( call, ) from eth.vm.forks.frontier.opcodes import FRONTIER_...
0
0
0
0
0
0
Algorithms/Greedy Algorithm/Activity_Selection_Problem.py
strangestroad/interview-techdev-guide
320
1724590
<gh_stars>100-1000 '''in this problem we have to find the maximum number of activities a single person can perform that too one acivity at a time we are given with the start and finish times of each activity let s[] denote start time for different activities and f[] denote fininsh time for those activities we can hav...
0
0
0
0
0
0
environment_kernels/envs_conda.py
Cadair/jupyter_conda_kernels
150
1724606
<filename>environment_kernels/envs_conda.py # -*- coding: utf-8 -*- """Functions related to finding conda environments (both Python and R based)""" from __future__ import absolute_import from .activate_helper import source_env_vars_from_command from .envs_common import (find_env_paths_in_basedirs, convert_to_env_data,...
0
0
0
0
0
0
paraphraser/__init__.py
mahmoudeid789/paraphraser
371
1724608
from .synonym_model import synonym_paraphrase
0
0
0
0
0
0
test/utils.py
melanj/nemu
155
1724627
import os import uuid import time import shutil import subprocess class Nemu(): def __init__(self): self.uuid = uuid.uuid4().hex self.test_dir = "/tmp/" + self.uuid self.pidfile = self.test_dir + "/nemu.pid" os.mkdir(self.test_dir) with open(self.test_dir + "/nemu.cfg", 'w'...
1
8
0
0
9
0
openbox/artifact/user_board/apps.py
Dee-Why/lite-bo
184
1724638
<reponame>Dee-Why/lite-bo<gh_stars>100-1000 # License: MIT from django.apps import AppConfig class UserBoardConfig(AppConfig): name = 'user_board'
0
0
0
0
0
0
test/testcases/px/test_phisto.py
Lilith5th/Radiance
154
1724649
<reponame>Lilith5th/Radiance<filename>test/testcases/px/test_phisto.py # -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals import os import unittest import testsupport as ts from pyradlib import lcompare from pyradlib.pyrad_proc import PIPE, Error, ProcMixin class PhistoTestCas...
0
0
0
0
0
0
dev/Gems/EditorPythonBindings/Code/Tests/EditorPythonBindingsTest.py
brianherrera/lumberyard
1,738
1724684
# # testing Python code # import sys print ('EditorPythonBindingsTest_RunScriptFile')
0
0
0
0
0
0
NARF/models/nerf_model.py
liruilong940607/NARF
105
1724775
<reponame>liruilong940607/NARF import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.checkpoint from .activation import MyReLU from .bone_utils import get_canonical_pose from .stylegan import EqualLinear, EqualConv1d, NormalizedConv1d from .model_utils import in_cube ...
0
0
0
0
0
0
tests/test_progress_board.py
stjordanis/Hyperactive
382
1724780
import os import numpy as np import pandas as pd from hyperactive import Hyperactive from hyperactive.dashboards import ProgressBoard from hyperactive.dashboards.progress_board.streamlit_backend import StreamlitBackend from hyperactive.dashboards.progress_board.progress_io import ProgressIO def test_progress_io_0(): ...
0
6
0
0
6
0
aetros/__main__.py
aetros/aetros-cli
120
1724826
import sys import aetros if __name__ == '__main__': sys.exit(aetros.main())
0
0
0
0
0
0
Topological Sorting.py
RijuDasgupta9116/LintCode
321
1724834
from __future__ import annotations """ Given an directed graph, a topological order of the graph nodes is defined as follow: For each directed edge A-->B in graph, A must before B in the order list. The first node in the order can be any node in the graph with no nodes direct to it. Find any topological order for the ...
0
4
0
1
5
0
spnlib/spn/functions/SPG.py
yuly16/detection
228
1724858
<gh_stars>100-1000 # functions/add.py import re import torch from torch.autograd import Function from .._ext import libspn class FunctionBackend(object): def __init__(self, lib): self.backends = dict() self.parse_lib(lib) self.current_backend = None def __getattr__(self, name): ...
0
0
0
0
0
0
ML/TensorFlow/Basics/tutorial18-customdata-images/1_in_subfolders.py
xuyannus/Machine-Learning-Collection
3,094
1724864
<gh_stars>1000+ # Imports needed import os os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2" import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from tensorflow.keras.preprocessing.image import ImageDataGenerator img_height = 28 img_width = 28 batch_size = 2 model = keras.Sequential( ...
0
0
0
0
0
0
dbaas/api/tests/test_taskhistory_serializer.py
didindinn/database-as-a-service
303
1724885
<reponame>didindinn/database-as-a-service from mock import patch from unittest import TestCase from api.task import TaskSerializer from logical.models import Database, DatabaseHistory from logical.tests.factory import DatabaseFactory, DatabaseHistoryFactory class GetDatabaseTestCase(TestCase): def setUp(self): ...
0
0
0
0
0
0
applications/tensorflow2/image_classification/test/test_custom_wandb_callbacks.py
payoto/graphcore_examples
260
1724902
# Copyright (c) 2021 Graphcore Ltd. All rights reserved. import unittest from pathlib import Path import sys import tensorflow as tf sys.path.append(str(Path(__file__).absolute().parent.parent)) from callbacks.custom_wandb_callback import CustomWandbCallback from custom_exceptions import MissingArgumentException cla...
0
0
0
0
0
1
xalpha/provider.py
kaharjan/xalpha
1,198
1724904
# -*- coding: utf-8 -*- from __future__ import annotations """ codebase related to data API provider which require further authetications """ import os import sys from functools import wraps from base64 import b64decode, b64encode try: from jqdatasdk import auth jq_source = True except ImportError: jq_so...
5
5
0
0
10
0
wolframclient/serializers/wxfencoder/serializer.py
jldohmann/WolframClientForPython
358
1724924
from __future__ import annotations from __future__ import absolute_import, print_function, unicode_literals from wolframclient.serializers.wxfencoder.constants import ( WXF_HEADER_COMPRESS, WXF_HEADER_SEPARATOR, WXF_VERSION, ) from wolframclient.serializers.wxfencoder.streaming import ZipCompressedWriter ...
4
7
0
4
15
0
qutip/tests/test_mkl.py
camponogaraviera/qutip
1,205
1724961
<reponame>camponogaraviera/qutip import pytest import numpy as np import scipy.linalg import scipy.sparse import qutip if qutip.settings.has_mkl: from qutip._mkl.spsolve import mkl_splu, mkl_spsolve pytestmark = [ pytest.mark.skipif(not qutip.settings.has_mkl, reason='MKL extensions not...
0
0
0
0
0
0
dowhy/gcm/__init__.py
Microsoft/dowhy
840
1724975
"""The gcm sub-package provides features built on top of graphical causal model (GCM) based inference. The status of this addition and its API is considered experimental, meaning there might be breaking changes to its API in the future. """ from .cms import ProbabilisticCausalModel, StructuralCausalModel, FunctionalCa...
0
0
0
0
0
0
style_soft_intro_vae/dataset_preparation/dataset_tool.py
BossunWang/soft-intro-vae-pytorch
144
1724995
# Copyright (c) 2019, <NAME>. All rights reserved. # # This work is licensed under the Creative Commons Attribution-NonCommercial # 4.0 International License. To view a copy of this license, visit # http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to # Creative Commons, PO Box 1866, Mountain View, CA 940...
0
0
0
0
0
0
mindsdb/api/mysql/mysql_proxy/data_types/mysql_packets/stmt_prepare_header.py
yarenty/mindsdb
261
1724999
""" ******************************************************* * Copyright (C) 2017 MindsDB Inc. <<EMAIL>> * * This file is part of MindsDB Server. * * MindsDB Server can not be copied and/or distributed without the express * permission of MindsDB Inc ******************************************************* """ fr...
0
1
0
0
1
0
sphinx/doc_examples/block_diag_hamiltonian-example.py
anton-buyskikh/QuSpin
195
1725028
from __future__ import print_function, division # import sys,os quspin_path = os.path.join(os.getcwd(),"../../") sys.path.insert(0,quspin_path) # from quspin.operators import hamiltonian # Hamiltonians and operators from quspin.basis import boson_basis_1d # Hilbert space fermion basis from quspin.tools.block_tools impo...
0
0
0
0
0
0
openbook_circles/migrations/0008_auto_20190401_2036.py
TamaraAbells/okuna-api
164
1725064
<filename>openbook_circles/migrations/0008_auto_20190401_2036.py # Generated by Django 2.2b1 on 2019-04-01 18:36 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('openbook_circles', '0007_auto_20190401_0006'), ] operations = [ migrations....
0
0
0
0
0
0
testkit/unittests.py
glesage/neo4j-python-driver
739
1725130
import subprocess def run(args): subprocess.run( args, universal_newlines=True, stderr=subprocess.STDOUT, check=True) if __name__ == "__main__": run([ "python", "-m", "tox", "-c", "tox-unit.ini"])
0
0
0
0
0
0
Geometry/HGCalGeometry/python/HGCalGeometryDBWriter_cfi.py
ckamtsikis/cmssw
852
1725131
import FWCore.ParameterSet.Config as cms HGCalEEGeometryESProducer = cms.ESProducer("HGCalGeometryESProducer", ##appendToDataLabel = cms.string("_master"), Name = cms.untracked.string("HGCalEESensitive"), ...
0
0
0
0
0
0
sketchgraphs/pipeline/make_sketch_dataset.py
applied-exploration/contraint-based-parametric-modelling
204
1725162
from __future__ import annotations """This script is responsible for creating the main sketch dataset from the JSON files. Some basic filtering is applied in order to exclude empty sketches. However, as this dataset is intended to capture the original data, further filtering is left to scripts such as `sketchgraphs.pi...
2
5
0
0
7
0
python/tinyflow/_ops.py
chakpongchung/tinyflow
2,035
1725172
<reponame>chakpongchung/tinyflow """Wrapping of certain ops for positional arguments. Mainly because NNVM accepts kwargs for some additional arguments, while TF sometimes support positional ops. """ from __future__ import absolute_import as _abs from nnvm import symbol from nnvm import _symbol_internal def argmax(x,...
0
0
0
0
0
0
fooof/plts/__init__.py
dieloz/fooof
154
1725234
"""Plots sub-module for FOOOF.""" from .spectra import plot_spectra from .spectra import plot_spectra as plot_spectrum
0
0
0
0
0
0
src/connectors/meraki_devices.py
sfc-gh-kmaurya/SnowAlert
144
1725236
<gh_stars>100-1000 """Meraki Devices Collect Meraki Device information using an API Token """ from runners.helpers import log from runners.helpers import db from runners.helpers.dbconfig import ROLE as SA_ROLE from datetime import datetime import requests from urllib.error import HTTPError from .utils import yaml_du...
0
0
0
0
0
0
lldb_quick_look.py
ryanolsonk/LLDB-QuickLook
212
1725240
<filename>lldb_quick_look.py # The MIT License (MIT) # Copyright (c) 2013 <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...
0
0
0
0
0
0
devtools/github_issues.py
Schweinepriester/oil
2,209
1725247
<filename>devtools/github_issues.py #!/usr/bin/env python2 """ github_issues.py """ from __future__ import print_function import cgi import json import sys def main(argv): # - .number # - .title # - .html_url # # And then format as HTML. issues = json.load(sys.stdin) for issue in issues: # dict d...
0
0
0
0
0
0
contrib/performance/sqlusage/requests/put.py
backwardn/ccs-calendarserver
462
1725248
<gh_stars>100-1000 ## # Copyright (c) 2012-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 requi...
0
0
0
0
0
0
scripts/support/arc4random.py
musaic/osx-vm-templates
952
1725313
from __future__ import annotations '''py-arc4random Basic python 2.7/3 implementation of OpenBSDs arc4random PRNG. https://github.com/rolandshoemaker/py-arc4random Examples >>> import arc4random >>> arc4random.rand() 2057591911 >>> arc4random.randrange(50,100) 75 >>> arc4random.randsample(0,1, 10) [1, 1, 0, 1, 1, 0,...
1
5
0
0
6
0
stochastic/processes/diffusion/ornstein_uhlenbeck.py
zaczw/stochastic
268
1725349
from __future__ import annotations """Ornstein-Uhlenbeck process.""" from stochastic.processes.diffusion.vasicek import VasicekProcess class OrnsteinUhlenbeckProcess(VasicekProcess): r"""Ornstein-Uhlenbeck process. .. image:: _static/ornstein_uhlenbeck_process.png :scale: 50% The process :math:`...
4
2
0
0
6
0
commands/defaultlimit.py
nstra111/autovc
177
1725358
<filename>commands/defaultlimit.py import utils import functions as func from commands.base import Cmd help_text = [ [ ("Usage:", "<PREFIX><COMMAND> `N`"), ("Description:", "Set the default user limit for channels created by a particular primary channel, " "without editing the pri...
0
0
0
0
0
0
causallib/preprocessing/transformers.py
liranszlak/causallib
350
1725384
from __future__ import annotations """ (C) Copyright 2019 IBM Corp. 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...
17
17
0
0
34
0
lvsr/main.py
Fatman003/Actor
178
1725387
from __future__ import print_function import time import logging import pprint import math import os import re import cPickle as pickle import sys import yaml import copy from collections import OrderedDict import numpy from lvsr.algorithms import BurnIn from blocks_extras.extensions.embed_ipython import EmbedIPython ...
0
0
0
0
0
0
python/CLOUDFRONT_VIEWER_POLICY_HTTPS/CLOUDFRONT_VIEWER_POLICY_HTTPS_test.py
docebo/aws-config-rules
1,295
1725418
<reponame>docebo/aws-config-rules<filename>python/CLOUDFRONT_VIEWER_POLICY_HTTPS/CLOUDFRONT_VIEWER_POLICY_HTTPS_test.py import json import sys import unittest try: from unittest.mock import MagicMock except ImportError: from mock import MagicMock import botocore ############## # Parameters # ############## # ...
0
0
0
0
0
0
x86devirt_jmp.py
JeremyWildsmith/x86devirt
112
1725505
import angr possibleJmps = [ { "name": "jz", "must": [0x40], "not": [0x1, 0], "priority": 1 }, { "name": "jo", "must": [0x800], "not": [0], "priority": 1 }, { "name": "jno", "must": [0x40], "not": [0x800], ...
0
2
0
0
2
0
tests/management/test_runner.py
tranarthur/localshop
162
1725515
<filename>tests/management/test_runner.py from localshop.runner import main def test_main(monkeypatch): from django.core import management def mock_exec(args): return monkeypatch.setattr(management, 'execute_from_command_line', mock_exec) main()
0
0
0
0
0
0
Python/decompress/simple.py
saneravi/ML_Stuff
209
1725526
from typing import Any, List def second_pass(tokens: List[Any]) -> List[Any]: """ Examples -------- >>> second_pass([3, "[", "abc", "]", 4, "[", "ab", "]", "c"]) [3, ['abc'], 4, ['ab'], 'c'] >>> second_pass([10, '[', 'a', ']']) [10, ['a']] >>> second_pass([3, '[', 2, '[', 'a', ']']) ...
1
1
0
0
2
0
scaled_mnist/archs.py
gist-ailab/pytorch-deform-conv-v2
561
1725531
<reponame>gist-ailab/pytorch-deform-conv-v2 # -*- coding: utf-8 -*- import numpy as np from torch import nn from torch.nn import functional as F import torch from torchvision import models import torchvision from deform_conv_v2 import * class ScaledMNISTNet(nn.Module): def __init__(self, args, num_classes): ...
0
0
0
0
0
0
annotated-py-flask-master/flask-0.5/flask/wrappers.py
caoziyao/yflask
315
1725540
# -*- coding: utf-8 -*- """ flask.wrappers ~~~~~~~~~~~~~~ Implements the WSGI wrappers (request and response). :copyright: (c) 2010 by <NAME>. :license: BSD, see LICENSE for more details. """ # 说明: # - 最新版本的 werkzeug 模块组织结构发生改变, 改为上面的导包路径 # - 故注释掉下一行的旧版本的导包路径 # #from werkzeug import Request ...
0
2
4
0
6
0
fhir/resources/tests/test_patient.py
cstoltze/fhir.resources
144
1725549
# -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Patient Release: R4 Version: 4.0.1 Build ID: 9346c8cc45 Last updated: 2019-11-01T09:29:23.356+11:00 """ from pydantic.validators import bytes_validator # noqa: F401 from .. import fhirtypes # noqa: F401 from .. import patient def impl_pat...
0
0
0
0
0
0
setup_empty.py
smaranjitghose/DeepRobust
647
1725603
<filename>setup_empty.py from setuptools import setup from setuptools import find_packages setup(name = "deeprobust", version = "0", description = "A pytorch library for adversarial robustness learning.", packages = find_packages(), )
0
0
0
0
0
0
parmesan/layers/normalize.py
Jungiebumper/parmesan
238
1725655
<filename>parmesan/layers/normalize.py import lasagne import theano.tensor as T import theano import numpy as np class NormalizeLayer(lasagne.layers.Layer): def __init__(self, incoming, axes=None, epsilon=1e-10, alpha='single_pass', return_stats=False, stat_indices=None, **kwarg...
0
0
0
0
0
0
src/ResNet/CASIA_WEB_FACE.PyTorch/calculate_image_mean.py
willyspinner/High-Performance-Face-Recognition
300
1725679
<filename>src/ResNet/CASIA_WEB_FACE.PyTorch/calculate_image_mean.py import os import torch import torchvision import torch.utils.data import torchvision.transforms as transforms import torchvision.datasets as datasets import yaml import tqdm here = os.path.dirname(os.path.abspath(__file__)) # output folder is located...
0
0
0
0
0
0
tests/test_spiders.py
Lemon2go/ProxyPool
359
1725707
<reponame>Lemon2go/ProxyPool from proxypool.spiders import * from proxypool.errors import RewriteSpiderError import unittest class SpiderTestCase(unittest.TestCase): def test_new(self): try: class TestSpider(metaclass=SpiderMeta): def gets(self): pass ...
0
0
0
0
0
0
textpipe/wrappers.py
KGBicheno/textpipe
316
1725722
<reponame>KGBicheno/textpipe<filename>textpipe/wrappers.py<gh_stars>100-1000 """ Wrappers around classes of external libraries used in Doc class. """ import pickle from functools import lru_cache from urllib.parse import urlparse import numpy as np from gensim.models.keyedvectors import KeyedVectors from redis import...
0
0
0
0
0
0
benchmarks/skimage/cucim_color_bench.py
aasthajh/cucim
131
1725753
<filename>benchmarks/skimage/cucim_color_bench.py import os import pickle import cucim.skimage import cucim.skimage.color import cupy import cupy as cp import cupyx.scipy.ndimage import numpy as np import pandas as pd import scipy import skimage import skimage.color from _image_bench import ImageBench class ColorBe...
0
0
0
0
0
0
src/nameless/__init__.py
ionelmc/python-nameless
121
1725808
__version__ = '0.1.0' try: from ._nameless import longest # noqa except ImportError: def longest(args) -> object: return max(args, key=len)
0
1
0
0
1
0
parsl/tests/test_error_handling/test_python_walltime.py
cylondata/parsl
323
1725819
<reponame>cylondata/parsl import pytest import parsl from parsl.app.errors import AppTimeout @parsl.python_app def my_app(walltime=1): import time time.sleep(1.2) return True def test_python_walltime(): f = my_app() with pytest.raises(AppTimeout): f.result() def test_python_longer_wal...
0
0
0
0
0
0
test.py
BUPTDM/OpenHNE
144
1725826
<filename>test.py<gh_stars>100-1000 import scipy.io as scio import numpy as np from sklearn.cluster import KMeans from sklearn.metrics import normalized_mutual_info_score, adjusted_rand_score from sklearn.metrics import f1_score, accuracy_score, roc_auc_score from sklearn.model_selection import train_test_split from sk...
0
0
0
0
0
0
koila/interfaces/components/meminfo.py
dumpmemory/koila
1,620
1725829
from typing import Protocol from .datatypes import DataType from .multidim import MultiDimensional class MemoryInfo(MultiDimensional, DataType, Protocol): """ `MemoryInfo` contains all information needed to compute a tensor's memory usage. `MultiDimensional` is used to compute the number of elements, ...
0
0
0
0
0
0
software/tests/test_bootloader.py
mjaskula/EuroPi
104
1725840
<reponame>mjaskula/EuroPi import pytest from bootloader import BootloaderMenu from europi_script import EuroPiScript class GoodTestScript1(EuroPiScript): pass class GoodTestScript2(EuroPiScript): pass class BadTestScript: pass @pytest.mark.parametrize( "cls, expected", [ (GoodTestSc...
0
0
0
0
0
0
goatools/gosubdag/plot/plot.py
flying-sheep/goatools
477
1725866
"""Plot a GoSubDag. GO Terms in a plot contain text. The first two lines appear by default: GO:0015618 L07 D13 p2 c2 d3 potassium-transporting ATPase activity GO:0015618 => GO ID First line: LNN => The "level" of the go term. The length of the shortest path(s) fr...
0
1
0
0
1
0
anchore/anchore-modules/gates/98_anchoresec.py
berez23/anchore
401
1725882
#!/usr/bin/env python import sys import json import time import anchore.anchore_utils gate_name = "ANCHORESEC" triggers = { 'VULNLOW': { 'description':'triggers if a vulnerability of LOW severity is found', 'params':'none' }, 'VULNMEDIUM': { 'description':'triggers if a vu...
0
0
0
0
0
0
misc/pytorch_toolkit/machine_translation/core/models/modules/transformer_encoder.py
dqawami/openvino_training_extensions
256
1725884
from __future__ import annotations """ Copyright (c) 2020 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 ap...
11
3
0
0
14
0
tests/perf/tests.py
KOLANICH/parglare
102
1725885
<gh_stars>100-1000 from collections import namedtuple Test = namedtuple('Test', 'name lr glr') TESTS = [ # Name, LR, GLR Test('JSON', True, True), Test('BibTeX', True, True), Test('Java', False, True) ]
0
0
0
0
0
0
examples/parallax.py
salt-die/nurses_2
171
1725895
import asyncio from pathlib import Path import numpy as np from nurses_2.app import App from nurses_2.widgets.image import Image from nurses_2.widgets.parallax import Parallax IMAGES_DIR = Path("images") SIZE = 30, 50 def load_layers(path) -> object: sorted_dir = sorted(path.iterdir(), key=lambda path: path.ste...
0
1
0
0
1
0
nlt/util/net.py
isabella232/neural-light-transport
176
1725936
<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/test_prog_name.py
madkinsz/typer
7,615
1725949
import subprocess from pathlib import Path def test_custom_prog_name(): file_path = Path(__file__).parent / "assets/prog_name.py" result = subprocess.run( ["coverage", "run", str(file_path), "--help"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="utf-8", ) ...
0
0
0
0
0
0
textclf/models/classifier/components.py
lswjkllc/textclf
146
1725967
from __future__ import annotations import torch import torch.nn as nn from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence import torch.nn.functional as F from textclf.config.components import RNNConfig class RNN(torch.nn.Module): """ rnn layer """ supported_types: list[str] = ["R...
4
2
1
0
7
0
zhihu_user_info_spider/zhihu_user_info_spider/Exception/SpiderException.py
Yourrrrlove/spider_collection
178
1726036
<gh_stars>100-1000 # -*- coding:utf-8 -*- class SpiderException(Exception): def __init__(self, message: str): pass
0
0
0
0
0
0
test/distributed/elastic/multiprocessing/bin/echo3.py
Hacky-DH/pytorch
60,067
1726065
#!/usr/bin/env python3 # 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. import argparse import ctypes import os if __name__ == "__main__": parser = argpars...
0
0
0
0
0
0
models/domainattention/domain_attention_unsupervised.py
siavash-khodadadeh/MetaLearning-TF2.0
102
1726125
<filename>models/domainattention/domain_attention_unsupervised.py import tensorflow as tf from databases import MiniImagenetDatabase, AirplaneDatabase, CUBDatabase, OmniglotDatabase, DTDDatabase, \ FungiDatabase, VGGFlowerDatabase, EuroSatDatabase from models.crossdomain.cdml import CombinedCrossDomainMetaLearning...
0
0
0
0
0
0
nova/tests/unit/virt/vmwareapi/test_vif.py
zjzh/nova
1,874
1726191
# Copyright 2013 Canonical Corp. # 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 ...
0
0
0
0
0
0
src/core/toga/sources/__init__.py
luizoti/toga
1,261
1726201
from .accessors import to_accessor # noqa: F401 from .base import Source # noqa: F401 from .list_source import ListSource # noqa: F401 from .tree_source import TreeSource # noqa: F401 from .value_source import ValueSource # noqa: F401
0
0
0
0
0
0
pytorch_pfn_extras/config.py
kmaehashi/pytorch-pfn-extras
243
1726212
import json import os from typing import Any, Callable, Dict, Optional, Tuple, Union import reprlib ConfigKey = Tuple[Union[str, int], ...] AttrKey = Tuple[Union[str, int], ...] KeyPair = Tuple[ConfigKey, Optional[AttrKey]] ConfigType = Any Loader = Callable[[str], Any] DumpTrace = Tuple[KeyPair, ...] LoadTrace = Tup...
0
0
0
0
0
1
zippy/benchmarks/src/benchmarks/python-graph/tests/unittests-filters.py
lucapele/pele-c
319
1726244
<reponame>lucapele/pele-c<filename>zippy/benchmarks/src/benchmarks/python-graph/tests/unittests-filters.py # Copyright (c) <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to deal in the Software w...
0
0
0
0
0
0
quantmod/theming/palettes.py
EfimovIN/dash-technical-charting
129
1726303
"""RGBA color palettes Used to dynamically link to theme colors rather than rely on hardcoding of greyscale traces. For readability, files under theming do not follow PEP8 guideline of no space between assignment of named arguments. """ # flake8: noqa # Palette for lighter themes LIGHT_PALETTE = dict( white = '...
0
0
0
0
0
0
src/platforms/redhat.py
decidedlygray/ptf
4,391
1726307
# future home for redhat updates and handling rpm
0
0
0
0
0
0
python/mesh/generic/dijkstra.py
MinesJA/meshNetwork
133
1726325
from __future__ import annotations from copy import deepcopy from mesh.generic.nodeState import LinkStatus def findShortestPaths(numNodes, meshGraph, startNode) -> object: ## Find shortest path to all other nodes using Dijkstra's algorithm # Initialize arrays pathArray = [[i+1,100,[-1]] for i ...
0
2
0
0
2
0
WebMirror/management/rss_parser_funcs/feed_parse_extractAmeryEdge.py
fake-name/ReadableWebProxy
193
1726355
from __future__ import annotations def extractAmeryEdge(item) -> bool | object | None: """ # 'Amery Edge' """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol or frag) or 'preview' in item['title'].lower(): return None if 'Articles' in item['tags'] or 'Guides' in item...
0
1
0
0
1
0
src/utils.py
maiki/k3x
188
1726375
# utils.py # # MIT License # # Copyright (c) 2020 <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, cop...
17
13
2
0
32
0