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
misc/scripts/upgrade-wildfly/lib/wildfly/upgrade/dependencies/3rd_party/fabric8-analytics-version-comparator/f8a_version_comparator/item_object.py
evtr/keycloak
12,252
1706374
# Copyright © 2018 Red Hat 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 writin...
0
11
0
3
14
0
scale/job/test/messages/test_process_job_input.py
kaydoh/scale
121
1706389
<filename>scale/job/test/messages/test_process_job_input.py from __future__ import unicode_literals from __future__ import absolute_import import django from django.test import TransactionTestCase from data.data.json.data_v6 import DataV6 from data.interface.interface import Interface from job.messages.process_job_in...
0
0
0
0
0
0
climt/_components/simple_physics/component.py
Ai33L/climt
116
1706394
from ..._core import ensure_contiguous_state from sympl import Stepper, get_constant import logging try: from . import _simple_physics as phys except ImportError as error: logging.warning( 'Import failed. Simple Physics is likely not compiled and will not be' 'available.' ) print(error) ...
12
1
3
0
16
0
deepchem/trans/duplicate.py
cjgalvin/deepchem
3,782
1706428
<gh_stars>1000+ import logging import numpy as np from typing import Tuple from deepchem.data import Dataset from deepchem.trans.transformers import Transformer logger = logging.getLogger(__name__) class DuplicateBalancingTransformer(Transformer): """Balance binary or multiclass datasets by duplicating rarer class...
0
0
0
0
0
0
tests/test_decorators.py
Thenerdstation/mpi4jax
122
1706514
import pytest def test_envvar_parsing(): from mpi4jax._src.decorators import _is_falsy, _is_truthy assert _is_truthy("1") assert not _is_falsy("1") assert not _is_truthy("false") assert _is_falsy("false") assert not _is_truthy("foo") assert not _is_falsy("foo") def test_missing_omnist...
0
0
0
0
0
0
contrib/routing/setup.py
sepich/alerta
1,233
1706516
#!/usr/bin/env python import setuptools version = '0.0.1' setuptools.setup( name='alerta-routing', version=version, description='Alerta routing rules for plugins', url='https://github.com/alerta/alerta-contrib', license='Apache License 2.0', author='<NAME>', author_email='<EMAIL>', py...
0
0
0
0
0
0
learning_to_learn/nets/__init__.py
take-cheeze/models
112
1706539
<reponame>take-cheeze/models from . import images from . import optnets
0
0
0
0
0
0
tensorpack/tfutils/dependency.py
brandontrabucco/tensorpack
121
1706562
import tensorflow as tf from ..utils.argtools import graph_memoized """ Utils about parsing dependencies in the graph. """ __all__ = [ 'dependency_of_targets', 'dependency_of_fetches' ] @graph_memoized def dependency_of_targets(targets, op) -> object: """ Check that op is in the subgraph induced by th...
0
2
0
0
2
0
release/stubs.min/System/Drawing/__init___parts/ImageConverter.py
htlcnn/ironpython-stubs
182
1706568
<reponame>htlcnn/ironpython-stubs<filename>release/stubs.min/System/Drawing/__init___parts/ImageConverter.py class ImageConverter(TypeConverter): """ System.Drawing.ImageConverter is a class that can be used to convert System.Drawing.Image objects from one data type to another. Access this class through the System...
0
0
0
0
0
0
nuplan/planning/training/modeling/objectives/agents_imitation_objective.py
motional/nuplan-devkit
128
1706585
<reponame>motional/nuplan-devkit<gh_stars>100-1000 from typing import List, cast import torch from nuplan.planning.training.modeling.objectives.abstract_objective import AbstractObjective from nuplan.planning.training.modeling.types import FeaturesType, TargetsType from nuplan.planning.training.preprocessing.features...
0
0
0
0
0
0
src/data_generation/crowdflower_analysis/src/crowdflower_analysis.py
Nintendofan885/wiki-detox
156
1706590
<reponame>Nintendofan885/wiki-detox import pandas as pd import numpy as np import matplotlib.pyplot as plt import time import datetime from scipy import stats def create_column_of_counts(df, col): return df.apply(lambda x: col in str(x)) def create_column_of_counts_from_nums(df, col): return df.apply(lambda ...
0
0
0
0
0
0
tests/utils.py
binaryflesh/pronto
182
1706592
from __future__ import annotations import contextlib import importlib import os import sys # Resources TESTDIR = os.path.dirname(os.path.abspath(__file__)) MAINDIR = os.path.dirname(TESTDIR) DOCSDIR = os.path.join(MAINDIR, "docs") DATADIR = os.path.join(TESTDIR, "data") # Shortcut to try import modules/functions def ...
0
1
0
0
1
0
napari/_vispy/visuals/tracks.py
MaksHess/napari
1,345
1706611
from vispy.scene.visuals import Compound, Line, Text from ..filters.tracks import TracksFilter from .clipping_planes_mixin import ClippingPlanesMixin class TracksVisual(ClippingPlanesMixin, Compound): """ Compound vispy visual for Track visualization with clipping planes functionality Components: ...
0
0
0
0
0
0
backend/data/gridLayout.py
MikeOwino/JittorVis
139
1706654
from __future__ import annotations import numpy as np # from tsnecuda import TSNE # from sklearn.manifold import TSNE from data.IncrementalTSNE import IncrementalTSNE import fastlapjv from matplotlib import pyplot as plt from scipy.spatial.distance import cdist from fastlapjv import fastlapjv import math from time impo...
15
3
0
0
18
0
TrainingExtensions/common/src/python/aimet_common/layer_database.py
Rohan-Chaudhury/aimet
945
1706662
# /usr/bin/env python3.5 # -*- mode: python -*- # ============================================================================= # @@-COPYRIGHT-START-@@ # # Copyright (c) 2018, Qualcomm Innovation Center, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification,...
4
5
0
2
11
0
cloudbaseinit/tests/plugins/common/test_execcmd.py
andia10240/cloudbase-init
160
1706669
# Copyright 2014 Cloudbase Solutions Srl # # 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 l...
1
3
0
0
4
0
tests/func/regressions/test_issue_54_collector_unicode.py
boriel/parglare
102
1706672
from parglare import get_collector def test_collector_can_use_unicode_in_python_2() -> object: action = get_collector() def f(context, node) -> object: return node action('f_action')(f)
0
2
0
0
2
0
scripts/examples/Arduino/Portenta-H7/04-Image-Filters/lens_correction.py
jiskra/openmv
1,761
1706692
# Lens Correction # # This example shows off how to use the lens correction method to fix lens # distortion in an image. You need to do this for qrcode / barcode / data matrix # detection. Increase the strength below until lines are straight in the view. # Zoom in (higher) or out (lower) until you see enough of the ima...
0
0
0
0
0
0
qa/L0_stability_perf/check_results.py
MarkMoTrin/model_analyzer
115
1706698
# Copyright (c) 2021, NVIDIA CORPORATION. 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 applic...
0
1
0
0
1
0
mealie/db/db_base.py
strenkml/mealie
1,927
1706770
<filename>mealie/db/db_base.py from typing import Union from mealie.core.root_logger import get_logger from mealie.db.models.model_base import SqlAlchemyBase from pydantic import BaseModel from sqlalchemy import func from sqlalchemy.orm import load_only from sqlalchemy.orm.session import Session logger = get_logger()...
0
0
0
0
0
0
Programs/LogUpdater/lib/makeuploadfile.py
Psiphonc/EasierLife
203
1706787
<gh_stars>100-1000 #coding=utf8 import random import config from client.ExcelClient import ExcelClient def get_stored_cases(storageDir): # case_num, case_id, project ec = ExcelClient(storageDir, sourceIndex = (0,2,3)) r = {} while 1: userInfo = ec.getData() if userInfo is N...
0
0
0
0
0
0
hw/vendor/lowrisc_ibex/vendor/google_riscv-dv/pygen/pygen_src/isa/rv32a_instr.py
GregAC/opentitan
1,375
1706789
<filename>hw/vendor/lowrisc_ibex/vendor/google_riscv-dv/pygen/pygen_src/isa/rv32a_instr.py<gh_stars>1000+ """ Copyright 2020 Google LLC Copyright 2020 PerfectVIPs 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 ...
0
0
0
0
0
0
tests/functional/coercers/test_coercer_non_null_int_field.py
matt-koevort/tartiflette
530
1706811
import pytest from tests.functional.coercers.common import resolve_unwrapped_field @pytest.mark.asyncio @pytest.mark.ttftt_engine( name="coercion", resolvers={"Query.nonNullIntField": resolve_unwrapped_field}, ) @pytest.mark.parametrize( "query,variables,expected", [ ( """query { ...
0
0
0
0
0
0
alipay/aop/api/domain/AlipayCommerceIotDeviceTraceQueryModel.py
antopen/alipay-sdk-python-all
213
1706842
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import annotations import json from alipay.aop.api.constant.ParamConstants import * class AlipayCommerceIotDeviceTraceQueryModel(object): def __init__(self): self._biz_tid: None = None self._end_time: None = None self._start_t...
0
5
0
3
8
0
tests/fourier/test_fourier_utils.py
jsmz97/pennylane
712
1706845
# Copyright 2018-2021 Xanadu Quantum Technologies 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
itchatmp/controllers/mpapi/qy/oauth2.py
yf-ftd/itchatmp
1,504
1706849
<gh_stars>1000+ try: from urllib import quote_plus as quote except ImportError: from urllib.parse import quote_plus as quote import time from itchatmp.config import COMPANY_URL from itchatmp.returnvalues import ReturnValue from itchatmp.utils import retry, encode_send_dict from ..requests import request...
0
0
0
0
0
0
data/transcoder_evaluation_gfg/python/PROGRAM_FIND_STRING_START_END_GEEKS.py
mxl1n/CodeGen
241
1706851
<reponame>mxl1n/CodeGen<filename>data/transcoder_evaluation_gfg/python/PROGRAM_FIND_STRING_START_END_GEEKS.py # Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # def f_gold ( str ,...
0
0
0
0
0
0
python/ql/test/experimental/dataflow/pep_328/package/__init__.py
timoles/codeql
4,036
1706873
<filename>python/ql/test/experimental/dataflow/pep_328/package/__init__.py bar = "bar"
0
0
0
0
0
0
typescript/commands/settings.py
bertilnilsson/TypeScript-Sublime-Plugin
1,688
1706892
import sublime_plugin from ..libs.global_vars import * from ..libs import cli, logger import os class TypescriptOpenPluginDefaultSettingFile(sublime_plugin.WindowCommand): def run(self): default_plugin_setting_path = os.path.join(PLUGIN_DIR, "Preferences.sublime-settings") sublime.active_window()....
0
0
0
0
0
0
modules/reversing/flare.py
decidedlygray/ptf
4,391
1706894
#!/usr/bin/env python ##################################### # Installation module for Flare ##################################### # AUTHOR OF MODULE NAME AUTHOR="<NAME>" # DESCRIPTION OF THE MODULE DESCRIPTION="This module will install/update flare actionscript extractor" # INSTALL TYPE GIT, SVN, FILE DOWNLOAD # OPT...
0
0
0
0
0
0
tests/expect100.py
HorsemanWSGI/bjoern
2,326
1706969
<reponame>HorsemanWSGI/bjoern from __future__ import print_function import bjoern, socket, threading, time, json, sys, requests, logging def app(e, s): s('200 OK', [("Content-Length", "0")]) return b"" def record_report(reports, request, resp): reports.append({"request": request, "response": resp.decode...
0
0
0
0
0
0
tests/apps/good_flow_app/migrations/0046_add_spgist_index.py
15five/django-pg-zero-downtime-migrations
376
1706992
# Generated by Django 3.0a1 on 2019-10-14 19:49 import django.contrib.postgres.indexes from django.db import migrations class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [ ('good_flow_app', '0045_drop_hash_index_with_condition'), ] operations: list[object] = [ ...
0
0
2
0
2
0
sippy/Radius_client.py
beebuu/b2bua
135
1706998
# # Copyright (c) 2003-2005 <NAME>. All rights reserved. # Copyright (c) 2006-2014 Sippy Software, Inc. All rights reserved. # # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistribution...
2
3
3
0
8
0
pfrl/agents/td3.py
ummavi/pfrl-1
824
1707033
<gh_stars>100-1000 import collections import copy from logging import getLogger import numpy as np import torch from torch.nn import functional as F import pfrl from pfrl.agent import AttributeSavingMixin, BatchAgent from pfrl.replay_buffer import ReplayUpdater, batch_experiences from pfrl.utils import clip_l2_grad_n...
0
0
0
0
0
0
tests/sq_lat_Heis_test.py
anton-buyskikh/QuSpin
195
1707043
from __future__ import print_function, division import sys,os qspin_path = os.path.join(os.getcwd(),"../") sys.path.insert(0,qspin_path) from quspin.basis import spin_basis_general from quspin.basis.transformations import square_lattice_trans from quspin.operators import hamiltonian import numpy as np from itertools ...
0
0
0
0
0
0
core/models/modules/idwt.py
zuimeiyujianni/MobileStyleGAN.pytorch
540
1707053
import torch import torch.nn as nn from pytorch_wavelets.dwt.lowlevel import * def _SFB2D(low, highs, g0_row, g1_row, g0_col, g1_col, mode) -> object: mode = int_to_mode(mode) lh, hl, hh = torch.unbind(highs, dim=2) lo = sfb1d(low, lh, g0_col, g1_col, mode=mode, dim=2) hi = sfb1d(hl, hh, g0_col, g1_c...
3
2
0
0
5
0
lib/roi_pooling_layer/roi_pooling_op.py
wyyy04/scene-graph-TF-release
403
1707089
import tensorflow as tf import os.path as osp import os op_file = 'roi_pooling_op_gpu_cuda8.so' # for CUDA 8 #op_file = 'roi_pooling_op_gpu.so' # CUDA 7.5 filename = osp.join(osp.dirname(__file__), op_file) _roi_pooling_module = tf.load_op_library(filename) roi_pool = _roi_pooling_module.roi_pool roi_pool_grad = _r...
0
0
0
0
0
0
moe/optimal_learning/python/python_version/covariance.py
dstoeckel/MOE
966
1707097
# -*- coding: utf-8 -*- """Implementations of covariance functions for use with :mod:`moe.optimal_learning.python.python_version.log_likelihood` and :mod:`moe.optimal_learning.python.python_version.gaussian_process`. This file contains implementations of CovarianceInterface. Currently, we have SquareExponential, suppo...
0
6
0
0
6
0
sensor_stick/scripts/template.py
horagong/RoboND-Perception-Project
105
1707120
#!/usr/bin/env python import numpy as np import sklearn from sklearn.preprocessing import LabelEncoder import pickle from sensor_stick.srv import GetNormals from sensor_stick.features import compute_color_histograms from sensor_stick.features import compute_normal_histograms from visualization_msgs.msg import Marker...
0
0
0
0
0
0
pogom/pgoapi/protos/POGOProtos/Networking/Requests/Messages/CatchPokemonMessage_pb2.py
tier4fusion/pogom-updated
2,557
1707123
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Networking/Requests/Messages/CatchPokemonMessage.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _mess...
0
0
0
0
0
0
fs_s3fs/__init__.py
AleksMat/s3fs
135
1707128
from ._version import __version__ from ._s3fs import S3FS
0
0
0
0
0
0
data/preprocessor.py
kikacaty/AgentFormer
105
1707139
from __future__ import annotations import torch, os, numpy as np, copy import cv2 import glob from .map import GeometricMap class preprocess(object): def __init__(self, data_root, seq_name, parser, log, split: str='train', phase: str='training'): self.parser = parser self.dataset = parser.dat...
2
10
0
1
13
0
tests/Unit/Evolution/Systems/Ccz4/DerivLapse.py
nilsvu/spectre
117
1707168
# Distributed under the MIT License. # See LICENSE.txt for details. import numpy as np def grad_grad_lapse(lapse, christoffel_second_kind, field_a, d_field_a) -> object: return (lapse * np.einsum("i,j", field_a, field_a) - lapse * np.einsum("kij,k", christoffel_second_kind, field_a) + 0.5...
0
2
0
0
2
0
app/api/endpoints/submit.py
tapsykrett/emailanalyze
119
1707197
from fastapi import APIRouter from fastapi.encoders import jsonable_encoder from fastapi.responses import JSONResponse from httpx._exceptions import HTTPError from app.core.utils import has_inquest_api_key, has_virustotal_api_key from app.schemas.eml import Attachment from app.schemas.submission import SubmissionResul...
2
2
0
0
4
0
integration_tests/python_modules/dagster-k8s-test-infra/dagster_k8s_test_infra/integration_utils.py
makotonium/dagster
4,606
1707227
<gh_stars>1000+ import os import random import subprocess IS_BUILDKITE = os.getenv("BUILDKITE") is not None def image_pull_policy(): # This is because when running local tests, we need to load the image into the kind cluster (and # then not attempt to pull it) because we don't want to require credentials for...
0
0
0
0
0
0
test/test_pair.py
EraYaN/transpyle
107
1707229
<reponame>EraYaN/transpyle<gh_stars>100-1000 import contextlib import logging import os import types import unittest import horast from transpyle.general import CodeReader, Language, Parser from transpyle.pair.inlining import inline_syntax, inline from .examples_inlining import \ buy_products, buy, buy_product...
0
0
0
0
0
0
easy_rec/python/model/collaborative_metric_learning.py
alibaba/EasyRec
285
1707261
from __future__ import annotations import tensorflow as tf from easy_rec.python.core.metrics import metric_learning_average_precision_at_k from easy_rec.python.core.metrics import metric_learning_recall_at_k from easy_rec.python.layers import dnn from easy_rec.python.layers.common_layers import gelu from easy_rec.pyth...
2
5
0
4
11
0
tomotopy/label.py
jonaschn/tomotopy
393
1707280
""" Submodule `tomotopy.label` provides automatic topic labeling techniques. You can label topics automatically with simple code like below. The results are attached to the bottom of the code. .. include:: ./auto_labeling_code.rst """ from _tomotopy import (_LabelCandidate, _LabelPMIExtractor, _LabelFoRelevance) Can...
0
0
0
0
0
0
peeringdb_server/migrations/0022_ixlan_remove_auto_increment.py
CyberFlameGO/peeringdb
224
1707282
<filename>peeringdb_server/migrations/0022_ixlan_remove_auto_increment.py # Generated by Django 1.11.23 on 2020-01-02 09:24 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("peeringdb_server", "0021_sponsorship_drop_single_org_relation_fields"), ] ...
0
0
0
0
0
0
matplotlib__examples/examples/exm2.py
DazEB2/SimplePyScripts
117
1707290
<filename>matplotlib__examples/examples/exm2.py<gh_stars>100-1000 __author__ = 'ipetrash' # Если вызывать функцию plot() несколько раз подряд, то на график # будут добавляться новые кривые. Следующий пример рисует два графика на одних осях: import math # !!! Импортируем один из пакетов Matplotlib import pylab # !!...
0
0
0
0
0
0
supervisor/dbus/network/accesspoint.py
pnjongang/supervisor
597
1707313
"""Connection object for Network Manager.""" from ...utils.dbus import DBus from ..const import ( DBUS_ATTR_FREQUENCY, DBUS_ATTR_HWADDRESS, DBUS_ATTR_MODE, DBUS_ATTR_SSID, DBUS_ATTR_STRENGTH, DBUS_IFACE_ACCESSPOINT, DBUS_NAME_NM, ) from ..interface import DBusInterfaceProxy class NetworkW...
1
7
0
1
9
0
src/wormhole/test/test_observer.py
dmgolembiowski/magic-wormhole
2,801
1707358
<reponame>dmgolembiowski/magic-wormhole from twisted.internet.task import Clock from twisted.python.failure import Failure from twisted.trial import unittest from ..eventual import EventualQueue from ..observer import OneShotObserver, SequenceObserver, EmptyableSet class OneShot(unittest.TestCase): def test_fire...
0
0
0
0
0
0
L1Trigger/L1TGlobal/python/l1GtExtCondLegacyToStage2_cfi.py
ckamtsikis/cmssw
852
1707367
<reponame>ckamtsikis/cmssw import FWCore.ParameterSet.Config as cms l1GtExtCondLegacyToStage2 = cms.EDProducer("L1TExtCondLegacyToStage2", bxFirst = cms.int32(-2), bxLast = cms.int32(2), Le...
0
0
0
0
0
0
lib/log.py
hack654a/w12scan-client
159
1707393
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Time : 2019/1/14 4:44 PM # @Author : w8ay # @File : log.py import logging import threading from config import LOGGER_LEVEL from thirdpart.ansistrm import ColorizingStreamHandler DEBUG, INFO, WARN, ERROR, SUCCESS = range(1, 6) logging.addLevelName(DEBUG, '^') l...
0
0
0
0
0
0
supar/utils/tokenizer.py
rootofmylife/parser
439
1707412
# -*- coding: utf-8 -*- class Tokenizer: def __init__(self, lang: str='en'): import stanza try: self.pipeline = stanza.Pipeline(lang=lang, processors='tokenize', verbose=False, tokenize_no_ssplit=True) except Exception: stanza.download(lang=lang, resources_url='sta...
1
1
0
0
2
0
pathfinder/client/output.py
AlphaMycelium/pathfinder.vim
228
1707423
import itertools import vim from pathfinder.debytes import debytes last_output = None def strtrans(string) -> object: """Convert special characters like '' to '^D'.""" escaped_string = string.replace("'", "\\'").replace("\\", "\\\\") return vim.eval(f"strtrans('{escaped_string}')") def get_count(mot...
0
4
0
0
4
0
deps/libgdal/gyp-formats/zlib.gyp
jimgambale/node-gdal
462
1707431
{ "includes": [ "../common.gypi" ], "targets": [ { "target_name": "libgdal_zlib_frmt", "type": "static_library", "sources": [ "../gdal/frmts/zlib/adler32.c", "../gdal/frmts/zlib/compress.c", "../gdal/frmts/zlib/crc32.c", "../gdal/frmts/zlib/deflate.c", "../gdal/frmts/zlib/gzio.c", ...
0
0
0
0
0
0
Chapter08/string_formatting.py
add54/ADMIN_SYS_PYTHON
116
1707436
# Basic formatting a = 10 b = 30 print("The values of a and b are %d %d" % (a, b)) c = a + b print("The value of c is %d" % c) str1 = 'John' print("My name is %s" % str1) x = 10.5 y = 33.5 z = x * y print("The value of z is %f" % z) print() # aligning name = 'Mary' print("Normal: Hello, I am %s !!" % name) print("Ri...
0
0
0
0
0
0
clize/tests/__init__.py
TomekTrzeciak/clize
390
1707471
# clize -- A command-line argument parser for Python # Copyright (C) 2011-2016 by <NAME> and contributors. See AUTHORS and # COPYING for details. import sys import warnings __all__ = [] if sys.argv and "test" in sys.argv[0]: warnings.filterwarnings("default") warnings.filterwarnings("error", module="clize"...
0
0
0
0
0
0
membership/apps.py
Manny27nyc/pythondotorg
911
1707514
<reponame>Manny27nyc/pythondotorg from django.apps import AppConfig class MembershipAppConfig(AppConfig): name = 'membership'
0
0
0
0
0
0
experiments/plot_bar_chart.py
remtav/torchgeo
678
1707521
#!/usr/bin/env python3 # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns df1 = pd.read_csv("original-benchmark-results.csv") df2 = pd.read_csv("warped-benchmark-results.csv") mean...
0
0
0
0
0
0
recipes/Python/363783_InverseExtend/recipe-363783.py
tdiprima/code
2,023
1707536
"""Iterate downward through a hierarchy calling a method at each step.""" __docformat__ = "restructuredtext" def inverseExtend(boundMethod, *args, **kargs) -> object: """Iterate downward through a hierarchy calling a method at each step. boundMethod -- This is the bound method of the object you're interest...
0
2
0
0
2
0
Sniffer-v2.0/Toolbox/ColorTools.py
gavin-thun/Sniffer
154
1707549
<filename>Sniffer-v2.0/Toolbox/ColorTools.py #encoding: utf8 from termcolor import colored import re import sys def putColor(text, color): return colored(text, color = color, attrs = ['bold']) def Eraser(text): return re.sub(r'\[[0-9]*m', '', text) def ClearLine(): sys.stdout.flush()
0
0
0
0
0
0
tests/test_task.py
timgates42/tasktiger
1,143
1707558
import pytest from tasktiger import Task, TaskNotFound from .tasks import simple_task from .utils import get_tiger class TestTaskFromId: @pytest.fixture def tiger(self) -> object: return get_tiger() @pytest.fixture def queued_task(self, tiger) -> object: return tiger.delay(simple_ta...
0
2
0
0
2
0
code/ReID_net/datasets/Util/pascal_colormap.py
MTonyM/PReMVOS
140
1707569
import numpy from PIL import Image pascal_colormap = [ 0 , 0, 0, 0.5020, 0, 0, 0, 0.5020, 0, 0.5020, 0.5020, 0, 0, 0, 0.5020, 0.5020, 0, 0.5020, 0, 0.5020, 0.5020, 0.5020, 0.5020, ...
0
0
0
0
0
0
tech_project/lib/python2.7/site-packages/phonenumbers/shortdata/region_ZW.py
priyamshah112/Project-Descripton-Blog
2,424
1707596
"""Auto-generated file, do not edit by hand. ZW metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_ZW = PhoneMetadata(id='ZW', country_code=None, international_prefix=None, general_desc=PhoneNumberDesc(national_number_pattern='[139]\\d\\d(?:\\d{2})?', possible_lengt...
0
0
0
0
0
0
torchshard/nn/modules/loss.py
KaiyuYue/torchshard
265
1707674
from __future__ import annotations import math import logging from typing import Optional, TypeVar import torch import torch.nn as nn from torch import Tensor from torch.nn import Module from .. import functional as F from .. import _reduction as _Reduction from ...distributed import gather # See https://mypy.readth...
14
4
3
0
21
0
private/scripts/refresh-problem-details.py
earora97/stopstalk-deployment
342
1707704
""" Copyright (c) 2015-2020 <NAME>(<EMAIL>), StopStalk 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...
0
0
0
0
0
0
RecoParticleFlow/Configuration/test/analyzePFCandidates_cfg.py
ckamtsikis/cmssw
852
1707737
import FWCore.ParameterSet.Config as cms process = cms.Process("ANALYSIS") process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100) ) process.source = cms.Source ( "PoolSource", fileNames = cms.untracked.vstring( 'file:display.root' ), secondaryFileNames = cms.untrac...
0
0
0
0
0
0
apps/l10n_chile/apps.py
youssriaboelseod/pyerp
115
1707768
# Django Library from django.apps import AppConfig class L10NChileConfig(AppConfig): name: str = 'l10n_chile'
0
0
1
0
1
0
clair/post_processing/overlap_variant.py
jopineda/Clair
101
1707773
<filename>clair/post_processing/overlap_variant.py from sys import stdin, stderr from collections import namedtuple Variant = namedtuple('Variant', [ 'chromosome', 'position', 'reference_base', 'alternate_base', 'alternate_base_multi', 'quality_score', 'genotype', 'depth', 'allele_f...
0
0
0
0
0
0
st3/mdpopups/coloraide/spaces/lab/__init__.py
evandroforks/mdpopups
253
1707775
"""Lab color class."""
0
0
0
0
0
0
pycantonese/data/rime_cantonese/__init__.py
chaaklau/pycantonese
124
1707791
import json import os _THIS_DIR = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(_THIS_DIR, "chars_to_jyutping.json"), encoding="utf8") as f: CHARS_TO_JYUTPING = json.load(f) with open(os.path.join(_THIS_DIR, "lettered.json"), encoding="utf8") as f: LETTERED = json.load(f)
0
0
0
0
0
0
ocr/utils/draw_box_on_image.py
vee51/Hand
435
1707804
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import numpy as np from skimage.draw import line_aa import matplotlib.pyplot as plt def draw_line(image, y1, x1, y2, x2, line_type) -> object: rr, cc, val = line_aa(y1, x1, y2, x2) if line_type == "...
1
4
0
0
5
0
test/e2e/cws-tests/tests/test_e2e_cspm_docker.py
lattwood/datadog-agent
1,611
1707834
import os import time import unittest import uuid import warnings from lib.config import gen_datadog_agent_config from lib.const import CSPM_RUNNING_DOCKER_CHECK_LOG, CSPM_START_LOG from lib.cspm.api import wait_for_compliance_event, wait_for_finding from lib.cspm.finding import is_expected_docker_finding, parse_outpu...
0
0
0
0
0
0
torch/utils/data/graph.py
Hacky-DH/pytorch
60,067
1707843
<reponame>Hacky-DH/pytorch import io import pickle from torch.utils.data import IterableDataset from typing import Any, Dict reduce_ex_hook = None def stub_unpickler(): return "STUB" # TODO(VitalyFedyunin): Make sure it works without dill module installed def list_connected_datapipes(scan_obj): f = io.By...
0
0
0
0
0
0
runway/templates/k8s-cfn-repo/k8s-master.cfn/k8s_hooks/awscli.py
blade2005/runway
134
1707848
<reponame>blade2005/runway """Execute the AWS CLI update-kubeconfig command.""" from __future__ import annotations import logging import os import subprocess import sys from typing import TYPE_CHECKING, Any from runway.cfngin.lookups.handlers.output import OutputLookup from runway.utils import which if TYPE_CHECKING...
0
0
0
0
0
0
src/0002.add-two-numbers/add-two-numbers.py
YaxeZhang/Just-Interview
782
1707853
<filename>src/0002.add-two-numbers/add-two-numbers.py<gh_stars>100-1000 # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode: flag = 0 dum...
0
0
0
0
0
0
tools/ensemble_test.py
xiaoye77/Optical-Flow-Guided-Feature
196
1707890
<filename>tools/ensemble_test.py from pyActionRecog.utils.video_funcs import default_aggregation_func import pickle import numpy as np from sklearn.metrics import confusion_matrix SPLIT = '1' with open('final_scores/ucf101_rgb_off_reference_split{}.pickle'.format(SPLIT)) as fmotion: print 'loading rgb off...' ...
0
0
0
0
0
0
core/models/discriminator.py
zuimeiyujianni/MobileStyleGAN.pytorch
540
1707944
import torch import torch.nn as nn from .modules.legacy import * class ConvLayer(nn.Sequential): def __init__( self, in_channel, out_channel, kernel_size, downsample: bool=False, blur_kernel: list[int]=[1, 3, 3, 1], bias: bool=True, activate: bool=Tr...
9
3
0
3
15
0
unrealcv_bridge/src/unrealcv_bridge/ue_conversions.py
debugCVML/rpg_information_field
149
1707964
#!/usr/bin/env python2 import numpy as np import tf_utils as tu def getT_wue_w() -> object: T_wue_w = np.eye(4) T_wue_w[1, 1] = -1 return T_wue_w def getT_w_wue() -> object: return np.linalg.inv(getT_wue_w()) def getT_c_cue() -> object: T_cue_c = np.zeros((4, 4)) T_cue_c[0, 1] = 1 T_...
0
9
0
0
9
0
pypxe/helpers.py
patschbo/PyPXE
133
1707974
<filename>pypxe/helpers.py ''' This file contains helper functions used throughout the PyPXE services ''' import os.path import logging class PathTraversalException(Exception): pass def normalize_path(base, filename): ''' Join and normalize a base path and filename. `base` may be relative, ...
0
0
0
0
0
0
lib/pymedphys/mosaiq.py
ethanio12345/pymedphys
207
1707985
<gh_stars>100-1000 """Module to handle the connection to a Mosaiq SQL database and execute SQL queries. """ # pylint: disable = unused-import from ._mosaiq.api import Connection, Cursor, connect, execute
0
0
0
0
0
0
src/odb/test/unitTestsPython/helper.py
erictaur/OpenROAD
525
1708006
import opendbpy as odb import os def createSimpleDB() -> tuple[object, object]: db = odb.dbDatabase.create() tech = odb.dbTech.create(db) L1 = odb.dbTechLayer_create(tech, 'L1', 'ROUTING') lib = odb.dbLib.create(db, "lib") odb.dbChip.create(db) #Creating Master and2 and or2 and2 = createMa...
0
6
0
0
6
0
tests/test_build_parser.py
rborden-appsec/yawast
200
1708010
<gh_stars>100-1000 # Copyright (c) 2013 - 2019 <NAME> and Contributors. # This file is part of YAWAST which is released under the MIT license. # See the LICENSE file or go to https://yawast.org/license/ for full license details. from unittest import TestCase from tests import utils from yawast import command_line ...
0
0
0
0
0
0
netket/sampler/rules/custom_numpy.py
gpescia/MyNetKet
352
1708035
<filename>netket/sampler/rules/custom_numpy.py # Copyright 2021 The NetKet 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...
0
0
0
0
0
0
saleor/checkout/migrations/0024_auto_20200120_0154.py
fairhopeweb/saleor
15,337
1708052
# Generated by Django 2.2.9 on 2020-01-20 07:54 from django.db import migrations, models class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [ ("checkout", "0023_checkout_country"), ] operations: list[object] = [ migrations.AlterField( model_name="ch...
0
0
2
0
2
0
posts/management/commands/update_hotness.py
lobotomoe/vas3k.club
496
1708065
from datetime import datetime from django.core.management import BaseCommand from django.db import connection from club.settings import POST_HOTNESS_PERIOD from posts.models.post import Post class Command(BaseCommand): help: str = "Updates hotness rank" def handle(self, *args, **options): Post.obje...
0
0
1
0
1
0
dolphinscheduler-python/pydolphinscheduler/tests/utils/test_string.py
InterestingLab/dolphinscheduler
2,086
1708069
# 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 # "License"); you may not u...
6
0
0
0
6
0
2008/CVE-2008-2650/poc/pocsploit/CVE-2008-2650.py
hjyuan/reapoc
421
1708070
from __future__ import annotations import requests # Vuln Base Info def info() -> dict[str,dict[str,str] | list[str] | str]: return { "author": "cckuailong", "name": '''CMSimple 3.1 - Local File Inclusion''', "description": '''Directory traversal vulnerability in cmsimple/cms.php in CMSimp...
0
5
0
0
5
0
httpie/output/lexers/common.py
10088/httpie
24,849
1708090
def precise(lexer, precise_token, parent_token) -> object: # Due to a pygments bug*, custom tokens will look bad # on outside styles. Until it is fixed on upstream, we'll # convey whether the client is using pie style or not # through precise option and return more precise tokens # depending on it's...
0
1
0
0
1
0
constants.bzl
vcase/bazel-diff
169
1708167
<filename>constants.bzl<gh_stars>100-1000 """ Various constants used to build bazel-diff """ DEFAULT_JVM_EXTERNAL_TAG = "3.3" RULES_JVM_EXTERNAL_SHA = "d85951a92c0908c80bd8551002d66cb23c3434409c814179c0ff026b53544dab" BUILD_PROTO_MESSAGE_SHA = "50b79faec3c4154bed274371de5678b221165e38ab59c6167cc94b922d9d9152"
0
0
0
0
0
0
test/tokenize/t19.py
timmartin/skulpt
2,671
1708190
<reponame>timmartin/skulpt x = 3.14e159
0
0
0
0
0
0
openbook_hashtags/views/hashtags/serializers.py
TamaraAbells/okuna-api
164
1708269
from django.conf import settings from rest_framework import serializers class SearchHashtagsSerializer(serializers.Serializer): query = serializers.CharField(max_length=settings.SEARCH_QUERIES_MAX_LENGTH, required=True) count = serializers.IntegerField( required=False, max_value=10 )
0
0
0
0
0
0
hippy/module/spl/interface.py
jweinraub/hippyvm
289
1708290
<filename>hippy/module/spl/interface.py """Interfaces defined by the SPL extension""" from hippy import consts from hippy.klass import def_class from hippy.builtin_klass import new_abstract_method, k_Iterator k_Countable = def_class('Countable', [new_abstract_method(["interp"], name="Countable::count")], flag...
0
0
0
0
0
0
sklearn_extra/robust/tests/test_robust_weighted_estimator.py
makcedward/scikit-learn-extra
120
1708322
import numpy as np import pytest from sklearn_extra.robust import ( RobustWeightedClassifier, RobustWeightedRegressor, RobustWeightedKMeans, ) from sklearn.datasets import make_blobs from sklearn.linear_model import SGDClassifier, SGDRegressor, HuberRegressor from sklearn.cluster import KMeans from sklearn...
0
0
0
0
0
0
tests/drift_detection/test_hddm_w.py
denisesato/scikit-multiflow
663
1708338
<gh_stars>100-1000 import numpy as np from skmultiflow.drift_detection.hddm_w import HDDM_W def test_hddm_w(): """ HDDM_W drift detection test. The first half of the data contains a sequence corresponding to a normal distribution with mean 0 and sigma 0.1. The second half corresponds to a normal distr...
0
0
0
0
0
0
deeplearning2020/datasets.py
fokkerh/deeplearning2020
133
1708368
from __future__ import absolute_import, division, print_function, unicode_literals import os import pathlib import typing from typing import TYPE_CHECKING import numpy as np if TYPE_CHECKING: # pragma: no cover import tensorflow as _tf try: import tensorflow as tf assert tf.__version__[:2] == "2." exc...
8
9
6
1
24
0
tests/test_base_hyperparameter_generator.py
rpatil524/mcfly
356
1708378
import numpy as np from mcfly.models.base_hyperparameter_generator import generate_base_hyperparameter_set, \ get_regularization def test_regularization_is_float(): """ Regularization should be a float. """ reg = get_regularization(0, 5) assert isinstance(reg, np.float), "Expected different type." def...
0
0
0
0
0
0
tools/ncbi_entrez_eutils/esearch.py
ic4f/tools-iuc
142
1708384
<reponame>ic4f/tools-iuc<gh_stars>100-1000 #!/usr/bin/env python import argparse import json import logging import eutils logging.basicConfig(level=logging.INFO) if __name__ == '__main__': parser = argparse.ArgumentParser(description='ESearch', epilog='') parser.add_argument('db', help='Database to use')...
0
0
0
0
0
0