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
tests/components/bosch_shc/__init__.py
MrDelik/core
30,023
3237433
<reponame>MrDelik/core """Tests for the Bosch SHC integration."""
0
0
0
0
0
0
sdk/python/pulumi_azure/digitaltwins/endpoint_event_grid.py
henriktao/pulumi-azure
109
3237443
<filename>sdk/python/pulumi_azure/digitaltwins/endpoint_event_grid.py<gh_stars>100-1000 # 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! *** import warnings import pulumi import pulumi.run...
0
0
0
0
0
0
JetMETAnalysis/METSkims/python/metLow_HLTPaths_cfi.py
ckamtsikis/cmssw
852
3237472
<reponame>ckamtsikis/cmssw<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms import copy from HLTrigger.HLTfilters.hltHighLevel_cfi import * metPre1HLTFilter = copy.deepcopy(hltHighLevel) import copy from HLTrigger.HLTfilters.hltHighLevel_cfi import * metPre2HLTFilter = copy.deepcopy(hltHighLevel) import copy...
0
0
0
0
0
0
smarts/zoo/worker_pb2_grpc.py
Semanti1/smarts_baseline
554
3237476
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc import smarts.zoo.worker_pb2 as worker__pb2 class WorkerStub(object): """Interface exported by the worker server.""" def __init__(self, channel): ...
0
0
0
0
0
1
pytorch_tutorials/dqn/covid19/corona_choropleth.py
paulrschrater/tutorials
118
3237477
from __future__ import annotations import numpy as np import pandas as pd import plotly.express as px import pycountry from plotly.offline import plot metric = 'Recovery Rate' multiplier = 1 # Use this to manually lower the color scale (e.g. for Death Rate) # Load CSVs covid_df = pd.read_csv('https://raw.githubuserco...
5
3
0
0
8
0
nuplan/database/nuplan_db/rendering_utils.py
motional/nuplan-devkit
128
3237498
<reponame>motional/nuplan-devkit from __future__ import annotations # postpone evaluation of annotations import logging from functools import reduce from typing import List, Optional, Tuple import matplotlib.pyplot as plt import numpy as np import numpy.typing as npt import PIL.Image from matplotlib.axes import Axes...
0
0
0
0
0
0
classes/contrib/mypy/typeops/instance_context.py
ftaebi/classes
475
3237508
from typing import NamedTuple, Optional from mypy.plugin import MethodContext from mypy.types import CallableType, TupleType from mypy.types import Type as MypyType from typing_extensions import final from classes.contrib.mypy.typeops import inference @final class _InferredArgs(NamedTuple): """Represents our ar...
8
3
13
0
24
0
bin/counts_to_tpm.py
baraaorabi/flair
139
3237509
#!/usr/bin/env python3 import sys, csv, os try: counts_matrix = open(sys.argv[1]) outfilename = sys.argv[2] if len(sys.argv) > 3: sizefile = open(sys.argv[3]) else: sizefile = '' except: sys.stderr.write('usage: script.py counts_matrix.tsv count_matrix.tpm.tsv [iso.sizes]\n') sys.stderr.write('convenience s...
0
0
0
0
0
0
src/twisted/_threads/test/__init__.py
mathieui/twisted
9,953
3237527
# -*- test-case-name: twisted._threads.test -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted._threads}. """ from __future__ import absolute_import, division, print_function
0
0
0
0
0
0
runway/_cli/commands/_gen_sample/_k8s_cfn_repo.py
avosper-intellaegis/runway
134
3237530
<gh_stars>100-1000 """``runway gen-sample k8s-cfn`` command.""" import logging from pathlib import Path from typing import TYPE_CHECKING, Any, cast import click from cfn_flip import to_yaml from ....blueprints.k8s.k8s_iam import Iam from ....blueprints.k8s.k8s_master import Cluster from ....blueprints.k8s.k8s_workers...
0
0
0
0
0
0
pytransform3d/transformations/_transform_operations.py
alek5k/pytransform3d
304
3237535
"""Transform operations.""" import numpy as np from ..rotations import ( axis_angle_from_matrix, matrix_from_axis_angle, norm_vector) from ._utils import check_transform def invert_transform(A2B, strict_check: bool=True, check: bool=True) -> object: """Invert transform. Parameters ---------- A2B ...
15
8
0
0
23
0
24-class-metaprog/autoconst/autoconst.py
SeirousLee/example-code-2e
990
3237553
# tag::WilyDict[] class WilyDict(dict): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.__next_value: int = 0 def __missing__(self, key) -> object: if key.startswith('__') and key.endswith('__'): raise KeyError(key) self[key] = value = sel...
0
2
0
1
3
0
src/MultipleTableRestoreUtility/multitablerestore.py
rmcelroyF8/amazon-redshift-utils
2,452
3237570
<filename>src/MultipleTableRestoreUtility/multitablerestore.py # !/usr/bin/python """ multitablerestore.py * Copyright 2016, Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 Managed by adedotua 2017-12-23: PEP8 compliance 2017-12-23: Added cosmetic changes. Logs will now...
0
0
0
0
0
0
samples/x86/hello/hello32.py
EarthCompass/patchkit
631
3237593
<reponame>EarthCompass/patchkit<filename>samples/x86/hello/hello32.py def patch(pt): hello, size = pt.inject(raw='hello world\n', size=True) addr = pt.inject(asm=r''' push eax push ebx push ecx push edx mov eax, 4 # SYS_write mov ebx, 1 # fd mov ecx, %d # buf mov edx, %d # si...
0
0
0
0
0
0
examples/gto/25-multipole-integrals.py
robert-anderson/pyscf
501
3237601
<reponame>robert-anderson/pyscf #!/usr/bin/env python # # Author: <NAME> <<EMAIL>> # ''' Multipole integrals. (Be careful with the gauge origin of the multipole integrals). An implementation of multipoles (up to hexadecapole) can be found in https://github.com/cuanto/pyscf-scripts/blob/master/props/multipole_rhf.py ...
0
0
0
0
0
0
observations/r/meteo.py
hajime9652/observations
199
3237614
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import csv import numpy as np import os import sys from observations.util import maybe_download_and_extract def meteo(path) -> tuple[object, object]: """Meteorological Measurements ...
0
1
0
0
1
0
tests/terraform/checks/resource/azure/test_CustomRoleDefinitionSubscriptionOwner.py
pmalkki/checkov
4,013
3237629
import unittest import hcl2 from checkov.terraform.checks.resource.azure.CutsomRoleDefinitionSubscriptionOwner import check from checkov.common.models.enums import CheckResult class TestCustomRoleDefinitionSubscriptionOwner(unittest.TestCase): def test_failure_1(self): hcl_res = hcl2.loads(""" ...
0
0
0
0
0
0
model/layers/resized_fuse_test.py
iostermann/deeplab2
587
3237649
<filename>model/layers/resized_fuse_test.py # coding=utf-8 # Copyright 2021 The Deeplab2 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/LICENS...
0
0
0
0
0
0
packs/puppet/actions/cert_clean.py
jonico/st2contrib
164
3237661
from lib.python_actions import PuppetBasePythonAction __all__ = [ 'PuppetCertCleanAction' ] class PuppetCertCleanAction(PuppetBasePythonAction): def run(self, environment, host) -> object: success = self.client.cert_clean(environment=environment, host=host) return success
0
1
0
0
1
0
tests/flow/test_edge_index_scans.py
10088/RedisGraph
313
3237669
from common import * people = ["Roi", "Alon", "Ailon", "Boaz", "Tal", "Omri", "Ori"] redis_graph = None class testEdgeByIndexScanFlow(FlowTestsBase): def __init__(self): self.env = Env(decodeResponses=True) def setUp(self): global redis_graph redis_con = self.env.getConnection() ...
0
0
0
0
0
0
tests/support.py
jeevesy83/twitter-python-ads-sdk
162
3237673
import sys import string import random def with_resource(resource) -> object: return 'https://ads-api.twitter.com{resource}'.format(resource=resource) def with_fixture(name) -> object: f = open('tests/fixtures/{name}.json'.format(name=name), 'r') return f.read() def characters(length) -> object: char...
0
3
0
0
3
0
lbc/models/spatial_softmax.py
cgeller/WorldOnRails
108
3237675
<filename>lbc/models/spatial_softmax.py import numpy as np import torch import torch.nn.functional as F from torch import nn class SpatialSoftmax(nn.Module): def __init__(self, height, width): super().__init__() self.height = height self.width = width pos_x, pos_y = np.mes...
0
0
0
0
0
0
examples/transactions/get_tx_receipt_status.py
adamzhang1987/py-etherscan-api
458
3237687
<gh_stars>100-1000 from etherscan.transactions import Transactions import json with open('../../api_key.json', mode='r') as key_file: key = json.loads(key_file.read())['key'] TX_HASH = '0x513c1ba0bebf66436b5fed86ab668452b7805593c05073eb2d51d3a52f480a76' api = Transactions(api_key=key) receipt_status = api.get_tx_...
0
0
0
0
0
0
rake_french.py
YanaMos/RAKE-tutorial
394
3237691
from __future__ import absolute_import from __future__ import print_function __author__ = 'a_medelyan' import rake # EXAMPLE: Extracting single words from a French text # French stopwords stoppath = "FrenchStoplist.txt" # 1. initialize RAKE by providing a path to a stopwords file and setting phrase length in words t...
0
0
0
0
0
0
orator/dbal/platforms/keywords/postgresql_keywords.py
wjzero/orator
1,484
3237714
<reponame>wjzero/orator<filename>orator/dbal/platforms/keywords/postgresql_keywords.py # -*- coding: utf-8 -*- from .keyword_list import KeywordList class PostgreSQLKeywords(KeywordList): KEYWORDS = [ "ALL", "ANALYSE", "ANALYZE", "AND", "ANY", "AS", "ASC",...
0
0
0
0
0
0
SCRAPE/Lib/site-packages/twisted/python/_url.py
Chinmoy-Prasad-Dutta/scrapy_scraper
4,612
3237716
<gh_stars>1000+ # -*- test-case-name: twisted.python.test.test_url -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ URL parsing, construction and rendering. """ from hyperlink._url import URL __all__ = ["URL"]
0
0
0
0
0
0
ensemble/util/mkprd.py
topolphukhanh/kaggle-avazu
398
3237726
#!/usr/bin/env python3 import argparse, csv, sys from common import * if len(sys.argv) == 1: sys.argv.append('-h') parser = argparse.ArgumentParser() parser.add_argument('csv_path', type=str) parser.add_argument('out_path', type=str) parser.add_argument('prd_path', type=str) args = vars(parser.parse_args()) wi...
0
0
0
0
0
0
test/run/t233.py
timmartin/skulpt
2,671
3237747
# multiple instances of generator at the same time def genmaker(a, b): z = a*b def gen(y): for i in range(4): yield i,a,b,y,z return gen(a*a*b*b) g1 = genmaker(3, 4) g2 = genmaker(4, 5) print g1.next() print g2.next() print g1.next() print g2.next() print g1.next() print g2.next() pr...
0
0
0
0
0
0
lfs/criteria/utils.py
michael-hahn/django-lfs
345
3237751
<filename>lfs/criteria/utils.py from django.contrib.contenttypes.models import ContentType from lfs.core.utils import import_symbol from lfs.criteria.models import Criterion import logging logger = logging.getLogger(__name__) # DEPRECATED 0.8 def is_valid(request, object, product=None): """ Returns True if ...
0
0
0
0
0
0
spikeinterface/comparison/tests/test_studytools.py
khl02007/spikeinterface
116
3237768
<reponame>khl02007/spikeinterface import os import shutil import time import pickle import pytest from spikeinterface.extractors import toy_example from spikeinterface.comparison.studytools import (setup_comparison_study, iter_computed_names, iter_computed_sorting, ...
0
0
0
0
0
0
Boyer_Moore_Horspool/Python/jcla1/horspool.py
Mynogs/Algorithm-Implementations
1,184
3237790
<filename>Boyer_Moore_Horspool/Python/jcla1/horspool.py def horspool(haystack, needle): if len(needle) < 1: return -1 bad_match_table = dict() max_offset = len(haystack) - len(needle) last_index = len(needle) - 1 offset = 0 for index, letter in enumerate(needle): bad_match_tabl...
0
0
0
0
0
0
kaleidescope/kaleidescope.py
eedv/figma-api-demo
1,153
3237796
<filename>kaleidescope/kaleidescope.py<gh_stars>1000+ import argparse import requests import random from PIL import Image from io import BytesIO BLOCK_W = 8 BLOCK_H = 8 def extract_symbols(doc, file_key, headers): canvas = doc['document']['children'][0] symbols = [] guids = [] for node in canvas['chil...
0
0
0
0
0
0
openstack_dashboard/dashboards/project/key_pairs/tests.py
stackhpc/horizon
930
3237823
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
0
0
0
0
0
0
mermaid_demos/rdmm_synth_data_generation/moving_shape.py
HastingsGreer/mermaid
120
3237827
<gh_stars>100-1000 import numpy as np from mermaid.data_wrapper import MyTensor class MovingShape(): def __init__(self,shape,multi_gaussian_weights,using_weight=True, weight_type='w_K_w'): self.shape = shape self.multi_gaussian_weights = multi_gaussian_weights if weight_type!='w_K_w' else np.sqrt(m...
0
0
0
0
0
0
cmake-3.15.2/Source/cmConvertMSBuildXMLToJSON.py
GavinMilbank/Engine
107
3237834
<reponame>GavinMilbank/Engine<filename>cmake-3.15.2/Source/cmConvertMSBuildXMLToJSON.py # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. import argparse import codecs import copy import logging import json import os from coll...
0
0
0
0
0
0
Misc/combine_pdfs.py
sparkstark03/Awesome-Scripts
141
3237855
import PyPDF2, os #get all pdf files from directory pdf_files=[filename for filename in os.listdir('.') if filename.endswith('.pdf')] #sort filenames pdf_files.sort() count_merged_files = 0 pdfWriter = PyPDF2.PdfFileWriter() #copy each pdf file to the final output file for filename in pdf_files: print(f'Merging \'...
0
0
0
0
0
0
Day 8/day_8_end.py
loveyourpassion/comm
149
3237860
from __future__ import annotations class Animal(): name: str = 'Amy' noise: str = "Grunt" size: str = "Large" color: str = "Brown" hair: str = 'Covers body' def get_color(self, abc) -> object: return self.color + " " + abc @property def make_noise(self) -> object: return ...
2
2
5
0
9
0
dataprep/clean/components/cat_imputation/most_frequent_imputer.py
Waterpine/dataprep-1
1,229
3237870
<filename>dataprep/clean/components/cat_imputation/most_frequent_imputer.py """ Implement categorical most-frequent imputer. """ from typing import Any, List, Optional import dask.dataframe as dd class MostFrequentImputer: """Most frequent imputer for imputing categorical values Attributes: null_valu...
0
0
0
0
0
0
generator/setup.py
romulobusatto/google-api-php-client-services
709
3237910
#!/usr/bin/python2.7 # Copyright 2010 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 requi...
0
0
0
0
0
0
cocos/tests/test_numerics/test_dot/test_dot.py
michaelnowotny/cocos
101
3237916
<gh_stars>100-1000 import cocos.device import cocos.numerics as cn import numpy as np from cocos.options import GPUOptions def test_dot(): cocos.device.init() A_numpy = np.array([[1.0, 2], [3, 4.0]], dtype=np.float32) B_numpy = np.array([[5, 6], [7, 8]], dtype=np.float32) c_numpy = np.array([[5], [7...
0
0
0
0
0
0
modules/xbmc_notify.py
Slashbunny/maraschino
137
3237995
from flask import Flask, jsonify, render_template, request import os, urllib from maraschino import app, RUNDIR, logger from socket import * from xbmc.xbmcclient import * from maraschino.tools import get_file_list from maraschino.models import XbmcServer @app.route('/xhr/xbmc_notify', methods=['post']) def xhr_notify...
0
2
0
0
2
0
src/programy/storage/stores/file/store/rdfs.py
cdoebler1/AIML2
345
3238036
""" Copyright (c) 2016-2020 <NAME> http://www.keithsterling.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, m...
0
4
0
0
4
0
tests/utils/builtin_function_test_case.py
VeliborKrivokuca/batavia
1,256
3238043
from .adjust_code import adjust from .expected_failure import NotImplementedToExpectedFailure from .samples import SAMPLE_DATA, SAMPLE_SUBSTITUTIONS IGNORE_ORDER_DICTIONARY = { 'tuple': ['set', 'frozenset', 'dict'], 'list': ['set', 'frozenset', 'dict'], } def _builtin_test(test_name, datatype, operation, sma...
1
1
3
0
5
0
financial_life/examples/meta_data.py
MartinPyka/financial-life
141
3238051
<reponame>MartinPyka/financial-life ''' Created on 21.12.2016 @author: martin ''' # standard libraries from datetime import timedelta # third-party libraries # own libraries from financial_life.financing import accounts as a from financial_life.tax import germany as tax_ger def controller_tax(s): """ This is a...
0
0
0
0
0
0
pylearn2/optimization/linesearch.py
ikervazquezlopez/Pylearn2
2,045
3238056
from __future__ import annotations """ Note: this code is a Theano translation of the linesearch implemented in scipy.optimize.linesearch See : https://github.com/scipy/scipy/blob/master/scipy/optimize/linesearch.py """ import theano import theano.tensor as TT from theano.ifelse import ifelse from theano import s...
13
14
0
0
27
0
freeline_core/gradle_clean_build.py
phitattoo/freeline
6,094
3238059
# -*- coding:utf8 -*- from __future__ import annotations from __future__ import print_function import os from android_tools import InstallApkTask, CleanAllCacheTask from builder import CleanBuilder from gradle_tools import GenerateFileStatTask, BuildBaseResourceTask, get_project_info, GenerateAptFilesStatTask, \ ...
2
0
0
1
3
0
src/debugpy/_vendored/pydevd/tests_python/resources/my_code/my_code_exception_user_unhandled.py
r3m0t/debugpy
695
3238064
<reponame>r3m0t/debugpy def main(): import sys import os sys.path.append(os.path.dirname(os.path.dirname(__file__))) from not_my_code import other def callback2(): try:raise AssertionError() except:return False return True def callback1(): other.call_me_back2(...
0
0
0
0
0
0
usaspending_api/search/models/mv_other_award_search.py
g4brielvs/usaspending-api
217
3238154
<filename>usaspending_api/search/models/mv_other_award_search.py from usaspending_api.search.models.base_award_search import BaseAwardSearchModel class OtherAwardSearchMatview(BaseAwardSearchModel): class Meta: managed = False db_table = "mv_other_award_search"
0
0
0
0
0
0
pyrasterframes/src/main/python/pyrasterframes/rf_ipython.py
mjohns-databricks/rasterframes
180
3238157
# # This software is licensed under the Apache 2 license, quoted below. # # Copyright 2019 Astraea, 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/LI...
24
13
0
0
37
0
build/inverse_depth.py
knopp/buildroot
777
3238164
<reponame>knopp/buildroot<gh_stars>100-1000 #!/usr/bin/env python # Copyright 2014 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 os import sys def DoMain(argv): depth = argv[0] return os.path.relpath(os.getc...
0
0
0
0
0
0
starfish/core/util/enum.py
haoxusci/starfish
164
3238179
<reponame>haoxusci/starfish from typing import Iterable, List, Union from starfish.core.types import Axes def harmonize(iterable: Iterable[Union[Axes, str]]) -> List[str]: return list(str(v) for v in iterable)
0
0
0
0
0
0
src/compas_rhino/conduits/__init__.py
funkchaser/compas
235
3238187
""" ******************************************************************************** conduits ******************************************************************************** .. currentmodule:: compas_rhino.conduits .. rst-class:: lead Display conduits can be used to visualize iterative processes with less of a perf...
0
0
0
0
0
0
examples/pxScene2d/external/libnode-v0.12.7/tools/closure_linter/closure_linter/common/position.py
madanagopaltcomcast/pxCore
2,494
3238229
#!/usr/bin/env python # # Copyright 2008 The Closure Linter 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 #...
0
8
0
0
8
0
tests/python/pypackagecomplex/complex/unicode_data.py
sammorley-short/sphinx-autoapi
197
3238269
<reponame>sammorley-short/sphinx-autoapi # -*- coding: utf-8 -*- unicode_str = "αβγδεζηθικλμνξοπρςστυφχψ"
0
0
0
0
0
0
dconv.py
AnubhavHawk/haproxy-dconv
151
3238281
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2012 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
0
0
0
0
0
0
demo/cict_demo/cict_train_GAN.py
timothijoe/DI-drive
219
3238282
<filename>demo/cict_demo/cict_train_GAN.py import os import time import json import glob import torch import torch.optim as optim import torchvision.transforms as transforms from easydict import EasyDict from PIL import Image from torch.utils.data import DataLoader, WeightedRandomSampler from torchvision.transforms.tr...
0
0
0
0
0
0
py/phl/phlcon_reviewstatecache__it.py
aevri/phabricator-tools
150
3238305
"""Test suite for phlcon_reviewstatecache.""" # ============================================================================= # TEST PLAN # ----------------------------------------------------------------------------- # Here we detail the things we are concerned to test and specify whi...
0
2
0
0
2
0
research/ptn/model_voxel_generation.py
873040/Abhishek
3,326
3238314
# Copyright 2017 The TensorFlow 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 applicab...
2
7
0
0
9
0
RecoBTag/PerformanceDB/python/measure/Pool_btag110711.py
ckamtsikis/cmssw
852
3238318
<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms from CondCore.DBCommon.CondDBCommon_cfi import * PoolDBESSourcebtag = cms.ESSource("PoolDBESSource", CondDBCommon, toGet = cms.VPSet( # # working points # cms.PSet( record = cms....
0
0
0
0
0
0
tests-cuda/test_0645-jax-interop.py
BioGeek/awkward-1.0
519
3238340
<gh_stars>100-1000 # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE from __future__ import absolute_import import pytest # noqa: F401 import numpy as np # noqa: F401 import awkward as ak # noqa: F401 jax = pytest.importorskip("jax") jax.config.update("jax_platform_name", "gp...
0
0
0
0
0
0
tests/base.py
MaayanLab/aiohttp-wsgi
244
3238358
import unittest from collections import namedtuple from contextlib import contextmanager from tempfile import NamedTemporaryFile from typing import Any, AsyncGenerator, ContextManager, Generator, Iterable import aiohttp import asyncio from aiohttp_wsgi.wsgi import run_server, WSGIEnviron, WSGIStartResponse from aiohttp...
21
10
1
0
32
0
src/clusterfuzz/_internal/tests/core/bot/untrusted_runner/file_impl_test.py
mspectorgoogle/clusterfuzz
5,023
3238385
<filename>src/clusterfuzz/_internal/tests/core/bot/untrusted_runner/file_impl_test.py # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.or...
0
0
0
0
0
0
DQM/SiPixelPhase1Track/python/SiPixelPhase1ResidualsExtra_cfi.py
Purva-Chaudhari/cmssw
852
3238386
import FWCore.ParameterSet.Config as cms from DQMServices.Core.DQMEDHarvester import DQMEDHarvester SiPixelPhase1ResidualsExtra = DQMEDHarvester("SiPixelPhase1ResidualsExtra", TopFolderName = cms.string('PixelPhase1/Tracks/ResidualsExtra'), MinHits = cms.int32(30) )
0
0
0
0
0
0
grove/tomography/utils.py
mkeshita/grove
229
3238413
############################################################################## # Copyright 2017-2018 Rigetti Computing # # 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...
4
15
0
0
19
0
tests/nnapi/specs/V1_2/rsqrt_dynamic_nnfw.mod.py
periannath/ONE
255
3238436
<reponame>periannath/ONE # # Copyright (C) 2018 The Android Open Source Project # Copyright (c) 2020 Samsung Electronics Co., Ltd. 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 Lic...
0
0
0
0
0
0
tsc_main.py
RobRomijnders/LSTM_tsc
410
3238437
""" LSTM for time series classification This model takes in time series and class labels. The LSTM models the time series. A fully-connected layer generates an output to be classified with Softmax """ import numpy as np import tensorflow as tf #TF 1.1.0rc1 tf.logging.set_verbosity(tf.logging.ERROR) import matplotlib...
0
0
0
0
0
0
bibliopixel/control/extractor.py
rec/leds
253
3238443
import collections class Extractor: """ Extractor is a class that extracts and normalizes values from incoming message dictionaries into ordered dictionaries based on the `type` key of each message. """ def __init__(self, omit=None, normalizers=None, keys_by_type=None, accept...
0
0
0
0
0
1
examples/blur.py
szabolcsdombi/zengl
116
3238503
<gh_stars>100-1000 import numpy as np import zengl from objloader import Obj import assets from window import Window def kernel(s): x = np.arange(-s, s + 1) y = np.exp(-x * x / (s * s / 4)) y /= y.sum() v = ', '.join(f'{t:.8f}' for t in y) # from matplotlib import pyplot as plt # plt.plot(x, ...
0
0
0
0
0
0
utility/extract_pase.py
OlegJakushkin/s3prl
856
3238515
<filename>utility/extract_pase.py from pase.models.frontend import wf_builder pase = wf_builder('cfg/frontend/PASE+.cfg').eval() pase.load_pretrained('FE_e199.ckpt', load_last=True, verbose=True) pase.cuda() import sys wav_path = sys.argv[1] out_path = sys.argv[2] # Now we can forward waveforms as Torch tensors impor...
0
0
0
0
0
0
filebeat/datadog_checks/filebeat/__init__.py
divyamamgai/integrations-extras
158
3238526
<reponame>divyamamgai/integrations-extras from .__about__ import __version__ from .filebeat import FilebeatCheck __all__ = ["__version__", "FilebeatCheck"]
0
0
0
0
0
0
OpenAttack/utils/visualizer.py
e-tornike/OpenAttack
444
3238544
<reponame>e-tornike/OpenAttack import os import numpy as np widths = [ (126, 1), (159, 0), (687, 1), (710, 0), (711, 1), (727, 0), (733, 1), (879, 0), (1154, 1), (1161, 0), (4347, 1), (4447, 2), (7467, 1), (7521, 0), (8369, 1), (8426, 0), (9000, 1), (9002, 2...
0
0
0
0
0
0
tools/code_coverage/coverage_utils.py
mghgroup/Glide-Browser
575
3238596
<filename>tools/code_coverage/coverage_utils.py # Copyright 2018 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # The script intentionally does not have a shebang, as it is Py2/Py3 compatible. import argparse from colle...
0
0
0
0
0
0
mann/utils/metrics.py
tristandeleu/ntm-one-shot
457
3238621
<gh_stars>100-1000 import theano import theano.tensor as T import numpy as np # predictions is the argmax of the posterior def accuracy_instance(predictions, targets, n=[1, 2, 3, 4, 5, 10], \ nb_classes=5, nb_samples_per_class=10, batch_size=1): accuracy_0 = theano.shared(np.zeros((batch_size, nb_samples_...
0
0
0
0
0
0
codemod/helpers.py
aryangulati/codemod
3,811
3238622
<reponame>aryangulati/codemod import fnmatch import os def is_extensionless(path): """ Returns True if path has no extension. >>> is_extensionless("./www/test") True >>> is_extensionless("./www/.profile") True >>> is_extensionless("./www/.dir/README") True >>> is_extensionless("./...
0
0
0
0
0
0
cvpods/configs/rcnn_config.py
reinforcementdriving/cvpods
758
3238653
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) BaseDetection, Inc. and its affiliates. All Rights Reserved from __future__ import annotations from .base_detection_config import BaseDetectionConfig _config_dict = dict( MODEL=dict( # META_ARCHITECTURE='GeneralizedRCNN', LOAD_PROPOSAL...
1
0
0
0
1
0
terrascript/resource/jeremmfr/lvslb.py
mjuenema/python-terrascript
507
3238689
# terrascript/resource/jeremmfr/lvslb.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:21:22 UTC) import terrascript class lvslb_ipvs(terrascript.Resource): pass __all__ = [ "lvslb_ipvs", ]
0
0
0
0
0
0
TrainingExtensions/torch/test/python/test_graphmeta.py
lipovsek/aimet
945
3238725
<reponame>lipovsek/aimet<filename>TrainingExtensions/torch/test/python/test_graphmeta.py # /usr/bin/env python3.5 # -*- mode: python -*- # ============================================================================= # @@-COPYRIGHT-START-@@ # # Copyright (c) 2020, Qualcomm Innovation Center, Inc. All rights reserved....
0
0
0
0
0
0
e2e_samples/parking_sensors/tests/integrationtests/tests/dataconnectors/blob_storage.py
lucasfeiock/moderndw
307
3238727
<reponame>lucasfeiock/moderndw<gh_stars>100-1000 import os import logging import pytest from azure.storage.blob import BlobServiceClient LOG = logging.getLogger(__name__) DATA_DIR = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "data") @pytest.fixture(scope="session") def blob_data(config...
0
0
0
0
0
0
src/c3nav/mapdata/management/commands/processupdates.py
johnjohndoe/c3nav
132
3238753
<gh_stars>100-1000 import logging from django.conf import settings from django.core.management.base import BaseCommand from django.db import DatabaseError from django.utils.translation import ugettext_lazy as _ from c3nav.mapdata.tasks import process_map_updates class Command(BaseCommand): help = 'process unpro...
0
0
0
0
0
0
wemake_python_styleguide/compat/types.py
cdhiraj40/wemake-python-styleguide
1,931
3238793
<gh_stars>1000+ from typing import Union from wemake_python_styleguide.compat.nodes import NamedExpr from wemake_python_styleguide.types import AnyAssign #: When we search for assign elements, we also need typed assign. AnyAssignWithWalrus = Union[AnyAssign, NamedExpr]
0
0
0
0
0
0
Packs/CommonScripts/Scripts/CalculateEntropy/CalculateEntropy.py
diCagri/content
799
3238809
from __future__ import annotations import demistomock as demisto from CommonServerPython import * # noqa: E402 lgtm [py/polluting-import] from CommonServerUserPython import * # noqa: E402 lgtm [py/polluting-import] import math import string def calculate_shannon_entropy(data, minimum_entropy) -> tuple[object, dict[...
0
1
0
0
1
0
Projects/Healthcare/breast-cancer/src/utilities/reading_images.py
DanielMabadeje/Artificial-Intelligence-Deep-Learning-Machine-Learning-Tutorials
3,266
3238861
# Copyright (C) 2019 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, # <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, # <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, # <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, # <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, # <NAME>, <NAME> # # This file is pa...
0
2
0
0
2
0
tests/flow/test_multiple_edges.py
10088/RedisGraph
313
3238896
<filename>tests/flow/test_multiple_edges.py<gh_stars>100-1000 from common import * GRAPH_ID = "multi_edge" redis_graph = None class testGraphMultipleEdgeFlow(FlowTestsBase): def __init__(self): self.env = Env(decodeResponses=True) global redis_graph redis_con = self.env.getConnection() ...
0
0
0
0
0
0
chempy/__init__.py
bertiewooster/chempy
340
3238919
<gh_stars>100-1000 # -*- coding: utf-8 -*- """ ChemPy is a Python package useful for solving problems in chemistry. """ from ._url import __url__ from ._release import __version__ from .chemistry import ( Substance, Reaction, Equilibrium, Species, balance_stoichiometry, mass_fractions, ) from ...
0
0
0
0
0
0
mayhem/windll/ntdll.py
zeroSteiner/mayhem
214
3238927
#!/usr/bin/env python # -*- coding: utf-8 -*- # # mayhem/windll/ntdll.py # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
0
0
25
0
25
0
tests/test_platform.py
romulocollopy/bottery
250
3238935
import inspect import sys from unittest import mock import pytest from bottery.message import Response from bottery.platforms import BaseEngine from utils import AsyncMock @pytest.fixture def settings(): settings = mock.Mock() sys.modules['settings'] = settings yield settings del sys.modules['settin...
0
2
0
0
2
0
code/rationale/options.py
serced/rcnn
372
3238947
import sys import argparse def load_arguments() -> object: argparser = argparse.ArgumentParser(sys.argv[0]) argparser.add_argument("--load_rationale", type = str, default = "", help = "path to annotated rationale data" ) argparser.add_argument("--embedding", ...
0
1
0
0
1
0
tests/tests_preprocessing/test_preprocessing_utils.py
stjordanis/mljar-supervised
1,882
3238957
import unittest import numpy as np import pandas as pd from supervised.preprocessing.preprocessing_utils import PreprocessingUtils class PreprocessingUtilsTest(unittest.TestCase): def test_get_type_numpy_number(self): tmp = np.array([1, 2, 3]) tmp_type = PreprocessingUtils.get_type(tmp) se...
0
0
0
0
0
0
spopt/BaseClass.py
fiendskrah/spopt
135
3238971
<filename>spopt/BaseClass.py from abc import ABC, abstractmethod class BaseSpOptSolver(ABC): """Base class for all spatial optimization model solvers. """ @abstractmethod def solve(self): """Solve the optimization model.""" pass class BaseSpOptExactSolver(BaseSpOptSol...
0
0
0
0
0
0
homeassistant/components/pioneer/__init__.py
domwillcode/home-assistant
30,023
3238973
"""The pioneer component."""
0
0
0
0
0
0
paas-ce/paas/esb/components/generic/templates/weixin_qy/get_user.py
renmcc/bk-PaaS
767
3238978
<reponame>renmcc/bk-PaaS # -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not u...
0
0
0
0
0
0
Chapter05/minecraft/game.py
jvstinian/Python-Reinforcement-Learning-Projects
114
3238981
''' Created on Jul 10, 2018 @author: ywz ''' import gym import gym_minecraft import minecraft_py import numpy, time from utils import cv2_resize_image class Game: def __init__(self, name: str='MinecraftBasic-v0', discrete_movement: bool=False): self.env = gym.make(name) if discrete_move...
6
7
0
6
19
0
cosrlib/document/html/defs.py
commonsearch/cosr-back
141
3239047
from __future__ import absolute_import, division, print_function, unicode_literals # Which attributes we extract (with gumbocy) from the HTML. # All the others are ignored ATTRIBUTES_WHITELIST = frozenset([ "id", "class", "role", "content", "name", "href", "alt", "src", "hidden", ...
0
0
0
0
0
0
Densenet_testway.py
whywhs/Pytorch-Handwritten-Mathematical-Expression-Recognition
173
3239053
<gh_stars>100-1000 ''' Python 3.6 Pytorch >= 0.4 Written by <NAME> in Beihang university ''' import torch import math import torch.nn as nn from torch.autograd import Variable import torch.nn.functional as F import numpy import torch.utils.data as data from data_iterator import dataIterator from Attention_RNN import A...
0
0
0
0
0
0
floss/const.py
mandiant/flare-floss
145
3239062
<reponame>mandiant/flare-floss<gh_stars>100-1000 # Copyright (C) 2020 Mandiant, Inc. All Rights Reserved. KILOBYTE = 1024 MEGABYTE = 1024 * KILOBYTE MAX_FILE_SIZE = 16 * MEGABYTE SUPPORTED_FILE_MAGIC = {b"MZ"} MIN_STRING_LENGTH = 4 MAX_STRING_LENGTH = 2048 # Decoded String (DS) # maximum number of instructions to emu...
0
0
0
0
0
0
model.py
jiashunwang/Neural-Pose-Transfer
143
3239080
<gh_stars>100-1000 from __future__ import print_function import torch import torch.nn as nn import numpy as np import torch.nn.functional as F class PoseFeature(nn.Module): def __init__(self, num_points = 6890): super(PoseFeature, self).__init__() self.conv1 = torch.nn.Conv1d(3, 64, 1) ...
0
0
0
0
0
0
sanic/touchup/meta.py
pbsds/sanic
1,883
3239083
<filename>sanic/touchup/meta.py from sanic.base.meta import SanicMeta from sanic.exceptions import SanicException from .service import TouchUp class TouchUpMeta(SanicMeta): def __new__(cls, name, bases, attrs, **kwargs): gen_class = super().__new__(cls, name, bases, attrs, **kwargs) methods = at...
0
0
0
0
0
0
retopoflow/rfmesh/rfmesh_wrapper.py
Unnoen/retopoflow
1,600
3239131
from __future__ import annotations ''' Copyright (C) 2021 CG Cookie http://cgcookie.com <EMAIL> Created by <NAME>, <NAME> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3...
10
87
0
3
100
0
UnreadWatch/unreadwatch.py
zatherz/reddit
444
3239138
<gh_stars>100-1000 import os import praw import time ''' User Config ''' USERAGENT = "" APP_ID = "" APP_SECRET = "" APP_URI = "" APP_REFRESH = "" # https://www.reddit.com/comments/3cm1p8/how_to_make_your_bot_use_oauth2/ ''' All done ''' try: import bot USERAGENT = bot.aG APP_ID = bot.oG_id APP_SECRET ...
0
0
0
0
0
0
corehq/util/urlvalidate/test/mockipinfo.py
akashkj/commcare-hq
471
3239190
from contextlib import contextmanager from unittest.mock import patch from corehq.util.urlvalidate.ip_resolver import CannotResolveHost @contextmanager def hostname_resolving_to_ips(hostname, ips): ip_tuples = [_create_tuple(ip) for ip in ips] with patch('socket.getaddrinfo') as mock_getaddrinfo: moc...
0
3
0
0
3
0