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
DEPRECATED_PYTHON_SRC/component/_ui_win.py
17701253801/firefly-proxy
5,895
3289799
<gh_stars>1000+ # -*- coding: utf-8 -*- import os from lib.ipc import ActorProcess from lib.systray import SysTrayIcon from lib.utils import init_logging class UI(ActorProcess): def __init__(self, coordinator): super(UI, self).__init__() self.coordinator = coordinator def systray_qui...
0
0
0
0
0
0
pyqstrat/account.py
vishalbelsare/pyqstrat
284
3289803
<filename>pyqstrat/account.py from collections import defaultdict from sortedcontainers import SortedDict import math import pandas as pd import numpy as np from pyqstrat.pq_types import ContractGroup, Trade, Contract from types import SimpleNamespace from typing import Sequence, Any, Tuple, Callable, Union, MutableSet...
0
0
0
0
0
0
release/serve_tests/workloads/serve_micro_benchmark.py
linyiyue/ray
21,382
3289807
import asyncio import os from ray.serve.benchmarks.microbenchmark import main as benchmark_main from ray.serve.utils import logger from serve_test_cluster_utils import ( setup_local_single_node_cluster, setup_anyscale_cluster, ) from serve_test_utils import ( save_test_results, ) async def main(): # ...
0
0
0
0
0
0
google_or_tools/hidato_laurent.py
Wikunia/hakank
279
3289819
<filename>google_or_tools/hidato_laurent.py<gh_stars>100-1000 # Copyright 2010 Google # # 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...
0
0
0
0
0
0
src/python/nimbusml/internal/core/linear_model/onlinegradientdescentregressor.py
michaelgsharp/NimbusML
134
3289860
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -------------------------------------------------------------------------------------------- # - Generated by tools/entrypoint_co...
16
2
0
0
18
0
Python/libraries/recognizers-date-time/recognizers_date_time/date_time/base_timezone.py
AhmedLeithy/Recognizers-Text
688
3289879
<reponame>AhmedLeithy/Recognizers-Text # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import regex from typing import List, Pattern from abc import abstractmethod from datetime import datetime from .utilities import DateTimeOptionsConfiguration, DateTimeResolutionResult...
0
0
0
0
0
0
rlpy/Domains/BlocksWorld.py
okkhoy/rlpy
265
3289887
"""BlocksWorld domain, stacking of blocks to form a tower.""" from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from builtins import super from future import standard_library standard_library.install_aliases() from built...
4
14
6
2
26
0
model_code/grid_search/SVC.py
lacava/sklearn-benchmarks
213
3289904
<filename>model_code/grid_search/SVC.py import sys import pandas as pd import numpy as np import itertools from sklearn.preprocessing import RobustScaler from sklearn.svm import SVC from evaluate_model import evaluate_model dataset = sys.argv[1] pipeline_components = [RobustScaler, SVC] pipeline_parameters = {} C_va...
0
0
0
0
0
0
azure-iot-device/tests/provisioning/pipeline/test_config.py
danewalton/azure-iot-sdk-python
366
3289918
<gh_stars>100-1000 # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ------------------------------------------------------------------...
0
0
0
0
0
0
sdk/python/pulumi_aws/glue/resource_policy.py
chivandikwa/pulumi-aws
260
3289926
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** from __future__ import annotations import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Seque...
27
7
0
0
34
0
sdk/keyvault/azure-keyvault-secrets/azure/keyvault/secrets/_shared/exceptions.py
rsdoherty/azure-sdk-for-python
2,728
3289937
<gh_stars>1000+ # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ from collections import defaultdict import functools from typing import TYPE_CHECKING from azure.core.exceptions import DecodeError, HttpResponseError, ...
0
0
0
0
0
0
python/ray/workflow/tests/test_metadata_put.py
duarteocarmo/ray
21,382
3289940
import asyncio from ray import workflow from ray.tests.conftest import * # noqa from ray.workflow import workflow_storage from ray.workflow.storage import get_global_storage import pytest def get_metadata(paths, is_json: bool=True) -> object: store = get_global_storage() key = store.make_key(*paths) re...
1
13
0
0
14
0
ParlAI/parlai/zoo/image_chat/transresnet_multimodal.py
UmaTaru/run
163
3289963
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """Pretrained Transresnet Multimodal model on the Image-Chat task.""" from parlai.core.build_data import download_models...
0
0
0
0
0
0
ding/rl_utils/beta_function.py
sailxjx/DI-engine
464
3289969
<reponame>sailxjx/DI-engine """ Referenced papar <Implicit Quantile Networks for Distributional Reinforcement Learning> """ import torch from typing import Union beta_function_map = {} beta_function_map['uniform'] = lambda x: x # For beta functions, concavity corresponds to risk-averse and convexity to risk-seeking ...
0
0
0
0
0
0
feature_engine/selection/single_feature_performance.py
janrito/feature_engine
650
3289973
import warnings from typing import List, Union import pandas as pd from sklearn.model_selection import cross_validate from feature_engine.dataframe_checks import _is_dataframe from feature_engine.selection.base_selector import BaseSelector from feature_engine.validation import _return_tags from feature_engine.variabl...
7
3
0
0
10
0
packages/python/pyfora/algorithms/regressionTrees/GradientBoostedClassifierBuilder.py
ufora/ufora
571
3289976
# Copyright 2015 Ufora 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 i...
5
5
0
0
10
0
retain.py
mp2893/retain
181
3289988
################################################################# # Code written by <NAME> (<EMAIL>) # For bug report, please contact author using the email address ################################################################# import sys, random import numpy as np import cPickle as pickle from collections import O...
0
0
0
0
0
0
paddlespeech/t2s/modules/transformer/embedding.py
JiehangXie/PaddleSpeech
1,540
3289992
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
9
4
0
2
15
0
pyscript/preprocessing/__init__.py
takuto0831/Competition-utils
105
3289995
<reponame>takuto0831/Competition-utils from .transformer import * from .imputer import * from .utils import *
0
0
0
0
0
0
certbot/tests/plugins/dns_common_lexicon_test.py
vivithemage/certbot
16,789
3289997
"""Tests for certbot.plugins.dns_common_lexicon.""" import unittest try: import mock except ImportError: # pragma: no cover from unittest import mock from certbot.plugins import dns_common_lexicon from certbot.plugins import dns_test_common_lexicon class LexiconClientTest(unittest.TestCase, dns_test_common...
0
0
0
0
0
0
nni/nas/benchmarks/download.py
dutxubo/nni
9,680
3290037
import argparse if __name__ == '__main__': parser = argparse.ArgumentParser('NAS benchmark downloader') parser.add_argument('benchmark_name', choices=['nasbench101', 'nasbench201', 'nds']) args = parser.parse_args() from .utils import download_benchmark download_benchmark(args.benchmark_name)
0
0
0
0
0
0
deep_qa/models/sequence_tagging/__init__.py
richarajpal/deep_qa
459
3290041
<filename>deep_qa/models/sequence_tagging/__init__.py from .simple_tagger import SimpleTagger concrete_models = { # pylint: disable=invalid-name 'SimpleTagger': SimpleTagger, }
0
0
0
0
0
0
app/apiv2/organizations/locations/roles/schedules/shifts/shifts.py
Joey-Wondersign/Staffjoy-suite-Joey
890
3290043
<reponame>Joey-Wondersign/Staffjoy-suite-Joey<filename>app/apiv2/organizations/locations/roles/schedules/shifts/shifts.py import datetime import iso8601 from flask import g from flask_restful import marshal, reqparse, Resource, inputs from sqlalchemy import asc from copy import deepcopy from app.constants import API...
0
0
0
0
0
0
backends/c-mcpu/schedule/standard/default.py
Michoumichmich/antares
132
3290047
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from tvm import te import numpy as np import psutil def schedule(attrs) -> object: cfg, s = attrs.auto_config, attrs.scheduler def mcpu_auto_schedule(s, output, prefix): hyper_params = [[-1, 2, 8, 4], [-1, 1, 512, 1]] slice_data, sl...
0
1
0
0
1
0
tests/run_tests.py
GameTechDev/IntelShaderAnalyzer
117
3290050
<reponame>GameTechDev/IntelShaderAnalyzer<gh_stars>100-1000 # # This script scanes a directory full of test cases. For each file, it opens the file # and parses a set of commands. There are two types of commands: # @ DO which runs a command that should succeed, and and @DO_FAIL, which runs a command that sho...
0
0
0
0
0
0
tests/basics/string_center.py
learnforpractice/micropython-cpp
13,648
3290059
<gh_stars>1000+ try: str.center except: print("SKIP") raise SystemExit print("foo".center(0)) print("foo".center(1)) print("foo".center(3)) print("foo".center(4)) print("foo".center(5)) print("foo".center(6)) print("foo".center(20))
0
0
0
0
0
0
vissl/data/collators/multicrop_collator.py
blazejdolicki/vissl
2,512
3290070
<gh_stars>1000+ # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import torch from vissl.data.collators import register_collator from vissl.data.collators.collator_helper import MultiDimension...
0
0
0
0
0
0
tests/test_server.py
rafaelfelix/pytest-sanic
140
3290112
import pytest async def test_fixture_test_server_get_properties(sanic_server): assert sanic_server.is_running is True assert sanic_server.has_started() is True assert sanic_server.port is not None url = sanic_server.make_url('/test') assert url == 'http://127.0.0.1:{port}/test'.format(port=str(san...
0
0
0
0
0
0
Jar_Minder_v2/code.py
gamblor21/Adafruit_Learning_System_Guides
665
3290146
import digitalio import board done = digitalio.DigitalInOut(board.A4) done.direction = digitalio.Direction.OUTPUT done.value = False #pylint: disable=wrong-import-position,wrong-import-order import time import pwmio import busio from adafruit_epd.epd import Adafruit_EPD from adafruit_epd.il0373 import Adafruit_IL0373...
0
5
0
0
5
0
tests/ontarget/conftest.py
lasciousfloy/mpfshell
372
3290155
## # The MIT License (MIT) # # Copyright (c) 2016 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify,...
0
1
0
0
1
0
examples/tensorboard_tf.py
krshrimali/Open3D-ML
346
3290167
# ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- # The MIT License (MIT) # # Copyright (c) 2018-2021 www.open3d.org # # Permission i...
0
0
0
0
0
0
facial-beauty-prediction/img_loader.py
shinoyuki222/torch-light
310
3290197
from __future__ import annotations import torch from torch.autograd import Variable import torchvision from torchvision import transforms as T from PIL import Image import numpy as np class Img_loader(object): def __init__(self, path, bsz, is_cuda: bool=True, img_size: int=224, evaluation: bool=False): ...
3
3
0
1
7
0
ormar/queryset/__init__.py
naterenegar/ormar
905
3290216
<filename>ormar/queryset/__init__.py """ Contains QuerySet and different Query classes to allow for constructing of sql queries. """ from ormar.queryset.actions import FilterAction, OrderAction, SelectAction from ormar.queryset.clause import and_, or_ from ormar.queryset.field_accessor import FieldAccessor from ormar.q...
0
0
0
0
0
0
server/analytics/modules/label/Label.py
jycr753/Deep-Spying
199
3290229
__author__ = '<NAME> www.<EMAIL> - 06/09/2015' import numpy as np class Label: def __init__(self, path) -> None: file_path = "{}labels.csv".format(path) try: data = np.genfromtxt(file_path, delimiter=',', skip_header=1, names=['timestamp', 'label'], dt...
0
1
0
3
4
0
tests/find_best_fid_checkpoint.py
qiaone/GIF
322
3290230
import os import numpy as np run_id = 3 root_dir = '/is/cluster/work/pghosh/gif1.0' checkpoint_dir = os.path.join(root_dir, 'checkpoint', str(run_id)) smpl_dir = os.path.join(root_dir, 'sample', str(run_id)) smpl_files = os.listdir(smpl_dir) fids = [] smpl_png_files = [] for smpl_file in smpl_files: if smpl_file....
0
0
0
0
0
0
models/neck/yolof_neck.py
ZHANGHeng19931123/MutualGuide
124
3290249
#!/usr/bin/python # -*- coding: utf-8 -*- import os import torch import torch.nn as nn import torch.nn.init as init import torch.nn.functional as F from models.base_blocks import BasicConv class BasicBlock(nn.Module): def __init__(self, channels, dilation: int=1): super(BasicBlock, self).__init__() ...
2
2
0
0
4
0
ch2/ourown/segmenttree_ds.py
lyskevin/cpbook-code
1,441
3290259
<reponame>lyskevin/cpbook-code<gh_stars>1000+ class STree: def __init__(self, l): self.l = l self.n = len(l) self.st = [0] * (4 * self.n) self.islazy = [False] * (4 * self.n) self.lazy = [0] * (4 * self.n) self.build(1, 0, self.n - 1) def left(self, p): ...
0
0
0
0
0
0
sphinx/source/docs/user_guide/examples/categorical_bar_stacked_split.py
g-parki/bokeh
15,193
3290277
from bokeh.io import output_file, show from bokeh.models import ColumnDataSource from bokeh.palettes import GnBu3, OrRd3 from bokeh.plotting import figure output_file("stacked_split.html") fruits = ['Apples', 'Pears', 'Nectarines', 'Plums', 'Grapes', 'Strawberries'] years = ["2015", "2016", "2017"] exports = {'fruit...
0
0
0
0
0
0
tests/test_features_rplp.py
SuperKogito/cautious-palm-tree
205
3290285
import pytest import scipy.io.wavfile from spafe.utils import vis from spafe.features.rplp import rplp, plp from spafe.utils.spectral import stft, display_stft @pytest.fixture def sig() -> object: __EXAMPLE_FILE = 'test.wav' return scipy.io.wavfile.read(__EXAMPLE_FILE)[1] @pytest.fixture def fs() -> object:...
0
2
0
0
2
0
research/qtopt/optimizer_builder.py
slowy07/tensor2robot
456
3290288
# 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 ...
0
1
0
0
1
0
dso/dso/test/test_multiobject.py
brendenpetersen/deep-symbolic-optimization
134
3290306
<reponame>brendenpetersen/deep-symbolic-optimization import pytest import numpy as np from copy import deepcopy from dso.test.test_core import model from dso.program import from_str_tokens from dso.test.generate_test_data import CONFIG_TRAINING_OVERRIDE from dso.test.test_prior import assert_invalid, assert_valid, mak...
0
0
0
0
0
0
tools/gap-configs/python/generators/v1/chip_gen.py
mfkiwl/gap_sdk
118
3290308
# # Copyright (C) 2018 ETH Zurich, University of Bologna and # GreenWaves Technologies # # 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 # # U...
0
2
0
0
2
0
tests/Unit/Evolution/Systems/NewtonianEuler/BoundaryCorrections/Hllc.py
nilsvu/spectre
117
3290310
<reponame>nilsvu/spectre # Distributed under the MIT License. # See LICENSE.txt for details. import numpy as np def dg_package_data_mass_density( mass_density, momentum_density, energy_density, flux_mass_density, flux_momentum_density, flux_energy_density, velocity, specific_internal_energy, normal_covec...
0
0
0
0
0
0
src/bandersnatch/master.py
isidentical/bandersnatch
310
3290328
import asyncio import logging import re import sys from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor from functools import partial from os import environ from pathlib import Path from typing import Any, AsyncGenerator, Dict, Optional, Union import aiohttp from aiohttp_socks import ProxyConnector f...
20
14
1
0
35
0
Util/ProgressBar.py
leoatchina/MachineLearning
1,107
3290343
<reponame>leoatchina/MachineLearning import time class ProgressBar: def __init__(self, min_value=0, max_value=None, min_refresh_period=0.5, width=30, name="", start=True): self._min, self._max = min_value, max_value self._task_length = int(max_value - min_value) if ( min_value i...
0
0
0
0
0
0
tests/settings.py
timgates42/django-queued-storage
110
3290355
<reponame>timgates42/django-queued-storage SITE_ID = 1 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } INSTALLED_APPS = [ 'queued_storage', 'tests', ] SECRET_KEY = 'top_secret' CACHES = { 'default': { 'BACKEND': 'django.core.cac...
0
0
0
0
0
0
pyinn/__init__.py
johanesmikhael/pyinn
295
3290357
<reponame>johanesmikhael/pyinn from .ncrelu import ncrelu from .dgmm import dgmm from .cdgmm import cdgmm from .im2col import im2col, col2im from .conv2d_depthwise import conv2d_depthwise from .modules import Conv2dDepthwise
0
0
0
0
0
0
utils/visualizer/pose_visualizer.py
raviv/torchcv
308
3290376
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author: <NAME>(<EMAIL>) # Visualizer for pose estimator. import os import cv2 import matplotlib import numpy as np import pylab as plt from PIL import Image from numpy import ma from scipy.ndimage.filters import gaussian_filter from datasets.tools.transforms import DeN...
4
1
0
0
5
0
Mac/Demo/quicktime/VerySimplePlayer.py
arvindm95/unladen-swallow
2,293
3290384
<reponame>arvindm95/unladen-swallow<filename>Mac/Demo/quicktime/VerySimplePlayer.py """VerySimplePlayer converted to python <NAME>, CWI, December 1995 """ from Carbon import Qt from Carbon import QuickTime from Carbon import Qd from Carbon import QuickDraw from Carbon import Evt from Carbon import Events from Carbon ...
0
0
0
0
0
0
parsl/tests/test_threads/test_configs.py
cylondata/parsl
323
3290422
<gh_stars>100-1000 import pytest from parsl.app.app import python_app from parsl.tests.configs.local_threads import config local_config = config @python_app def worker_identify(x, sleep_dur=0.2): import time import os import threading time.sleep(sleep_dur) return {"pid": os.getpid(), ...
0
0
0
0
0
0
torchcv/models/retinanet/__init__.py
CVHj/torchcv
433
3290446
from torchcv.models.retinanet.fpn import FPN50 from torchcv.models.retinanet.net import RetinaNet from torchcv.models.retinanet.box_coder import RetinaBoxCoder
0
0
0
0
0
0
django_codemod/visitors/crypto.py
webstar-commit/django-boilerplate
128
3290463
from typing import Sequence from libcst import Arg, Call, Integer from django_codemod.constants import DJANGO_3_1, DJANGO_4_0 from django_codemod.utils.calls import find_keyword_arg from django_codemod.visitors.base import BaseFuncRenameTransformer class GetRandomStringTransformer(BaseFuncRenameTransformer): ""...
1
1
2
0
4
0
old/elm327_proxy.py
BiatuAutMiahn/pyAutoPI
133
3290466
import logging import socket import threading log = logging.getLogger(__name__) class ELM327Proxy(threading.Thread): TERMINATOR: bytes = b"\r" PROMPT: bytes = b"\r>" def __init__(self): super(ELM327Proxy, self).__init__() self.name = "elm327_proxy_{:}".format(id(self)) #self.da...
2
3
2
8
15
0
api/tests/v2/test_reporting.py
simpsonw/atmosphere
197
3290519
from unittest import skip from django.core.urlresolvers import reverse from rest_framework.test import APITestCase, APIRequestFactory, force_authenticate from api.tests.factories import UserFactory, AnonymousUserFactory from api.v2.views import ReportingViewSet class ReportingTests(APITestCase): def setUp(self)...
0
0
0
0
0
0
notebooks/notebook_init.py
priyaravichander/ganspace
1,644
3290548
<reponame>priyaravichander/ganspace # Copyright 2020 <NAME>. All rights reserved. # This file is licensed to you 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
0
perf_tests/cp_perf_test.py
dharunya0609/lifelines
1,654
3290550
<reponame>dharunya0609/lifelines # -*- coding: utf-8 -*- # cox regression if __name__ == "__main__": import pandas as pd import time import numpy as np from lifelines import CoxPHFitter from lifelines.datasets import load_rossi, load_regression_dataset reps = 1 df = load_rossi() # df...
0
0
0
0
0
0
python/testpb2.py
rodgar-nvkz/python-phonenumbers
2,424
3290566
#!/usr/bin/env python import doctest import unittest import phonenumbers.pb2 from tests.pb2 import * if __name__ == '__main__': doctest.testmod(phonenumbers.pb2) unittest.main()
0
0
0
0
0
0
deepreg/dataset/loader/nifti_loader.py
Zhiyuan-w/DeepReg
379
3290567
import os from typing import List, Tuple, Union import nibabel as nib import numpy as np from deepreg.dataset.loader.interface import FileLoader from deepreg.dataset.util import get_sorted_file_paths_in_dir_with_suffix from deepreg.registry import REGISTRY DATA_FILE_SUFFIX = ["nii.gz", "nii"] def load_nifti_file(f...
5
5
0
2
12
0
src/parsing/subscription_lexer.py
tylerbrockett/reddit-bots
107
3290581
<reponame>tylerbrockett/reddit-bots """ ========================================== Author: <NAME> Username: /u/tylerbrockett Description: Alert Bot ========================================== """ from parsing.token_type import TokenType import traceback class SubscriptionLexer: FALSE ...
0
0
0
0
0
0
doc/python_api/examples/bpy.types.Depsgraph.4.py
rbabari/blender
365
3290630
<filename>doc/python_api/examples/bpy.types.Depsgraph.4.py """ Dependency graph: Object.to_mesh() +++++++++++++++++++++++++++++++++++ Function to get a mesh from any object with geometry. It is typically used by exporters, render engines and tools that need to access the evaluated mesh as displayed in the viewport. O...
0
0
0
0
0
0
mpmath/function_docs.py
c-f-h/mpmath
625
3290665
""" Extended docstrings for functions.py """ pi = r""" `\pi`, roughly equal to 3.141592654, represents the area of the unit circle, the half-period of trigonometric functions, and many other things in mathematics. Mpmath can evaluate `\pi` to arbitrary precision:: >>> from mpmath import * >>> mp.dps = 50; m...
0
0
0
0
0
0
setup.py
zooechiu/pyro2
151
3290669
# this works for python 2 or 3 directly. To build, do: # # python setup.py build_ext # # Note the setup.cfg directs the build to be done in-place. from setuptools import setup setup(name='pyro', version='2.2.0', url='https://github.com/python-hydro/pyro2', license='BSD', install_requires=['nu...
0
0
0
0
0
0
master.py
cls1997/shootback
909
3290688
<gh_stars>100-1000 #!/usr/bin/env python3 # coding=utf-8 import os import tempfile import queue import atexit from common_func import * _listening_sockets = [] # for close at exit __author__ = "Aploium <<EMAIL>>" __website__ = "https://github.com/aploium/shootback" _DEFAULT_SSL_KEY = '''\ -----BEGIN PRIVATE KEY-----...
0
0
0
0
0
0
examples/language_model/bert/predict.py
tanhanzhuo/PaddleNLP
7,091
3290689
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
2
4
0
0
6
0
social_django/admin.py
postelo/social-app-django
1,754
3290710
<gh_stars>1000+ """Admin settings""" from itertools import chain from django.conf import settings from django.contrib import admin from social_core.utils import setting_name from .models import UserSocialAuth, Nonce, Association class UserSocialAuthOption(admin.ModelAdmin): """Social Auth user options""" li...
0
0
0
0
0
0
dataloader/megadepth.py
jeethesh-pai/caps
116
3290715
from __future__ import annotations import torch from torch.utils.data import Dataset import os import numpy as np import cv2 import skimage.io as io import torchvision.transforms as transforms import utils import collections from tqdm import tqdm import dataloader.data_utils as data_utils rand = np.random.RandomState...
0
10
0
2
12
0
tests/test_post_processing.py
jlgzb/mmpose
367
3290719
<filename>tests/test_post_processing.py import numpy as np from numpy.testing import assert_array_almost_equal from mmpose.core import (affine_transform, flip_back, fliplr_joints, fliplr_regression, get_affine_transform, rotate_point, transform_preds) def test_affine...
0
0
0
0
0
0
tests/unit/resources/settings/test_appliance_time_and_locale_configuration.py
doziya/hpeOneView
107
3290744
<filename>tests/unit/resources/settings/test_appliance_time_and_locale_configuration.py # -*- coding: utf-8 -*- ### # (C) Copyright (2012-2017) Hewlett Packard Enterprise Development LP # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files...
0
0
0
0
0
0
benchmark/pycnic_test.py
tfdahlin/pycnic
169
3290752
import sys;sys.path.insert(0,'../') # TEST #from pycnic.core import WSGI, Handler import pycnic.core class JSONHandler(pycnic.core.Handler): def get(self) -> dict[str,str]: return { "message": "Hello, World!" } class app(pycnic.core.WSGI): routes: list[tuple[str, object]] = [ ("/json", JS...
0
1
1
0
2
0
rpython/jit/tl/tla/loopabit.tla.py
nanjekyejoannah/pypy
381
3290758
from rpython.jit.tl.tla import tla code = [ tla.DUP, tla.CONST_INT, 1, tla.SUB, tla.DUP, tla.JUMP_IF, 1, tla.POP, tla.CONST_INT, 1, tla.SUB, tla.DUP, tla.JUMP_IF, 0, tla.RETURN ]
0
0
0
0
0
0
Homework/HW0/solution.py
LFhase/Learning_CS224w
119
3290795
<gh_stars>100-1000 import snap import collections import numpy as np import matplotlib import matplotlib.pyplot as plt def q1(): G = snap.LoadEdgeList(snap.PNGraph, "wiki-Vote.txt", 0, 1) cnt_node = 0 cnt_self_edge = 0 cnt_directed_edge = 0 uedge = set() cnt_undirected_edge = 0 reciedge =...
0
0
0
0
0
0
setup.py
Davidyanlong/coord-convert
149
3290803
<reponame>Davidyanlong/coord-convert #coding: --utf-8-- from setuptools import setup # version with open('coord_convert/__init__.py') as f: for line in f: if line.find('__version__') >= 0: version = line.split('=')[1].strip() version = version.strip('"') version = versio...
0
0
0
0
0
0
src/debugpy/_vendored/pydevd/tests_python/resources/_debugger_case_path_translation.py
r3m0t/debugpy
695
3290835
<gh_stars>100-1000 from tests_python.resource_path_translation import other def call_this(): print('break here') def main(): other.call_me_back1(call_this) print('TEST SUCEEDED!') if __name__ == '__main__': main()
0
0
0
0
0
0
theonionbox/tob/simplecontroller.py
ralphwetzel/theonionbox
120
3290849
<filename>theonionbox/tob/simplecontroller.py import socket import socks import threading # "Thanks" to stem! try: # Added in 3.x import queue except ImportError: import Queue as queue class SimpleController(object): _socket = None def __init__(self): assert (self._socket is not None), 'Simp...
0
0
0
0
0
0
Chapter11/Flask-GZip/setup.py
jayakumardhananjayan/pythonwebtut
135
3290850
from setuptools import setup, find_packages setup( name='Flask-GZip', version='0.1', license='MIT', description='Flask extension to allow easy GZip compressing of web pagess', author='<NAME>', author_email='<EMAIL>', platforms='any', install_requires=['Flask'], packages=find_package...
0
0
0
0
0
0
src/azure-cli/azure/cli/command_modules/search/tests/latest/test_private_link_resources.py
YuanyuanNi/azure-cli
3,287
3290851
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
0
0
0
0
0
0
tests/st/probability/distribution/test_gumbel.py
GuoSuiming/mindspore
3,200
3290864
# Copyright 2019 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
1
11
0
0
12
0
datacube/api/__init__.py
eodcgmbh/datacube-core
363
3290890
<filename>datacube/api/__init__.py # This file is part of the Open Data Cube, see https://opendatacube.org for more information # # Copyright (c) 2015-2020 ODC Contributors # SPDX-License-Identifier: Apache-2.0 """ Modules for the Storage and Access Query API """ from .core import Datacube, TerminateCurrentLoad from ....
0
0
0
0
0
0
ulmo/cuahsi/his_central/core.py
DavidChoi76/ulmo
123
3290899
<filename>ulmo/cuahsi/his_central/core.py """ ulmo.cuahsi.his_central.core ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module provides direct access to the `CUAHSI HIS Central`_ web service. .. _CUAHSI HIS Central: http://hiscentral.cuahsi.org/ """ import os from builtins import str import suds.client from sud...
0
0
0
0
0
0
flybirds/core/plugin/plugins/default/ios/element.py
LinuxSuRen/flybirds
183
3290924
# -*- coding: utf-8 -*- """ ios element core api implement """ from flybirds.core.plugin.plugins.default.base_element import BaseElement __open__ = ["Element"] class Element(BaseElement): """IOS Element Class""" name: str = "ios_element" def ui_driver_init(self) -> object: """ Initiali...
0
1
1
0
2
0
python3_anticaptcha/__init__.py
zanachka/python3-anticaptcha
125
3290940
<reponame>zanachka/python3-anticaptcha<gh_stars>100-1000 from .config import ( app_key, get_result_url, create_task_url, ) from .errors import ReadError, IdGetError, ParamError from .get_answer import get_sync_result, get_async_result
0
0
0
0
0
0
scripts/external_libs/scapy-2.4.3/scapy/tools/UTscapy.py
timgates42/trex-core
956
3290970
# This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Copyright (C) <NAME> <<EMAIL>> # This program is published under a GPLv2 license # flake8: noqa: E501 from __future__ import annotations """ Unit testing infrastructure for Scapy """ from __future__ import absolute_import ...
10
35
5
22
72
0
applications/FluidDynamicsApplication/python_scripts/fluid_solver.py
lkusch/Kratos
778
3290998
# Importing the Kratos Library from __future__ import annotations import KratosMultiphysics from KratosMultiphysics.python_solver import PythonSolver import KratosMultiphysics.python_linear_solver_factory as linear_solver_factory # Import applications import KratosMultiphysics.FluidDynamicsApplication as KratosCFD fro...
0
25
0
3
28
0
calvin/__init__.py
gabrielcercel/calvin-base
334
3291010
<filename>calvin/__init__.py name = "calvin"
0
0
0
0
0
0
third_party/virtualbox/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py
Fimbure/icebox-1
521
3291014
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=C0302 """ VirtualBox Validation Kit - Guest Control Tests. """ __copyright__ = \ """ Copyright (C) 2010-2017 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This file is free sof...
0
0
0
0
0
0
pystruct/learners/svm.py
LemonLison/pystruct
501
3291046
import numpy as np import cvxopt import cvxopt.solvers class SVM(object): def __init__(self, C: float=1.0): self.C = float(C) def fit(self, X, y): n_samples, n_features = X.shape Xy = X * y[:, np.newaxis] P = cvxopt.matrix(np.dot(Xy, Xy.T)) q = cvxopt.matrix(np.ones(...
1
2
0
0
3
0
scripts/regenerate_requirements.py
nbaddam/oppia
5,422
3291081
# Copyright 2020 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
0
0
0
0
0
0
visual.py
ruifan831/NLP-Tutorials
643
3291097
import matplotlib.pyplot as plt import numpy as np import pickle from matplotlib.pyplot import cm import os import utils def show_tfidf(tfidf, vocab, filename): # [n_doc, n_vocab] plt.imshow(tfidf, cmap="YlGn", vmin=tfidf.min(), vmax=tfidf.max()) plt.xticks(np.arange(tfidf.shape[1]), vocab, fontsize=6, ro...
7
0
0
0
7
0
models/nlp/text_tfidf_model_continuous.py
h2oai/driverlessai-recipes
194
3291099
<filename>models/nlp/text_tfidf_model_continuous.py """Text classification model using TFIDF""" import random import numpy as np import scipy as sp import datatable as dt from sklearn.preprocessing import LabelEncoder from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.linear_model import LinearReg...
0
0
0
0
0
0
lib/galaxy/managers/roles.py
quacksawbones/galaxy-1
1,085
3291132
<gh_stars>1000+ """ Manager and Serializer for Roles. """ import logging from sqlalchemy import false from sqlalchemy.orm import exc as sqlalchemy_exceptions import galaxy.exceptions from galaxy import model from galaxy.exceptions import RequestParameterInvalidException from galaxy.managers import base from galaxy.ma...
0
0
0
0
0
0
libcloudforensics/providers/aws/internal/log.py
f0r3ns1cat0r/cloud-forensics-utils
241
3291133
<filename>libcloudforensics/providers/aws/internal/log.py<gh_stars>100-1000 # -*- coding: utf-8 -*- # Copyright 2020 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:...
0
0
0
0
0
0
examples/basic.py
blazing-gig/tortoise-orm
2,847
3291139
""" This example demonstrates most basic operations with single model """ from tortoise import Tortoise, fields, run_async from tortoise.models import Model class Event(Model): id = fields.IntField(pk=True) name = fields.TextField() datetime = fields.DatetimeField(null=True) class Meta: table...
0
1
1
0
2
0
igibson/external/motion/motion_planners/rrt_star.py
mamadbiabon/iGibson
360
3291153
<gh_stars>100-1000 """ Developed by <NAME> in pybullet-planning repository (https://github.com/caelan/pybullet-planning) and adapted by iGibson team. """ from random import random from time import time import numpy as np from .utils import INF, argmin class OptimalNode(object): def __init__(self, config, parent=...
0
0
0
0
0
0
Demo/newmetaclasses/Eiffel.py
arvindm95/unladen-swallow
2,293
3291171
<filename>Demo/newmetaclasses/Eiffel.py """Support Eiffel-style preconditions and postconditions.""" from types import FunctionType as function class EiffelBaseMetaClass(type): def __new__(meta, name, bases, dict): meta.convert_methods(dict) return super(EiffelBaseMetaClass, meta).__new__(meta, n...
0
0
0
0
0
0
test/test_partial_load.py
lipovsek/PyTorch-LIT
151
3291193
<reponame>lipovsek/PyTorch-LIT<gh_stars>100-1000 import unittest import torch from pytorch_lit import PartialLoader import os class PartialLoadingTest(unittest.TestCase): def test_read(self): f16_tensor = torch.rand((200, 1, 10), dtype=torch.float16) torch.save({ "f16_tensor": f16_tens...
0
0
0
0
0
0
test/viz/test_dendogram.py
khourhin/sequana
138
3291198
def test_dendogram(): from sequana.viz import heatmap, dendogram df = heatmap.get_heatmap_df() h = dendogram.Dendogram(df) h.plot()
0
0
0
0
0
0
orgparse/tests/test_misc.py
j3soon-pr/orgparse
233
3291213
<reponame>j3soon-pr/orgparse<filename>orgparse/tests/test_misc.py from .. import load, loads from ..node import OrgEnv def test_empty_heading() -> None: root = loads(''' * TODO :sometag: has no heading but still a todo? it's a bit unclear, but seems to be highligted by emacs.. ''') [h] = root.children ...
0
0
0
0
0
0
setup/scripts/generate_robotcar_query_list.py
maxtomCMU/hfnet
555
3291227
from pathlib import Path from tqdm import tqdm if __name__ == '__main__': images_dir = 'images' query_list_name = 'queries/{}_queries_with_intrinsics.txt' intrinsics_name = 'intrinsics/{}_intrinsics.txt' sequence = 'night-rain' h, w = 1024, 1024 intrinsics = {} for side in ['left', 'right...
0
0
0
0
0
0
tests/test-cases/typeinfer_real_cases/pytest_code_source.py
SMAT-Lab/Scalpel
102
3291267
""" https://github.com/pytest-dev/pytest """ import ast import inspect import textwrap import tokenize import types import warnings from bisect import bisect_right from typing import Iterable from typing import Iterator from typing import List from typing import Optional from typing import overload from typing import T...
17
18
3
1
39
0
tests/python/conftest.py
sankhesh/tomviz
284
3291341
import pytest import requests import diskcache import tempfile import os import tarfile import shutil DATA_URL = 'https://data.kitware.com/api/v1/file' @pytest.fixture(scope="module") def test_state_file(tmpdir_factory): tmpdir = tmpdir_factory.mktemp('state') _id = '5dbca381e3566bda4b4f94f0' download_u...
0
0
0
0
0
0