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
DQMOffline/JetMET/test/BeamHaloAnalyzer_cfg.py
ckamtsikis/cmssw
852
1711838
import FWCore.ParameterSet.Config as cms process = cms.Process("TEST") process.load("Configuration.StandardSequences.GeometryRecoDB_cff") process.load("Configuration/StandardSequences/MagneticField_cff") process.load("Configuration/StandardSequences/FrontierConditions_GlobalTag_cff") process.load("Configuration/Standa...
0
0
0
0
0
0
mmaction/models/tenons/spatial_temporal_modules/non_local.py
arpanmangal/coinaction
1,929
1711842
<filename>mmaction/models/tenons/spatial_temporal_modules/non_local.py import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import constant_init, kaiming_init from ...registry import SPATIAL_TEMPORAL_MODULES @SPATIAL_TEMPORAL_MODULES.register_module class NonLocalModule(nn.Module): def...
0
0
0
0
0
0
lib/firewall/generic.py
ikstream/Zeus-Scanner
841
1711865
<gh_stars>100-1000 import re from lib.core.common import HTTP_HEADER from lib.core.settings import PROTECTION_CHECK_PAYLOAD __item__ = "Generic (Unknown)" def detect(content, **kwargs): content = str(content) headers = kwargs.get("headers", None) status = kwargs.get("status", None) if status == 40...
0
0
0
0
0
0
droid_slam/modules/gru.py
TruongKhang/DROID-SLAM
547
1711878
<gh_stars>100-1000 import torch import torch.nn as nn class ConvGRU(nn.Module): def __init__(self, h_planes=128, i_planes=128): super(ConvGRU, self).__init__() self.do_checkpoint = False self.convz = nn.Conv2d(h_planes+i_planes, h_planes, 3, padding=1) self.convr = nn.Conv2d(h_plan...
0
0
0
0
0
0
stonesoup/mixturereducer/__init__.py
Red-Portal/Stone-Soup-1
157
1711886
# -*- coding: utf-8 -*- from .base import MixtureReducer __all__ = ['MixtureReducer']
0
0
0
0
0
0
notebooks/Ch07_Analyzing_Movie_Reviews_Sentiment/topic_model_utils.py
baoqt2/practical-machine-learning-with-python
1,989
1711926
<gh_stars>1000+ # -*- coding: utf-8 -*- """ Created on Tue Aug 8 20:54:15 2017 @author: DIP @Copyright: <NAME> """ import numpy as np # prints components of all the topics # obtained from topic modeling def print_topics_udf(topics, total_topics=1, weight_threshold=0.0001, ...
0
0
0
0
0
0
src/opendr/perception/face_recognition/algorithm/align/align.py
makistsantekidis/opendr
217
1711946
from __future__ import annotations from PIL import Image from .detector import detect_faces from .align_trans import get_reference_facial_points, warp_and_crop_face import numpy as np import os from tqdm import tqdm def face_align(data: object | None=None, dest: str='None', crop_size: int=112): source_root = data...
3
0
0
0
3
0
rapidsms/settings.py
catalpainternational/rapidsms
330
1711994
<reponame>catalpainternational/rapidsms<filename>rapidsms/settings.py #!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 PROJECT_NAME = "RapidSMS" PAGINATOR_OBJECTS_PER_PAGE = 12 PAGINATOR_BORDER_LINKS = 2 PAGINATOR_ADJACENT_LINKS = 2
0
0
0
0
0
0
release/stubs.min/Rhino/DocObjects/__init___parts/TextObject.py
htlcnn/ironpython-stubs
182
1712100
<filename>release/stubs.min/Rhino/DocObjects/__init___parts/TextObject.py class TextObject(AnnotationObjectBase): """ Represents a text object in a document. This is a wrapper for CRhinoAnnotationText. """ TextGeometry=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets the te...
0
0
0
0
0
0
pulsar/async/monitor.py
PyCN/pulsar
1,410
1712113
<gh_stars>1000+ import os import sys import asyncio from time import time from collections import OrderedDict import pulsar from .proxy import actor_proxy_future from .actor import Actor from .access import get_actor, set_actor, EventLoopPolicy from .mailbox import create_aid from .consts import ACTOR_STATES, MONITOR_...
0
0
0
0
0
0
kolla_ansible/exception.py
okleinschmidt/kolla-ansible
531
1712126
# Copyright (c) 2019 StackHPC 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 in wr...
0
0
0
0
0
0
deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/ATI/vertex_streams.py
ShujaKhalid/deep-rl
210
1712129
<gh_stars>100-1000 '''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GL import _types as _cs # End users want this... from OpenGL.raw.GL._types import * from OpenGL.raw.GL import _errors from OpenGL.constant import Constant as ...
0
0
0
0
0
0
examples/dacman_live_hilbert.py
lwerdna/debugger
155
1712142
<filename>examples/dacman_live_hilbert.py<gh_stars>100-1000 #!/usr/bin/env python # # display live code coverage of DACMAN Colecovision game running in MAME # drawn as Hilbert curve # # $ mame -v coleco -video soft -cart /path/to/DACMAN.ROM -window -nomax -resolution 560x432 -debugger gdbstub -debug # $ ./dacman_live_h...
0
0
0
0
0
0
scripts/layers/samples/bear_APT.py
nickamon/attack-scripts
446
1712179
<reponame>nickamon/attack-scripts<filename>scripts/layers/samples/bear_APT.py import argparse import requests import json from stix2 import MemoryStore, Filter import re def generate(): """parse the STIX on MITRE/CTI and return a layer dict showing all techniques used by an APT group with phrase 'bear' in the grou...
0
0
0
0
0
0
ote_sdk/setup.py
ntyukaev/training_extensions
775
1712189
""" setup file for OTE SDK """ # Copyright (C) 2021-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # from setuptools import find_packages, setup install_requires = [] with open("requirements.txt", "r", encoding="UTF-8") as f: for line in f: line = line.strip() if line and not line....
0
0
0
0
0
0
tfumap/semisupervised_plotting.py
EhsanKA/ParametricUMAP_paper
124
1712194
<gh_stars>100-1000 import seaborn as sns import numpy as np import matplotlib.pyplot as plt import tensorflow as tf from tfumap.umap import retrieve_tensors from sklearn.decomposition import PCA from tqdm.autonotebook import tqdm def batch(x, batch_size=100): n_batch = int(np.ceil((len(x) / batch_size))) retu...
0
0
0
0
0
0
haishoku/alg.py
Ahmetaksungur/Image-Recognition-API-Python
260
1712318
<reponame>Ahmetaksungur/Image-Recognition-API-Python<filename>haishoku/alg.py<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2017-05-15 15:10 # @Author : Gin (<EMAIL>) # @Link : # @Disc : alg about palette def sort_by_rgb(colors_tuple): """ colors_tuple contains color count an...
0
0
0
0
0
0
test-framework/test-suites/unit/tests/command/stack/commands/list/firmware/make/test_command_stack_commands_list_firmware_make_plugin_basic.py
kmcm0/stacki
123
1712351
from unittest.mock import create_autospec, ANY import pytest from stack.commands import DatabaseConnection from stack.commands.list.firmware import Command from stack.commands.list.firmware.make.plugin_basic import Plugin class TestListFirmwareMakeBasicPlugin: """A test case for the list firmware make basic plugin.""...
0
1
0
0
1
0
airbyte-integrations/connectors/source-trello/unit_tests/test_incremental_streams.py
OTRI-Unipd/OTRI-airbyte
6,215
1712365
# # Copyright (c) 2021 Airbyte, Inc., all rights reserved. # from airbyte_cdk.models import SyncMode from pytest import fixture from source_trello.source import IncrementalTrelloStream @fixture def patch_incremental_base_class(mocker): # Mock abstract methods to enable instantiating abstract class mocker.pa...
0
0
0
0
0
0
gluoncv/torch/data/gluoncv_motion_dataset/dataset_pre_processor.py
Kh4L/gluon-cv
5,447
1712403
from __future__ import annotations import os import random import logging import ray from pathlib import Path from tqdm import tqdm from .io.video_io import VideoFrameReader, write_img_files_to_vid_ffmpeg, \ resize_and_write_video_ffmpeg, convert_vid_ffmpeg from .utils.serialization_utils import save_json from .da...
29
5
0
0
34
0
pyquante2/dft/functionals.py
berquist/pyquante2
107
1712404
""" Notes on functionals in pyquante2. 1. I would like for all operations here to be array-scale operations. - This means e.g. np.power rather than pow 2. I would like as few memory copies as possible. 3. Need to decide how to handle redundant information, i.e. - rhoa and rhob when non-spin-polarized ...
10
25
0
0
35
0
alipay/aop/api/response/AnttechBlockchainRiskHttpproxyQueryResponse.py
antopen/alipay-sdk-python-all
213
1712409
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AnttechBlockchainRiskHttpproxyQueryResponse(AlipayResponse): def __init__(self): super(AnttechBlockchainRiskHttpproxyQueryResponse, self).__init__() self._response: N...
0
3
0
3
6
0
scvelo/core/tests/__init__.py
WeilerP/scvelo
272
1712439
from .test_base import get_adata, TestBase __all__ = ["get_adata", "TestBase"]
0
0
0
0
0
0
webauthn/helpers/parse_attestation_statement.py
MasterKale/py_webauthn
409
1712448
<reponame>MasterKale/py_webauthn<filename>webauthn/helpers/parse_attestation_statement.py from .structs import AttestationStatement def parse_attestation_statement(val: dict) -> AttestationStatement: """ Turn `response.attestationObject.attStmt` into structured data """ attestation_statement = Attesta...
0
0
0
0
0
0
PyEngine3D/OpenGLContext/RenderBuffer.py
ubuntunux/PyEngine3D
121
1712463
<reponame>ubuntunux/PyEngine3D from OpenGL.GL import * from OpenGL.GL.ARB.framebuffer_object import * from OpenGL.GL.EXT.framebuffer_object import * from PyEngine3D.Common import logger from PyEngine3D.Utilities import GetClassName from .Texture import Texture class RenderBuffer(Texture): target = GL_RENDERBUFFE...
0
0
0
0
0
0
scripts/experiments/intrinsic_evaluations/exbert/server/setup.py
antoilouis/netbert
480
1712474
<reponame>antoilouis/netbert<gh_stars>100-1000 from setuptools import setup, find_packages requires = [] # Let conda handle requires setup( name="exbert", description="Vis", packages=find_packages(), author="<NAME>", include_package_data=True, install_requires=requires )
0
0
0
0
0
0
tests/test_encoder.py
Jaswanth-Devarinti/DeCLUTR
267
1712480
<gh_stars>100-1000 from pathlib import Path from typing import List import pytest import torch from declutr import Encoder from hypothesis import given, settings from hypothesis.strategies import booleans from torch.nn import CosineSimilarity class TestEncoder: cosine = CosineSimilarity(dim=-1) # The base m...
0
0
0
0
0
0
src/pythae/models/normalizing_flows/maf/__init__.py
clementchadebec/benchmark_VAE
143
1712513
<filename>src/pythae/models/normalizing_flows/maf/__init__.py """ Implementation of the Masked Autoregressive Flow (MAF) proposed in (https://arxiv.org/abs/1502.03509) """ from .maf_config import MAFConfig from .maf_model import MAF __all__ = ["MAF", "MAFConfig"]
0
0
0
0
0
0
api/features/multivariate/migrations/0004_alter_multivariatefeatureoption_string_value.py
SolidStateGroup/Bullet-Train-API
126
1712526
<reponame>SolidStateGroup/Bullet-Train-API # Generated by Django 3.2.12 on 2022-04-19 07:18 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('multivariate', '0003_merge_20220131_1532'), ] operations = [ migrations.AlterField( ...
0
0
0
0
0
0
src/lobe/results.py
AeroboticsGlobalTeam/lobe-python
130
1712568
import json from typing import List, Dict from .api_constants import LABEL, CONFIDENCE, PREDICTIONS from .signature_constants import ( PREDICTED_LABEL_COMPAT, LABEL_CONFIDENCES, LABEL_CONFIDENCES_COMPAT, SUPPORTED_EXPORT_VERSIONS ) from .utils import dict_get_compat class ClassificationResult: """ Data s...
3
3
0
0
6
0
tests/test_model_decision.py
luisccalves/supplychainpy
231
1712583
<reponame>luisccalves/supplychainpy<filename>tests/test_model_decision.py<gh_stars>100-1000 from unittest import TestCase import logging from supplychainpy.model_decision import analytical_hierarchy_process logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') class TestAnalyti...
0
0
0
0
0
0
algorithms/Python/strings/word_count.py
Tanmoy07tech/DSA
247
1712604
import re test_string = '"the" is the most used word in the English language' def word_count(s: str) -> int: """ >>> word_count(test_string) 10 """ s = re.sub('[^A-Za-z0-9 ]+', '', s) return len(s.lower().split()) def unique_word_count(s: str) -> int: """ >>> unique_word_count(test_...
2
2
0
0
4
0
tests/cupyx_tests/linalg_tests/sparse_tests/__init__.py
prkhrsrvstv1/cupy
6,180
1712605
import pytest import cupy if cupy.cuda.runtime.is_hip: pytest.skip('HIP sparse support is not yet ready', allow_module_level=True)
0
0
0
0
0
0
extras/vgm_tool/vgm_upg.py
hsk/m1-gendev-gcc
212
1712609
#!/usr/bin/env python from optparse import OptionParser import struct class VGM_tool(object): # pcms: [(pcm_len, pcmdata)] pcms = [] # Tuple of (streamid, pcmdata) # pcm_lens: {start_addr, (index, addr_len, data)} pcm_lens = {} # Key: pcm_address Value: Tuple of (streamid, length, data...
0
0
0
0
0
0
metadata-ingestion/src/datahub/ingestion/source/sql/oracle.py
ShubhamThakre/datahub
1,603
1712614
from typing import Iterable, Optional from unittest.mock import patch # This import verifies that the dependencies are available. import cx_Oracle # noqa: F401 import pydantic from pydantic.fields import Field from sqlalchemy import event from sqlalchemy.dialects.oracle.base import OracleDialect from sqlalchemy.engin...
0
6
3
0
9
0
pyjs/pysm/test.py
takipsizad/pyjs
739
1712647
for x in range(5): print "hello", x, x / 2
0
0
0
0
0
0
src/utility.py
FrederikWarburg/NLSPN_ECCV20
181
1712670
<reponame>FrederikWarburg/NLSPN_ECCV20<gh_stars>100-1000 """ Non-Local Spatial Propagation Network for Depth Completion <NAME>, <NAME>, <NAME>, <NAME> and <NAME> European Conference on Computer Vision (ECCV), Aug 2020 Project Page : https://github.com/zzangjinsun/NLSPN_ECCV20 Author : <NAME> (<EMA...
0
0
0
0
0
0
test_python_toolbox/test_nifty_collections/test_weak_key_identity_dict/test_generic.py
hboshnak/python_toolbox
119
1712691
<reponame>hboshnak/python_toolbox # Copyright 2009-2017 <NAME>. # This program is distributed under the MIT license. '''Run generic weakref tests on `WeakKeyIdentityDict`.''' import gc import sys import unittest import collections import weakref import operator from test_python_toolbox.third_party import forked_mapp...
0
0
0
0
0
0
crawler/cdi/output.py
gaybro8777/CiteSeerX
108
1712715
#!/usr/bin/env # adopted from csxbot-0.3/csxcrawler/output.py import runconfig import os import sys import threading import urlparse import socket #from django.conf import settings import settings import _mysql_exceptions os.environ['DJANGO_SETTINGS_MODULE'] = runconfig.django_settings_module from django.db import ...
0
0
0
0
0
0
terrascript/resource/exoscale/exoscale.py
mjuenema/python-terrascript
507
1712724
<filename>terrascript/resource/exoscale/exoscale.py # terrascript/resource/exoscale/exoscale.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:16:07 UTC) import terrascript class exoscale_affinity(terrascript.Resource): pass class exoscale_compute(terrascript.Resource): pass class exoscale...
0
0
0
0
0
0
tests/test_actions.py
sharkguto/arsenic
281
1712760
<reponame>sharkguto/arsenic<gh_stars>100-1000 from operator import itemgetter from arsenic.actions import Mouse, Touch, chain from arsenic.session import Element from arsenic import constants ELEMENT_ONE = Element("1", None, None) ELEMENT_TWO = Element("2", None, None) ELEMENT_TRI = Element("3", None, None) def te...
0
0
0
0
0
0
google/datalab/ml/_util.py
freyrsae/pydatalab
198
1712770
<reponame>freyrsae/pydatalab # Copyright 2017 Google 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 re...
0
0
0
0
0
0
tests/annotations/__init__.py
sourya-deepsource/pdf-annotate
137
1712778
<reponame>sourya-deepsource/pdf-annotate # -*- coding: utf-8 -*- from pdf_annotate.annotator import PdfAnnotator from tests.files import SIMPLE ANNOTATORS = {} def setUpModule(): # For unit tests that still require a functional PdfAnnotator object, we # instantiate a global annotator at the module level. ...
0
0
0
0
0
0
test_on_images.py
playerkk/HoiTransformer
107
1712811
<gh_stars>100-1000 # ------------------------------------------------------------------------ # Licensed under the Apache License, Version 2.0 (the "License") # ------------------------------------------------------------------------ import argparse import random import os from tqdm import tqdm from PIL import Image ...
0
0
0
0
0
0
chrome/common/extensions/docs/server2/mock_function.py
nagineni/chromium-crosswalk
2,151
1712818
# Copyright 2013 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 class MockFunction(object): '''Decorates a function to record the number of times it's called, and use that to make te...
0
2
0
1
3
0
tests/test_vcr.py
Gikeda2016/Correios-olist
154
1712822
from unittest import mock import pytest from .vcr import replace_auth, vcr @pytest.fixture def username() -> str: return "cuca" @pytest.fixture def password() -> str: return "<PASSWORD>" @pytest.fixture def request_body(username, password) -> object: body = ( "<?xml version=''1.0'' encoding=...
0
3
0
0
3
0
tests/pylon_tests/emulated/importtest.py
matt-phair/pypylon
358
1712832
<reponame>matt-phair/pypylon from pylonemutestcase import PylonEmuTestCase from pypylon import pylon import unittest class ImportTestSuite(PylonEmuTestCase): # These are only "mounted" into the pylon namespace. So we ensure these are available here also def test_import_exceptions(self): from pypylon.p...
0
0
0
0
0
0
atlas/testing/acceptance/fixtures/submit_job_via_function_project_default_entrypoint/main.py
DeepLearnI/atlas
296
1712840
import foundations import json params = foundations.load_parameters() foundations.log_metric('how_i_lern', params['learning_rate']) foundations.log_metric('first_boi', params['layers'][0]['neurons']) foundations.log_metric('second_boi', params['layers'][1]['neurons'])
0
0
0
0
0
0
src/genie/libs/parser/nxos/tests/ShowRunningConfigBgp/cli/equal/golden_output_1_expected.py
balmasea/genieparser
204
1712844
<gh_stars>100-1000 expected_output = { "bgp": { "instance": { "default": { "bgp_id": 333, "protocol_shutdown": True, "vrf": { "management": { "graceful_restart": True, "log_neighbor_changes": False, "enforce_first_as": True, ...
0
0
0
0
0
0
osp/test/citations/jstor_record/test_volume.py
davidmcclure/open-syllabus-project
220
1712861
from osp.citations.jstor_record import JSTOR_Record def test_volume(mock_jstor): path = mock_jstor.add_article(issue_volume=200) assert JSTOR_Record(path).volume == '200'
0
0
0
0
0
0
custom_components/eufy_security/__init__.py
Nag94/HomeAssistantConfig
288
1712866
"""Define support for Eufy Security devices.""" from datetime import timedelta import logging from eufy_security import async_login from eufy_security.errors import EufySecurityError, InvalidCredentialsError import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT from homeassistant.const impor...
0
3
0
0
3
0
tools/vm-migrator/migrator/machine_type_mapping.py
ruchirjain86/professional-services
2,116
1712870
#!/usr/bin/env python # Copyright 2021 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
0
0
0
0
0
0
docs/examples/python/ssession_test_server.py
radetsky/themis
1,561
1712871
# # Copyright (c) 2015 Cossack Labs Limited # # 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...
0
2
0
0
2
0
src/modules/mod_tracker_lastfm.py
albertz/music-player
132
1712891
# MusicPlayer, https://github.com/albertz/music-player # Copyright (c) 2012, <NAME>, www.az2000.de # All rights reserved. # This code is under the 2-clause BSD license, see License.txt in the root directory of this project. """ This is the Last.fm tracker module. """ from utils import * import sys from State import s...
0
3
0
0
3
0
testsuite/normalize-reg/run.py
LongerVision/OpenShadingLanguage
1,105
1712914
<filename>testsuite/normalize-reg/run.py<gh_stars>1000+ #!/usr/bin/env python # Copyright Contributors to the Open Shading Language project. # SPDX-License-Identifier: BSD-3-Clause # https://github.com/AcademySoftwareFoundation/OpenShadingLanguage command += testshade("--center -t 1 -g 32 32 -od uint8 -o Cout normal...
0
0
0
0
0
0
docs/experimental/viz_brick_wall.py
iamansoni/fury
149
1712929
# To be removed, 1 brick = 1 actor, inefficient. import numpy as np from fury import window, actor, ui import itertools import pybullet as p # Instantiate Pybullet client. client = p.connect(p.DIRECT) # Apply gravity to the scene. p.setGravity(0, 0, -10, physicsClientId=client) # Creating BALL # Ball actor ball_acto...
0
0
0
0
0
0
WebMirror/management/rss_parser_funcs/feed_parse_extractItsgellisalinHomeBlog.py
fake-name/ReadableWebProxy
193
1712931
def extractItsgellisalinHomeBlog(item) -> None: ''' DISABLED Parser for 'itsgellisalin.home.blog' ''' # Gone return None
0
1
0
0
1
0
src/justcause/data/sets/__init__.py
solalatus/justcause
114
1712958
<reponame>solalatus/justcause """Contains some of the most used reference data sets for method evaluation For a more detailed explanation of the data sets, see Section 4.2 "Existing Benchmarking Datasets" in the thesis under (docs/thesis-mfranz.pdf) [1] BEWARE: The performance of the data set accessors is highly depe...
0
0
0
0
0
0
infra/build/functions/request_build_test.py
FeliciaLim/oss-fuzz
7,629
1712967
<gh_stars>1000+ # 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
0
0
0
0
0
0
vollib/black/implied_volatility.py
PythonCharmers/vollib
200
1712996
<filename>vollib/black/implied_volatility.py # -*- coding: utf-8 -*- """ vollib.black.implied_volatility ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A library for option pricing, implied volatility, and greek calculation. vollib is based on lets_be_rational, a Python wrapper for LetsBeRationa...
0
0
0
0
0
0
pypher/exception.py
pbabics/Pypher
116
1713049
<reponame>pbabics/Pypher<gh_stars>100-1000 class PypherException(Exception): pass class PypherAliasException(PypherException): pass class PypherArgumentException(PypherException, ValueError): pass
0
0
0
0
0
0
Configuration/ProcessModifiers/python/pixelNtupletFit_cff.py
Purva-Chaudhari/cmssw
852
1713050
<reponame>Purva-Chaudhari/cmssw import FWCore.ParameterSet.Config as cms # This modifier is for replacing the legacy pixel tracks with the "Patatrack" pixel ntuplets, # fishbone cleaning, and either the Broken Line fit (by default) or the Riemann fit. # It also replaces the "gap" pixel vertices with a density-based ve...
0
0
0
0
0
0
recipes/Python/578634_Pyqt__Pyside_threadsafe_callbacks__maloop/recipe-578634.py
tdiprima/code
2,023
1713124
""" ActiveState: http://code.activestate.com/recipes/578634-pyqt-pyside-thread-safe-callbacks-main-loop-integr/ ref and proxy classes are based on: http://code.activestate.com/recipes/81253/#c5 Modified proxy to support a quiet concept for callbacks that can simply pass if they were not valid, instead of raising...
0
0
0
0
0
0
sdk/keyvault/azure-keyvault-secrets/tests/_shared/preparer_async.py
rsdoherty/azure-sdk-for-python
2,728
1713137
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ from unittest.mock import Mock from azure.core.credentials import AccessToken from azure.identity.aio import EnvironmentCredential from .preparer import KeyVaultClient...
0
1
0
0
1
0
opy/_regtest/src/opy/misc/inspect_pyc.py
bb010g/oil
2,209
1713140
#! /usr/bin/env python from __future__ import print_function """inspect_pyc module This is a refactor of a recipe from <NAME>'s blog. He has given me permission to publish this. You can find the post at the following URL: http://nedbatchelder.com/blog/200804/the_structure_of_pyc_files.html You may use this modul...
0
0
0
0
0
0
djs_playground/admin.py
akarca/django-summernote
869
1713164
from django.conf import settings from django.contrib import admin from django.forms.widgets import Media from django_summernote.admin import SummernoteModelAdmin, SummernoteModelAdminMixin from django_summernote.utils import get_theme_files from .models import Post, Book, Author class BookAdmin(admin.ModelAdmin): ...
0
1
2
0
3
0
ad.py
rasmusmerzin/cli-visuals
105
1713192
<reponame>rasmusmerzin/cli-visuals<gh_stars>100-1000 #!/usr/bin/env python import os, sys, random, time, signal print("\033[?25l") def exit(sig, frame): print("\033[?25h") os.system("clear") sys.exit(0) signal.signal(signal.SIGINT, exit) def slt(st): return st.split("\n") def get_scr_size(): ...
0
0
0
0
0
0
redisenterprise/tests/conftest.py
OpeOnikute/integrations-extras
158
1713218
import os from time import sleep import pytest import requests from datadog_checks.dev import docker_run, get_docker_hostname, get_here BOOTSTRAP = { 'action': 'create_cluster', 'cluster': {'name': 'demo.local'}, 'node': {'paths': {'persistent_path': '/var/opt/redislabs/persist', 'ephemeral_path': '/var/...
0
0
0
0
0
0
benchmarks/zillow/Z1/runcprofile.py
rahulyesantharao/tuplex
778
1713229
<gh_stars>100-1000 # written for AWS instance... python3.6 -m cProfile runpython.py --mode tuple --path /data/zillow/Z1_preprocessed/zillow_Z1_10G.csv
0
0
0
0
0
0
api/tests/integration/sales_dashboard/test_integration_sales_dashboard.py
SolidStateGroup/Bullet-Train-API
126
1713243
<reponame>SolidStateGroup/Bullet-Train-API from django.urls import reverse from rest_framework import status from environments.dynamodb.migrator import IdentityMigrator def test_sales_dashboard_index(superuser_authenticated_client): """ VERY basic test to check that the index page loads. """ # Given...
0
0
0
0
0
0
python/plugins/plugins_plugin/init.py
mueller/mysql-shell
119
1713271
# Copyright (c) 2020, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2.0, # as published by the Free Software Foundation. # # This program is also distributed with certain software (including # but no...
4
6
0
0
10
0
IOMC/RandomEngine/test/testRandomServiceTest1_cfg.py
ckamtsikis/cmssw
852
1713323
import FWCore.ParameterSet.Config as cms process = cms.Process("TEST") process.options = cms.untracked.PSet( numberOfStreams = cms.untracked.uint32(1) ) process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring( 'file:testRandomServiceMerge1.root' ), firstRun = cms.untracked...
0
0
0
0
0
0
strawberry/fastapi/handlers/graphql_transport_ws_handler.py
TheVinhLuong102/Strawberry
2,062
1713362
from typing import Any from strawberry.asgi.handlers import ( GraphQLTransportWSHandler as BaseGraphQLTransportWSHandler, ) class GraphQLTransportWSHandler(BaseGraphQLTransportWSHandler): async def get_context(self) -> Any: return await self._get_context() async def get_root_value(self) -> Any: ...
0
2
0
0
2
0
kapture_localization/pairing/observations.py
jkabalar/kapture-localization
118
1713370
# Copyright 2020-present NAVER Corp. Under BSD 3-clause license import logging from itertools import combinations import multiprocessing from typing import Dict, List, Optional, Tuple, Set import gc from tqdm import tqdm from kapture_localization.utils.logging import getLogger import kapture_localization.utils.path_t...
23
6
0
0
29
0
src/e2eflow/core/supervised.py
3bhady/UnFlow
281
1713383
from __future__ import annotations import tensorflow as tf import tensorflow.contrib.slim as slim import numpy as np from .augment import random_photometric from .flow_util import flow_to_color from .losses import charbonnier_loss from .flownet import flownet from .unsupervised import _track_image, _track_loss, FLOW_S...
1
1
0
0
2
0
popmon/stitching/hist_stitcher.py
ing-bank/popmon
265
1713405
# Copyright (c) 2021 ING Wholesale Banking Advanced Analytics # # 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, mo...
18
8
0
1
27
0
tests/test_all_tables_e2e/__init__.py
mgedmin/terminaltables
742
1713425
<reponame>mgedmin/terminaltables<gh_stars>100-1000 """Allows importing from screenshot."""
0
0
0
0
0
0
setup.py
janwilamowski/rmate-python
126
1713442
from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='rmate', version='1....
0
0
0
0
0
0
deep-rl/lib/python2.7/site-packages/OpenGL/raw/EGL/VERSION/EGL_1_3.py
ShujaKhalid/deep-rl
210
1713471
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.EGL import _types as _cs # End users want this... from OpenGL.raw.EGL._types import * from OpenGL.raw.EGL import _errors from OpenGL.constant import Constant as _C import ctype...
0
1
0
0
1
0
modules/template.py
mehrdad-shokri/backdoorme
796
1713518
<reponame>mehrdad-shokri/backdoorme<gh_stars>100-1000 #This is a template for your use to add additional modules. Modules are used to make a backdoor more potent, stealthy, or dangerous, but feel free to add anything you think might help! Places you need to input are designated by ~tildes~. from .module import * class...
0
0
0
0
0
0
Chapter5/ex_5_7.py
zxjzxj9/PyTorchIntroduction
205
1713531
""" 该代码仅为演示函数签名和所用方法,并不能实际运行 """ # classmothod:类方法,返回nn.Embedding类的实例 torch.nn.Embedding.from_pretrained(embeddings, freeze=True, padding_idx=None, max_norm=None, norm_type=2.0, scale_grad_by_freq=False, sparse=False)
0
0
0
0
0
0
python/example/client_coroutines_demo.py
fsksf/harpc
270
1713536
# -*- coding: utf-8 -*- import sys import logging import gevent import time from tutorial import TutorialService from bfd.harpc import client from bfd.harpc.common import config from bfd.harpc.common import monkey # 协程调用的时候要进行打入package,替换掉线程的一些库 monkey.patch_all() logging.basicConfig(level=logging.DEBUG, ...
0
0
0
0
0
0
src/ralph/data_center/migrations/0012_custom_move_to_networks.py
DoNnMyTh/ralph
1,668
1713551
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import mptt.fields import ralph.networks.fields import django.db.models.deletion class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [ ('data_center', '0011_change_networks_mo...
0
0
4
0
4
0
pysen/plugin_loader.py
pfnet/pysen
423
1713559
import importlib import pathlib from types import ModuleType from typing import Optional from . import py_module from .exceptions import InvalidPluginError from .plugin import PluginBase from .py_module import _parse_entry_point def _load(module: ModuleType, func_name: str) -> PluginBase: entry_point = getattr(m...
6
4
0
0
10
0
tests/test_convert.py
akaszynski/pyansys
194
1713571
import os import pytest from ansys.mapdl import core as pymapdl from ansys.mapdl.core import examples def test_convert_no_use_function_names(tmpdir): vm_file = examples.vmfiles["vm1"] pyscript = str(tmpdir.mkdir("tmpdir").join("vm1.py")) clines = pymapdl.convert_script( vm_file, pyscript, loglevel...
0
0
0
0
0
0
scirpy/datasets/_processing_scripts/wu2020_3k.py
BenTenmann/scirpy
104
1713574
<reponame>BenTenmann/scirpy import scanpy as sc import pandas as pd # Use this list of 3k barcodes for consistency with previous versions barcodes = pd.read_csv("./3k_barcodes.csv", header=None)[0].values adata = sc.read_h5ad("wu2020.h5ad") adata = adata[barcodes, :].copy() adata.write_h5ad("wu2020_3k.h5ad", compres...
0
0
0
0
0
0
test/python/basicaer/test_statevector_simulator.py
Roshan-Thomas/qiskit-terra
1,456
1713584
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2018. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
0
0
1
0
1
0
twilio/rest/voice/v1/source_ip_mapping.py
BrimmingDev/twilio-python
1,362
1713596
<reponame>BrimmingDev/twilio-python<filename>twilio/rest/voice/v1/source_ip_mapping.py # coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import values from twilio.base.instance_context import Inst...
0
0
0
0
0
0
tests/test_loaders.py
zanachka/spidermon
405
1713613
<reponame>zanachka/spidermon<filename>tests/test_loaders.py<gh_stars>100-1000 import pytest from spidermon import MonitorLoader from spidermon.exceptions import InvalidMonitor from .fixtures.cases import * from .test_suites import check_suite @pytest.fixture def loader(): return MonitorLoader() def test_loadi...
0
0
0
0
0
0
care/utils/queryset/facility.py
gigincg/care
189
1713614
<filename>care/utils/queryset/facility.py from care.facility.models.facility import Facility from care.users.models import User from care.utils.cache.cache_allowed_facilities import get_accessible_facilities def get_facility_queryset(user): queryset = Facility.objects.all() if user.is_superuser: pass ...
0
0
0
0
0
0
build/numpy/numpy/lib/tests/test_shape_base.py
crougeux/-a-i_v1.6.3_modif
742
1713618
<gh_stars>100-1000 from __future__ import division, absolute_import, print_function from numpy.testing import * from numpy.lib import * from numpy.core import * from numpy import matrix, asmatrix class TestApplyAlongAxis(TestCase): def test_simple(self): a = ones((20, 10), 'd') assert_array_equal(...
0
0
0
0
0
0
monk/pytorch/schedulers/imports.py
take2rohit/monk_v1
542
1713639
import os import sys import warnings warnings.filterwarnings("ignore", category=FutureWarning) warnings.simplefilter(action='ignore', category=Warning) import torch
0
0
0
0
0
0
system/models/collect.py
z1pti3/jimi
111
1713645
from __future__ import annotations import time import jimi class _collect(jimi.action._action): useCustomData = bool() customData: dict[object,object] = dict() limit = int() def __init__(self,restrictClass: bool=True) -> object: self.events: list[object] = [] return super(_collect, self).__init__(restrictCla...
1
2
1
1
5
0
src/ethereum/homestead/state.py
muddlebee/execution-specs
152
1713675
<filename>src/ethereum/homestead/state.py """ State ^^^^^ .. contents:: Table of Contents :backlinks: none :local: Introduction ------------ The state contains all information that is preserved between transactions. It consists of a main account trie and storage tries for each contract. There is a distinct...
0
0
0
0
0
0
test/run/t471.py
timmartin/skulpt
2,671
1713688
def helper(got,expect): if got == expect: print True else: print False, expect, got print "\nstr.count" helper('abcd abcba '.count('abc'),2) helper('abcd abcba '.count('z'),0) helper('abcd abcba '.count('abc',1),1) helper('abcd abcba '.count('abc',-1),0) helper('abcd abcba '.count('abc',5),1) helper('abcd abc...
0
0
0
0
0
0
mayan/apps/acls/tests/test_api.py
eshbeata/open-paperless
2,743
1713711
from __future__ import absolute_import, unicode_literals from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType from django.test import override_settings from django.urls import reverse from rest_framework.test import APITestCase from documents.models import Documen...
0
0
0
0
0
0
controle_estoque/Crud/CrudFormaPagamento.py
jucimar1/controleEstoque
134
1713713
# -*- coding: utf-8 -*- from sqlalchemy.exc import IntegrityError from sqlalchemy import desc from Crud.core import Conexao from Crud.Models import FormaPagamento class CrudFormaPagamento(object): def __init__(self, id: str="", formaPagamento: str="", query: str=""): self.id = id self.formaPagam...
3
1
0
0
4
0
tests/test_pickling.py
robertsont/ngboost
1,255
1713721
<filename>tests/test_pickling.py import pickle import numpy as np import pytest from ngboost import NGBClassifier, NGBRegressor, NGBSurvival from ngboost.distns import MultivariateNormal # name = learners_data to avoid pylint redefined-outer-name @pytest.fixture(name="learners_data") def fixture_learners_data(breas...
0
0
0
0
0
0
softmax/softmax_test.py
eliben/deep-learning-samples
183
1713724
<filename>softmax/softmax_test.py # Tests for softmax. # # <NAME> (http://eli.thegreenplace.net) # This code is in the public domain from __future__ import print_function import numpy as np import unittest from softmax import * def eval_numerical_gradient(f, x, verbose=False, h=1e-5): """A naive implementation o...
0
0
0
0
0
0
atp-auto-core-open/atp/extensions.py
rebecca1202/testAuto
130
1713734
<reponame>rebecca1202/testAuto # -*- coding:utf-8 -*- import flask from flask_sqlalchemy import SQLAlchemy from celery import Celery from kombu import Exchange, Queue from atp.config.load_config import load_config from atp.env import RUNNING_ENV current_config = load_config(RUNNING_ENV) class FlaskCelery(Celery): ...
0
0
0
0
0
0