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
scss/tests/extension/compass/test_gradients.py
kochelmonster/pyScss
152
3292842
"""Tests for Compass gradient generation.""" from __future__ import absolute_import from __future__ import unicode_literals from scss.calculator import Calculator from scss.extension.compass import CompassExtension from scss.extension.compass.gradients import linear_gradient from scss.types import String, List, Number...
0
1
0
0
1
0
python/seldon/pipeline/bayes_optimize.py
smsahu/seldon-server
1,645
3292851
from __future__ import annotations import pandas as pd import numpy as np from bayes_opt import BayesianOptimization from sklearn.base import BaseEstimator import seldon.pipeline.cross_validation as cf import logging logger = logging.getLogger(__name__) class BayesOptimizer(BaseEstimator): """ sklearn wrappe...
5
7
0
4
16
0
sentence_types.py
msi1427/sentence-classification
204
3292867
from __future__ import annotations ''' Written by <NAME> Last Edit: January 2, 2019 For use on https://austingwalters.com Methods to ingest sentence types ''' from __future__ import print_function import os import re import numpy as np import nltk import json import random from bs4 import BeautifulSoup def encode_...
11
8
0
0
19
0
ddtrace/internal/utils/wrappers.py
melancholy/dd-trace-py
308
3292870
from __future__ import annotations import inspect from typing import Any from typing import Callable from typing import Optional from typing import TYPE_CHECKING from typing import TypeVar from ddtrace.vendor import wrapt from .deprecation import deprecated if TYPE_CHECKING: import ddtrace F = TypeVar("F", bo...
1
3
0
0
4
0
project_generator/tools/eclipse.py
mbrossard/project_generator
197
3292874
<filename>project_generator/tools/eclipse.py # Copyright 2014-2015 0xc0170 # # 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 requir...
0
0
0
0
0
0
demos/fixed_joint_demo.py
baceituno/lcp-physics
276
3292882
import math import sys import pygame from lcp_physics.physics.bodies import Circle, Rect, Hull from lcp_physics.physics.constraints import TotalConstraint, FixedJoint from lcp_physics.physics.forces import ExternalForce, Gravity, vert_impulse, hor_impulse from lcp_physics.physics.utils import Defaults, Recorder from ...
0
0
0
0
0
0
components/aws/sagemaker/tests/unit_tests/tests/train/test_train_spec.py
Strasser-Pablo/pipelines
2,860
3292884
<reponame>Strasser-Pablo/pipelines from train.src.sagemaker_training_spec import SageMakerTrainingSpec import unittest class TrainingSpecTestCase(unittest.TestCase): REQUIRED_ARGS = [ "--region", "us-west-2", "--role", "arn:aws:iam::123456789012:user/Development/product_1234/*", ...
0
0
0
0
0
0
iam/api-client/custom_roles.py
yshalabi/python-docs-samples
5,938
3292887
#!/usr/bin/env python # Copyright 2018 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 ...
0
5
0
0
5
0
mythril/laser/plugin/builder.py
kalloc/mythril
1,887
3292889
from mythril.laser.plugin.interface import LaserPlugin from abc import ABC, abstractmethod from typing import Optional class PluginBuilder(ABC): """ PluginBuilder The plugin builder interface enables construction of Laser plugins """ name: str = "Default Plugin Name" def __init__(self): ...
0
1
1
1
3
0
tests/client/files/get_unignored_file_paths_test.py
longhuei/floyd-cli
162
3292891
import unittest from mock import patch from floyd.client.files import get_unignored_file_paths from tests.client.mocks import mock_fs1 class TestFilesClientGetUnignoredFilePaths(unittest.TestCase): """ Tests FileClient get_unignored_file_paths() """ @patch('floyd.client.files.os.walk', side_effect=moc...
0
0
0
0
0
0
math/extendedEuclidean.py
ayushijain218/python
204
3292934
<gh_stars>100-1000 """ for numbers a, b returns x, y such as x * a + y * b = gcd(a,b) """ def extendedEuclidean(a,b): a_old, b_old = a,b a, b = max(a, b), min(a, b) x, y, old_x, old_y = 0, 1, 1, 0 while b != 0: quotient = a // b residue = a % b a, b = b, residue x, o...
0
0
0
0
0
0
openfda/test_common.py
FDA/openfda
388
3292940
#!/usr/bin/python '''Helper functions for testing.''' import inspect import os def data_filename(fname, caller_frame: int=1) -> object: # get the parent frame _, parent_file, _, _, _, _ = inspect.getouterframes( inspect.currentframe())[caller_frame] base_dir = os.path.abspath(os.path.dirname(parent_file)) ...
1
2
0
0
3
0
tests/test_index_slicing.py
vkleen/skidl
700
3292944
# -*- coding: utf-8 -*- # The MIT License (MIT) - Copyright (c) 2016-2021 <NAME>. import pytest from skidl import Part from .setup_teardown import setup_function, teardown_function def test_index_slicing_1(): mcu = Part("GameteSnapEDA", "STM32F767ZGT6", pin_splitters="/()") mcu.match_pin_regex = False ...
0
0
0
0
0
0
chocolate/conditional/thompson.py
Intelecy/chocolate
105
3292971
from __future__ import annotations from collections import Sequence from itertools import chain import numpy from ..base import SearchAlgorithm from ..connection.splitter import ConnectionSplitter, split_space, transform_suboutput class ThompsonSampling(SearchAlgorithm): """Conditional subspaces exploration str...
7
3
0
1
11
0
basis_set_exchange/tests/test_lut.py
ltalirz/basis_set_exchange
108
3292985
""" Tests for lookups of elemental data """ import pytest from basis_set_exchange import lut _all_elements = list(range(1, 119)) _all_elements_str = [str(x) for x in _all_elements] _all_elements.extend(_all_elements_str) _all_am = list(range(1, 13)) @pytest.mark.parametrize('Z', _all_elements) def test_element_data...
0
0
0
0
0
0
impyute/ops/error.py
eltonlaw/impy
316
3292994
<reponame>eltonlaw/impy<filename>impyute/ops/error.py """ Impyute specific error messages """ class BadInputError(Exception): "Error thrown when input args don't match spec" pass class BadOutputError(Exception): "Error thrown when outputs don't match spec" pass
0
0
0
0
0
0
meshreg/datasets/syntho3dv2.py
pgrady3/handobjectconsist
103
3293060
<reponame>pgrady3/handobjectconsist import os import pickle import numpy as np from PIL import Image, ImageFile from tqdm import tqdm from meshreg.datasets.queries import BaseQueries, get_trans_queries from meshreg.datasets import ho3dfullutils from libyana.meshutils import meshnorm ImageFile.LOAD_TRUNCATED_IMAGES =...
0
0
0
0
0
0
var/spack/repos/builtin/packages/py-oslo-utils/package.py
LiamBindle/spack
2,360
3293065
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyOsloUtils(PythonPackage): """ The oslo.utils library provides support for common uti...
0
0
3
0
3
0
checkov/kubernetes/checks/DefaultNamespace.py
cclauss/checkov
4,013
3293083
from checkov.common.models.enums import CheckCategories, CheckResult from checkov.kubernetes.base_spec_check import BaseK8Check class DefaultNamespace(BaseK8Check): def __init__(self): # CIS-1.5 5.7.4 name = "The default namespace should not be used" # default Service Account and Service/...
0
2
0
0
2
0
neo/SmartContract/TriggerType.py
volekerb/neo-python
387
3293175
Verification = b'\x00' Application = b'\x10' VerificationR = b'\x01' ApplicationR = b'\x11'
0
0
0
0
0
0
descarteslabs/workflows/types/mixins/__init__.py
carderne/descarteslabs-python
167
3293180
<reponame>carderne/descarteslabs-python from .numpy_mixin import NumPyMixin __all__ = ["NumPyMixin"]
0
0
0
0
0
0
tools/style_variable_generator/opacity.py
iridium-browser/iridium-browser
575
3293181
# Copyright 2021 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 import re import sys # Python3's unicode class is just 'str'. STRTYPE = str if sys.version_info >= (3, ) else basestring ...
1
2
0
1
4
0
components/isceobj/ImageFilter/BandExtractor.py
vincentschut/isce2
1,133
3293212
#!/usr/bin/env python3 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Copyright 2010 California Institute of Technology. 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. # Yo...
0
2
0
2
4
0
lib/timer.py
ShengyuH/PredateOverlap
153
3293220
<reponame>ShengyuH/PredateOverlap import time class AverageMeter(object): """Computes and stores the average and current value""" def __init__(self): self.reset() def reset(self): self.val = 0 self.avg = 0 self.sum = 0.0 self.sq_sum = 0.0 self.count = 0 ...
0
0
0
0
0
0
pycharm2020.1.3/script/component/avatar/CompAvatarTest.py
LaudateCorpus1/realtime-server
465
3293225
<gh_stars>100-1000 # from TcpServer import TCP_SERVER # import asyncio import asyncio import time from RpcHandler import rpc_func from common.component.Component import Component from common.service_const import ETCD_TAG_BATTLE_SRV from component.puppet import test_reload_const from component.puppet.test_reload_const ...
0
0
0
0
0
0
chapter03_Python_image_classification/models.py
iroan/Practicing-Federated-Learning
227
3293233
<reponame>iroan/Practicing-Federated-Learning import torch from torchvision import models def get_model(name="vgg16", pretrained=True): if name == "resnet18": model = models.resnet18(pretrained=pretrained) elif name == "resnet50": model = models.resnet50(pretrained=pretrained) elif name == "densenet121": m...
0
0
0
0
0
0
pretrained-model/alignment/small-conformer-tts.py
ishine/malaya-speech
111
3293292
from __future__ import annotations import pyroomacoustics as pra import numpy as np from pydub import AudioSegment from sklearn.utils import shuffle from glob import glob import random import json import malaya_speech.train as train import malaya_speech.config import malaya_speech.train.model.transducer as transducer i...
6
8
0
0
14
0
twnews/finance/__init__.py
virus-warnning/twnews
188
3293296
<gh_stars>100-1000 """ 財經資料蒐集工具共用模組 """ import os import sqlite3 import sys from requests.exceptions import RequestException import twnews.common as common from twnews.exceptions import NetworkException DDL_LIST = [ # 三大法人 ''' CREATE TABLE IF NOT EXISTS `institution` ( trading_date TEXT, ...
0
0
0
0
0
0
mrq/dashboard/utils.py
fredstro/mrq
745
3293319
import json # from werkzeug import Response from functools import wraps from flask import request, Response from mrq.context import get_current_config from mrq.utils import MongoJSONEncoder def jsonify(*args, **kwargs) -> object: """ jsonify with support for MongoDB ObjectId """ return Response( j...
0
5
0
0
5
0
test/sanity/win-manifest-fullscreen/test.py
frank-dspeed/nw.js
27,296
3293324
<reponame>frank-dspeed/nw.js import time import os import subprocess import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from nw_util import * from selenium import webdriver from selenium.webdriver.chrome.options import Options chrome_options = Options() chrome_options.add_argument...
0
0
0
0
0
0
EventFilter/GctRawToDigi/python/gctInternJetProd_cfi.py
ckamtsikis/cmssw
852
3293349
import FWCore.ParameterSet.Config as cms gctInternJetProducer = cms.EDProducer("L1GctInternJetProducer", internalJetSource = cms.InputTag("gctDigis"), centralBxOnly = cms.bool(True) )
0
0
0
0
0
0
pyzoo/test/zoo/common/test_util.py
Bob-Chou/analytics-zoo
2,970
3293366
# # Copyright 2018 Analytics Zoo 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...
0
0
0
0
0
0
ams_extractor.py
ZhihaoDU/speech_feature_extractor
111
3293374
<reponame>ZhihaoDU/speech_feature_extractor<gh_stars>100-1000 # coding = utf-8 import numpy as np from feature_extractor import stft_extractor import matplotlib.pyplot as plt from scipy.io import wavfile # axis=0 for col vectors # axis=1 for row vectors def normalize_matrix(m, axis=0): norm = np.linalg.norm(m, a...
0
0
0
0
0
0
PyObjCTest/test_nsdata.py
Khan/pyobjc-framework-Cocoa
132
3293395
from PyObjCTools.TestSupport import * import objc import array import sys from Foundation import * from PyObjCTest.testhelper import PyObjC_TestClass3 if sys.version_info[0] == 3: buffer = memoryview def array_frombytes(a, b) -> object: return a.frombytes(b) def array_tobytes(a) -> object: ...
0
16
0
0
16
0
tests/datatypes/test_complex.py
jacebrowning/voc
850
3293400
<filename>tests/datatypes/test_complex.py from .. utils import TranspileTestCase, UnaryOperationTestCase, BinaryOperationTestCase, InplaceOperationTestCase class ComplexTests(TranspileTestCase): def test_conjugate(self): self.assertCodeExecution(""" x = complex(1.5, 1) print(x.conj...
0
0
0
0
0
0
build/android/pylib/instrumentation/instrumentation_parser.py
zealoussnow/chromium
2,219
3293425
<filename>build/android/pylib/instrumentation/instrumentation_parser.py # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import re # http://developer.android.com/reference/android/test/Inst...
0
0
0
0
0
0
tests/thread/thread_start1.py
learnforpractice/micropython-cpp
692
3293439
# test basic capability to start a new thread # # MIT license; Copyright (c) 2016 <NAME> on behalf of Pycom Ltd try: import utime as time except ImportError: import time import _thread def foo(): pass def thread_entry(n): for i in range(n): foo() _thread.start_new_thread(thread_entry, (10,))...
0
0
0
0
0
0
release/stubs.min/Autodesk/Revit/DB/__init___parts/IFCExportOptions.py
htlcnn/ironpython-stubs
182
3293446
class IFCExportOptions(object,IDisposable): """ IFC Export options. IFCExportOptions(from: IFCExportOptions) IFCExportOptions() """ def AddOption(self,name,value): """ AddOption(self: IFCExportOptions,name: str,value: str) Adds a new named option to the options structure. na...
0
0
0
0
0
0
baidupcs_py/common/concurrent.py
EVAyo/BaiduPCS-Py
335
3293452
<gh_stars>100-1000 from typing import Optional, Callable, Any from functools import wraps from threading import Semaphore def sure_release(semaphore: Semaphore, func, *args, **kwargs): try: return func(*args, **kwargs) finally: semaphore.release() def retry(times: int, except_callback: Optio...
0
0
0
0
0
0
coursera_ai/rklib.py
Dani7B/claimed
308
3293454
<reponame>Dani7B/claimed import requests, json def submit(submitterEmail,secret,key,submission_part, all_parts, data): submission = { "assignmentKey": key, "submitterEmail": submitterEmail, "secret": secret, "parts": {} ...
0
0
0
0
0
0
corpkit/interrogator.py
interrogator/corpk
216
3293466
<gh_stars>100-1000 """ corpkit: Interrogate a parsed corpus """ from __future__ import print_function from corpkit.constants import STRINGTYPE, PYTHON_VERSION, INPUTFUNC def interrogator(corpus, search='w', query='any', show='w', exclude=False, excludemode='any', searchmode='all', case_s...
0
0
0
0
0
0
chrome/test/functional/chromeos_volume.py
Scopetta197/chromium
212
3293482
#!/usr/bin/env python # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import os import subprocess import pyauto_functional # Must be imported before pyauto import pyauto class Chrome...
0
0
0
0
0
0
reckoner/tests/test_cli.py
LynRodWS/reckoner
192
3293493
# Copyright 2019 FairwindsOps Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
0
0
0
0
0
0
decompile_scripts.py
ColonolNutty/Sims4CommunityLibrary
118
3293519
import os from compile_utils import _remove_files_conflicting_with_decompile, _replace_renamed_files from decompilation_method import S4PyDecompilationMethod from settings import custom_scripts_for_decompile_source, game_folder, decompile_method_name, custom_scripts_for_decompile_destination, should_decompile_ea_scrip...
2
1
0
0
3
0
benchmark/runtime/dgl/gat.py
mrmotallebi/pytorch_geometric
12,651
3293526
<reponame>mrmotallebi/pytorch_geometric<filename>benchmark/runtime/dgl/gat.py import torch import torch.nn.functional as F from torch.nn import Parameter from torch_geometric.nn.inits import glorot, zeros import dgl.function as fn from dgl.nn.pytorch import EdgeSoftmax class GATConv(torch.nn.Module): def __init__...
0
0
0
0
0
0
kafka_utils/kafka_cluster_manager/cluster_info/topic.py
dbgrigsby/kafka-utils
302
3293542
# -*- coding: utf-8 -*- # Copyright 2016 Yelp 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 ...
2
6
0
0
8
0
alipay/aop/api/response/AlipayFundTransThirdpartyRewardQueryResponse.py
snowxmas/alipay-sdk-python-all
213
3293544
<filename>alipay/aop/api/response/AlipayFundTransThirdpartyRewardQueryResponse.py #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AlipayFundTransThirdpartyRewardQueryResponse(AlipayResponse): def __init__(self): super(Alip...
0
0
0
0
0
0
vision/medical_imaging/3d-unet/unet_pytorch_to_onnx.py
CaoZhongZ/inference
388
3293565
<gh_stars>100-1000 # coding=utf-8 # Copyright (c) 2020 <NAME>. All rights reserved. # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with th...
0
0
0
0
0
0
doc/source/plots/coulombf_c.py
dimpase/mpmath
625
3293581
# Regular Coulomb wave function in the complex plane cplot(lambda z: coulombf(1,1,z), points=50000)
0
0
0
0
0
0
watermask_remover_and_split_data/tools/extract_test_img_to_txts.py
ericosmic/2019-CCF-BDCI-OCR-MCZJ-OCR-IdentificationIDElement
886
3293585
import os from multiprocessing import Pool def run(idx, test_img_dst_path, test_img_names, img_names): fw = open(os.path.join(test_img_dst_path, "images_list" + "_" + str(idx) + ".txt"), "w") img_name = img_names[idx][:-5] for te_img in test_img_names: if img_name in te_img: fw.write(t...
0
0
0
0
0
0
src/Utils/task.py
codexgigassys/codex-backend
161
3293587
<filename>src/Utils/task.py import pathmagic from MetaControl.MetaController import * from Utils.Functions import change_date_to_str from Utils.Functions import add_error from Utils.Functions import id_generator from Utils.Functions import check_hashes from rq import Queue from redis import Redis import datetime def ...
0
0
0
0
0
0
algorithms/arrays/__init__.py
timgates42/algorithms
22,426
3293593
from .delete_nth import * from .flatten import * from .garage import * from .josephus import * from .longest_non_repeat import * from .max_ones_index import * from .merge_intervals import * from .missing_ranges import * from .move_zeros import * from .plus_one import * from .rotate import * from .summarize_ranges impor...
0
0
0
0
0
0
virtual/lib/python3.8/site-packages/tests/testapp/migrations/0002_testmodel.py
Calebu6214/Instagram-clone
598
3293608
<filename>virtual/lib/python3.8/site-packages/tests/testapp/migrations/0002_testmodel.py<gh_stars>100-1000 # Generated by Django 2.2.17 on 2021-01-28 10:51 from django.db import migrations, models import tinymce.models class Migration(migrations.Migration): dependencies = [ ("testapp", "0001_initial"),...
0
0
0
0
0
0
airbyte-cdk/python/unit_tests/destinations/test_destination.py
darian-heede/airbyte
6,215
3293666
# # Copyright (c) 2021 Airbyte, Inc., all rights reserved. # from __future__ import annotations import argparse import io import json from os import PathLike from typing import Any, Dict, Iterable, List, Mapping, Union from unittest.mock import ANY import pytest from airbyte_cdk.destinations import Destination from a...
17
8
1
0
26
0
brute_force__examples/multiprocess.py
DazEB2/SimplePyScripts
117
3293707
<reponame>DazEB2/SimplePyScripts<gh_stars>100-1000 #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' # SOURCE: https://ru.stackoverflow.com/a/776977/201445 import binascii import hashlib import itertools import multiprocessing from functools import partial import string alphabet = (string.asc...
0
0
0
0
0
0
data_validation/result_handlers/text.py
ajw0100/professional-services-data-validator
167
3293711
# 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 agreed to in writing, ...
0
2
0
0
2
0
js2py/internals/constructors/jsfunction.py
renesugar/Js2Py
1,926
3293732
<reponame>renesugar/Js2Py<gh_stars>1000+ from ..base import * from ..conversions import * from ..func_utils import * from pyjsparser import parse from ..byte_trans import ByteCodeGenerator, Code def Function(this, args): # convert arguments to python list of strings a = list(map(to_string, tuple(args))) _...
0
0
0
0
0
0
Chapter12/moving_wave_variable.py
llichengtong/project_folder
403
3293741
<gh_stars>100-1000 import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation # Generate the signal def generate_data(length=2500, t=0, step_size=0.05): for count in range(length): t += step_size signal = np.sin(2*np.pi*t) damper = np.exp(-t/8.0) yie...
0
0
0
0
0
0
HackerEarth/IndiaHacks/Qualifier/Problem D/gen.py
VastoLorde95/Competitive-Programming
170
3293748
from random import * N = 100 n = randrange(2,N+1) m = randrange(1,1+(n*(n+1))) print n,m for i in xrange(m): a = randrange(1,n+1) b = randrange(1,n+1) print a, b
0
0
0
0
0
0
Ryven/packages/auto_generated/abc/nodes.py
tfroehlich82/Ryven
2,872
3293749
<gh_stars>1000+ from NENV import * import abc class NodeBase(Node): pass class _Abc_Init_Node(NodeBase): """ Internal ABC helper for class set-up. Should be never used outside abc module.""" title = '_abc_init' type_ = 'abc' init_inputs = [ ] init_outputs = [ ...
0
0
0
0
0
0
demoproject/test_settings.py
afkmamunbd/django-admin-tools-stats
204
3293755
from .demoproject.settings import * ROOT_URLCONF = 'demoproject.demoproject.urls' ADMIN_TOOLS_MENU = 'demoproject.menu.CustomMenu' ADMIN_TOOLS_INDEX_DASHBOARD = 'demoproject.dashboard.CustomIndexDashboard' ADMIN_TOOLS_APP_INDEX_DASHBOARD = 'demoproject.dashboard.CustomAppIndexDashboard' FIXTURE_DIRS = ( 'demop...
0
0
0
0
0
0
calvin/utilities/dynops.py
gabrielcercel/calvin-base
334
3293770
<reponame>gabrielcercel/calvin-base<gh_stars>100-1000 # -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/l...
0
0
0
0
0
0
setup.py
gurupratap-matharu/datascience-1
424
3293774
<reponame>gurupratap-matharu/datascience-1 import sys from setuptools import setup from setuptools.command.test import test as TestCommand if sys.version_info < (3, 0): raise ValueError('This package requires python >= 3.0') with open('requirements.txt') as fid: install_requires = [l.strip() for l in fid.rea...
0
0
0
0
0
0
src/controller/routes/help/getHelpForAnnomity.py
ZhangPluto/Funny-Nation
126
3293801
from discord import Client, Message from src.utils.readConfig import getLanguageConfig import embedLib.help.anonymityBoard as help languageConfig = getLanguageConfig() async def getHelpForAnnomity(self: Client, message: Message): embed = help.getEmbed() await message.channel.send(embed=embed)
2
0
0
0
2
0
onebitbt/advertiser.py
newhouseb/onebitbt
150
3293809
<reponame>newhouseb/onebitbt import sys import numpy as np from nmigen import Elaboratable, Module, Memory, Signal, ClockSignal, signed, Instance from nmigen.build import Resource, Pins, Attrs from alldigitalradio.io.generic_serdes import get_serdes_implementation import alldigitalradio.hardware as hardware from all...
0
0
0
0
0
0
chapter14/interfaces_annotations.py
lixin940207/expert_python_programming
189
3293834
from __future__ import annotations """ "Interfaces" section example showing how function annotations can be used to verify/check interfaces defines with Abstract Base Classes. """ from abc import ( ABCMeta, abstractmethod, abstractproperty ) class IRectangle(metaclass=ABCMeta): @abstractproperty ...
1
12
0
0
13
0
pred.py
undeadyequ/protest-detection-violence-estimation
157
3293837
""" created by: <NAME> """ from __future__ import print_function import os import argparse import numpy as np import pandas as pd import time import shutil from PIL import Image from tqdm import tqdm import torch from torch.utils.data import Dataset, DataLoader from torch.autograd import Variable imp...
0
1
0
0
1
0
sarenka/backend/api_searcher/input_validator.py
adolabsnet/sarenka
380
3293863
import re class InputValidator: @staticmethod def is_cve_code(data) -> bool: if re.match("CVE-\d{4}-\d+", data): return True return False
0
1
0
0
1
0
test/package/package_b/subpackage_1.py
Hacky-DH/pytorch
60,067
3293923
result = "subpackage_1" class PackageBSubpackage1Object_0: __slots__: list[str] = ["obj"] def __init__(self, obj): self.obj = obj def return_result(self) -> object: return result
0
1
1
0
2
0
spot-setup/migration/migrate_old_dns_data.py
yellingviv/incubator-spot
365
3293945
#!/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 License, Version 2.0 # (the "Licens...
0
0
0
0
0
0
python/tabulate_codes.py
paolobenve/stopwords-iso
307
3294032
#!/usr/bin/env python3 """Generates a table of ISO 639-1:2002 and writes to README.md.""" import json import os.path import time import urllib.request from html.parser import HTMLParser class ISO6391TableParser(HTMLParser): def __init__(self, *args, **kwargs): self._in_tr = ( self._in_td ...
0
2
0
2
4
0
tests/test-cases/typeinfer_basecase/case1.py
SMAT-Lab/Scalpel
102
3294033
# Returning defined variable # EXPECTED OUTPUT: # case1.py: my_var -> Dict[str, str] # case1.py: my_function() -> Dict[str, str] from collections import defaultdict def my_function() -> object: """ Function comment """ my_var = {"hello": "world"} return my_var
0
1
0
0
1
0
aries_cloudagent/transport/stats.py
euroledger/aries-cloudagent-python
247
3294056
<filename>aries_cloudagent/transport/stats.py<gh_stars>100-1000 """aiohttp stats collector support.""" import aiohttp from ..utils.stats import Collector class StatsTracer(aiohttp.TraceConfig): """Attach hooks to client session events and report statistics.""" def __init__(self, collector: Collector, prefi...
0
0
0
0
0
0
ioflo/aid/eventing.py
BradyHammond/ioflo
128
3294066
from __future__ import annotations """ eventing.py event and event tagging utility functions """ from __future__ import absolute_import, division, print_function import sys import os import datetime from collections import Set # both set and frozen set # Import ioflo libs from .sixing import * from .odicting import...
10
3
0
0
13
0
pybasicbayes/models/__init__.py
dhb2128/pybasicbayes
122
3294084
from .mixture import Labels, CRPLabels, Mixture, MixtureDistribution, CollapsedMixture, CRPMixture from .factor_analysis import FactorAnalysis
0
0
0
0
0
0
thingsboard_gateway/connectors/odbc/odbc_connector.py
meuron-io/thingsboard-gateway
1,123
3294087
# Copyright 2021. ThingsBoard # # 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 ...
0
0
0
0
0
1
rest_framework_simplejwt/__init__.py
xrmx/django-rest-framework-simplejwt
5,079
3294097
__version__ = '3.3'
0
0
0
0
0
0
mantraml/ui/core/models.py
RJT1990/mantra
330
3294115
<reponame>RJT1990/mantra<filename>mantraml/ui/core/models.py import boto3 from collections import Counter import datetime import os import shutil import yaml from django.db import models from .consts import MANTRA_DEVELOPMENT_TAG_NAME from .mantra import Mantra from .forms import StartInstanceForm, StopInstanceForm, ...
0
0
0
0
0
0
build_tools/waf_content.py
Krzlfx/defold
2,231
3294126
from __future__ import annotations import Task import Utils from TaskGen import extension, before, feature import hashlib, sys, os # NOTE: This must be included explicitly prior to any modules with fields that set [(resource) = true]. # Otherwise field_desc.GetOptions().ListFields() will return [] for the first loaded...
2
7
0
0
9
0
tools/idl_parser/idl_node.py
nagineni/chromium-crosswalk
231
3294130
<reponame>nagineni/chromium-crosswalk #!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys # # IDL Node # # IDL Node defines the IDLAttribute and IDLNode objects which are ...
0
0
0
0
0
0
home.admin/BlitzTUI/blitztui/client.py
PatrickScheich/raspiblitz
1,908
3294166
<reponame>PatrickScheich/raspiblitz<gh_stars>1000+ # -*- coding: utf-8 -*- import base64 import codecs import logging import os import sys from os.path import isfile import grpc log = logging.getLogger(__name__) IS_WIN32_ENV = sys.platform == "win32" if IS_WIN32_ENV: cur_path = os.path.abspath(os.path.curdir) ...
0
0
0
0
0
0
code_examples/python_regression_classification/notebooks/util/util.py
mikofski/thw-berkeley
106
3294202
from __future__ import annotations import itertools import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import classification_report,confusion_matrix def plot_confusion_matrix(cm, classes, normalize: bool=False, title: str='Confusion matrix', ...
3
0
0
0
3
0
examples/examples-by-ml-library/main.py
operatorai/modelstore
151
3294211
import json import click from libraries import ( annoy_example, catboost_example, fastai_example, gensim_example, keras_example, lightgbm_example, mxnet_example, onnx_example, prophet_example, pytorch_example, pytorch_lightning_example, raw_file_example, sklearn_exa...
0
0
0
0
0
0
packages/vaex-server/vaex/server/server.py
sethvargo/vaex
337
3294213
from .fastapi import main
0
0
0
0
0
0
451-500/481-magical-string.py
bbram10/leetcode-master
134
3294237
from __future__ import annotations """ STATEMENT The string S consisting of only '1' and '2' is magical because concatenating the number of contiguous occurrences of characters '1' and '2' generates the string S itself. The first few elements of string S is the following: S = "1221121221221121122..." Given an integer N...
0
1
0
0
1
0
platypush/plugins/assistant/echo/__init__.py
RichardChiang/platypush
228
3294238
<reponame>RichardChiang/platypush """ .. moduleauthor:: <NAME> <<EMAIL>> """ import os from platypush.context import get_bus from platypush.plugins import action from platypush.plugins.assistant import AssistantPlugin from platypush.message.event.assistant import ConversationStartEvent, \ ConversationEndEvent, S...
0
0
0
0
0
0
utils/utils_test.py
google-research/pathdreamer
115
3294252
<gh_stars>100-1000 # Copyright 2021 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
regtests/c++/subscript.py
ahakingdom/Rusthon
622
3294267
''' simple subscript ''' def main(): a = []int(1,2,3) index = 0 a[ index ] = 100 print(a[index]) s = "hello world" print(s) print(s[0]) print(s[1]) print(s[2]) print(s[3]) if s[0]=='h': print('ok') else: print('error')
0
0
0
0
0
0
python-sdk-functional-test/base.py
yndu13/aliyun-openapi-python-sdk
1,001
3294285
<gh_stars>1000+ # Copyright 2018 Alibaba Cloud 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 r...
0
0
0
0
0
0
python/jittor/contrib.py
Exusial/jittor
2,571
3294286
<filename>python/jittor/contrib.py<gh_stars>1000+ # *************************************************************** # Copyright (c) 2021 Jittor. All Rights Reserved. # Maintainers: # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>>. # # This file is subject to the terms and conditions defined in #...
0
0
0
0
0
0
processing/run_openpose.py
google/aistplusplus_ap
189
3294298
<filename>processing/run_openpose.py<gh_stars>100-1000 # coding=utf-8 # Copyright 2020 The Google AI Perception Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://ww...
0
0
0
0
0
0
BurpExtensions/modules/webcommon.py
afollett/mywebappscripts
129
3294341
<filename>BurpExtensions/modules/webcommon.py import re def get_host_header_from_request(self,requestInfo): t1 = requestInfo.getHeaders() header_name='Host:' regex=re.compile('^.*%s.*'%header_name,re.IGNORECASE) for i in t1: #Search for the Host header m1=regex.match(i) #Extract and store the H...
0
0
0
0
0
0
src/test/resources/python-code-examples/import_from_var/use_imported.py
florayym/depends
146
3294348
from pkg.core import c c.foo()
0
0
0
0
0
0
netbox/ipam/forms/bulk_create.py
cybarox/netbox
4,994
3294354
from django import forms from utilities.forms import BootstrapMixin, ExpandableIPAddressField __all__ = ( 'IPAddressBulkCreateForm', ) class IPAddressBulkCreateForm(BootstrapMixin, forms.Form): pattern = ExpandableIPAddressField( label='Address pattern' )
0
0
0
0
0
0
del/test_stack.py
phasorhand/PyTorchText
1,136
3294394
<reponame>phasorhand/PyTorchText #encoding:utf-8 from torch.utils import data import torch as t import numpy as np from config import opt import models import json import fire import csv from torch.autograd import Variable import tqdm from glob import glob def load_data(test,labels_file): ''' data_root="/data/t...
0
0
0
0
0
0
engineering_tools/RouteCreation_KML2CSV.py
adamlm/carma-platform
112
3294412
<gh_stars>100-1000 #!/usr/bin/python # Copyright (C) 2018-2021 LEIDOS. # # 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 a...
0
0
0
0
0
0
hummingbot/strategy/dev_1_get_order_book/start.py
BGTCapital/hummingbot
3,027
3294423
#!/usr/bin/env python from hummingbot.connector.exchange_base import ExchangeBase from hummingbot.strategy.dev_1_get_order_book import GetOrderBookStrategy from hummingbot.strategy.dev_1_get_order_book.dev_1_get_order_book_config_map import dev_1_get_order_book_config_map def start(self): try: exchange: ...
0
0
3
0
3
0
RecoEgamma/EgammaIsolationAlgos/python/egmGedGsfElectronPFIsolation_cff.py
ckamtsikis/cmssw
852
3294439
<reponame>ckamtsikis/cmssw<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms egmGedGsfElectronPFNoPileUpIsolation = cms.EDProducer( "CITKPFIsolationSumProducer", srcToIsolate = cms.InputTag("gedGsfElectrons"), srcForIsolationCone = cms.InputTag('pfNoPileUpCandidates'), isolationConeDefinitions...
0
0
0
0
0
0
api/v2/serializers/details/project_volume.py
simpsonw/atmosphere
197
3294446
from core.models import Project, Volume from rest_framework import serializers from api.v2.serializers.summaries import ProjectSummarySerializer from .volume import VolumeSerializer class ProjectRelatedField(serializers.PrimaryKeyRelatedField): def get_queryset(self) -> object: return Project.objects.all(...
0
5
1
0
6
0
fastseq/ops/ngram_repeat_block.py
nttcs-ds/fastseq
346
3294451
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. """ Wrapper for ngram_repeat_block cuda extension """ from torch import nn from torch.autograd import Function import ngram_repeat_block_cuda class NGramRepeatBlockFunction(Function): """ forward inputs to ngram_repeat_block cuda extensi...
0
2
0
0
2
0