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
examples/separate/separate_2d_bruker/separate.py
genematx/nmrglue
150
1795718
<reponame>genematx/nmrglue #! /usr/bin/env python # Separate 2D data sets from an arrayed data set, directories will be names # 1, 2, 3, ... 23 import nmrglue as ng # read in the NMR data dic, data = ng.bruker.read('arrayed_data.dir', shape=(7360, 640), cplex=True) array_size = 23 # loop over the arrayed data, sep...
0
0
0
0
0
0
tests/test_core_iontype.py
avneet-toor-bq/ion-python
202
1795742
# Copyright 2016 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at: # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
0
2
0
0
2
0
nn/basic.py
zuxfoucault/RNNLG_py3
553
1795761
<reponame>zuxfoucault/RNNLG_py3<gh_stars>100-1000 ###################################################################### ###################################################################### # Copyright <NAME>, Cambridge Dialogue Systems Group, 2016 # ##################################################################...
0
0
0
0
0
0
tools/accuracy_checker/openvino/tools/accuracy_checker/adapters/background_matting.py
alpkn/open_model_zoo
2,201
1795832
""" Copyright (c) 2018-2022 Intel Corporation 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 wri...
0
3
1
0
4
0
WebMirror/management/rss_parser_funcs/feed_parse_extractAllaboutmynothingsBlogspotCom.py
fake-name/ReadableWebProxy
193
1795928
<reponame>fake-name/ReadableWebProxy def extractAllaboutmynothingsBlogspotCom(item): ''' Parser for 'allaboutmynothings.blogspot.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('Yasashii Shi...
0
0
0
0
0
0
paver/tests/data/t2.py
cecedille1/paver
270
1795955
#[[[section second]]] import sys #[[[section inner]]] print sys.path #[[[endsection]]] #[[[endsection]]]
0
0
0
0
0
0
13-VODMediaPackage/ingest_asset.py
baoc75/aws-media-services-simple-vod-workflow
295
1795969
from __future__ import annotations import json import boto3 import time import os def lambda_handler(event, context) -> dict[str,int | object]: empvod = boto3.client('mediapackage-vod') packaging_group_id = os.environ['PACKAGING_GROUP_ID'] hls_playlist_paths = [] for output_detail in event['detail'][...
0
1
0
0
1
0
tests/python/kaolin/metrics/test_tetmesh.py
tovacinni/kaolin
3,747
1795998
<filename>tests/python/kaolin/metrics/test_tetmesh.py # Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. # 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...
0
0
0
0
0
0
DQMOffline/CalibTracker/test/CRAFTCalib/SiStripDQMBadStripsValidation_cfg.py
ckamtsikis/cmssw
852
1796020
<reponame>ckamtsikis/cmssw<filename>DQMOffline/CalibTracker/test/CRAFTCalib/SiStripDQMBadStripsValidation_cfg.py import FWCore.ParameterSet.Config as cms process = cms.Process( "SiStripDQMBadStripsValidation" ) ### Miscellanous ### ## Logging ## process.options = cms.untracked.PSet( wantSummary = cms.untracked.b...
0
0
0
0
0
0
odps/tunnel/pb/output_stream.py
wjsi/aliyun-odps-python-sdk
412
1796046
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. # http://code.google.com/p/protobuf/ # # 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.apa...
0
3
0
0
3
0
statsmodels/tools/rng_qrng.py
CCHiggins/statsmodels
6,931
1796066
from __future__ import annotations import numpy as np import scipy.stats as stats _future_warn = """\ Passing `None` as the seed currently return the NumPy singleton RandomState (np.random.mtrand._rand). After release 0.13 this will change to using the default generator provided by NumPy (np.random.default_rng()). If ...
1
1
0
0
2
0
src/backend/common/helpers/playlist_helper.py
ofekashery/the-blue-alliance
266
1796072
from typing import List from backend.common.consts import comp_level from backend.common.helpers.match_helper import TOrganizedMatches class PlaylistHelper(object): @classmethod def generate_playlist_link( cls, title: str, matches_organized: TOrganizedMatches, allow_levels: Li...
3
1
0
0
4
0
condensa/functional.py
stormymcstorm/condensa
153
1796089
<filename>condensa/functional.py<gh_stars>100-1000 # Copyright 2019 NVIDIA Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
0
0
0
0
0
0
solutions/problem_219.py
ksvr444/daily-coding-problem
1,921
1796112
from enum import Enum ROWS = 6 COLS = 7 class Color(Enum): RED: int = 1 BLACK: int = 2 class Board: def __init__(self): self.grid: list[object] = list() for _ in range(COLS): col = list() for _ in range(ROWS): col.append(None) self.gri...
0
1
2
1
4
0
PyObjCTest/test_nsscreen.py
Khan/pyobjc-framework-Cocoa
132
1796158
from PyObjCTools.TestSupport import * from AppKit import * try: unicode except NameError: unicode = str class TestNSScreen (TestCase): def testMethods(self): m = NSScreen.supportedWindowDepths.__metadata__() self.assertTrue(m['retval']['c_array_delimited_by_null']) @min_os_level('10....
0
0
0
0
0
0
dbcArchives/2021/000_0-sds-3-x-projects/student-project-17_group-TowardsScalableTDA/00_introduction.py
r-e-x-a-g-o-n/scalable-data-science
138
1796201
<filename>dbcArchives/2021/000_0-sds-3-x-projects/student-project-17_group-TowardsScalableTDA/00_introduction.py # Databricks notebook source # MAGIC %md # MAGIC ScaDaMaLe Course [site](https://lamastex.github.io/scalable-data-science/sds/3/x/) and [book](https://lamastex.github.io/ScaDaMaLe/index.html) # COMMAND ----...
0
0
0
0
0
0
mayan/apps/mailer/classes.py
atitaya1412/Mayan-EDMS
343
1796220
<gh_stars>100-1000 import logging from django.utils.translation import ugettext_lazy as _ from mayan.apps.databases.classes import ModelBaseBackend __all__ = ('MailerBackend',) logger = logging.getLogger(name=__name__) class MailerBackend(ModelBaseBackend): """ Base class for the mailing backends. This cla...
0
0
0
0
0
0
python/examples/boilerplate_create_ctx.py
justinforbes/depthcharge
133
1796227
<filename>python/examples/boilerplate_create_ctx.py #!/usr/bin/env python3 import traceback from depthcharge import Console, Depthcharge, log ctx = None try: console = Console('/dev/ttyUSB0', baudrate=115200) ctx = Depthcharge(console, arch='arm') # Comment out the above ctx creation and uncomment the fo...
0
0
0
0
0
0
snippets/aggregators.py
hit9/skylark
114
1796334
from models import User count = User.count() max_id = User.max(User.id) min_id = User.min(User.id) sum_of_ids = User.sum(User.id) avg_of_ids = User.avg(User.id)
0
0
0
0
0
0
python/ql/test/library-tests/frameworks/rest_framework/testapp/views.py
angie1148/codeql
643
1796350
from .models import Foo, Bar from .serializers import FooSerializer, BarSerializer from rest_framework import viewsets from rest_framework.decorators import api_view from rest_framework.views import APIView from rest_framework.request import Request from rest_framework.response import Response from rest_framework.exce...
3
4
0
0
7
0
Efficient_Character-level_Document_Classification_by_Combining_Convolution_and_Recurrent_Layers/model/ops.py
rheehot/nlp_implementation
181
1796355
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils.rnn import PackedSequence, pack_padded_sequence, pad_packed_sequence from typing import Tuple, Union, Callable class Embedding(nn.Module): """Embedding class""" def __init__(self, num_embeddings: int, embedding_dim: int, p...
24
10
0
0
34
0
pyrival/graphs/dfs.py
MattJDavidson/aoc2021
748
1796372
def dfs(graph, start: int=0) -> tuple[object, object]: n = len(graph) dp = [0] * n visited, finished = [False] * n, [False] * n stack = [start] while stack: start = stack[-1] # push unvisited children into stack if not visited[start]: visited[start] = True ...
1
1
0
0
2
0
src/loadgenerator/sre_recipe_utils.py
Ayelet41/cloud-ops-sandbox
229
1796407
<gh_stars>100-1000 # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
0
0
0
0
0
0
scripts/pygame_test.py
kanpapa/jetson-nano-tools
106
1796431
# coding: utf-8 # pygame test on jetson nano import pygame from pygame.locals import * import sys pygame.init() screen = pygame.display.set_mode((640, 480)) pygame.display.set_caption('pygame test') while True: screen.fill((255, 255, 255)) pygame.draw.rect(screen, (0, 255, 0), Rect(10, 10, 100, 200)) pyga...
0
0
0
0
0
0
src/pytorch_adapt/validators/__init__.py
KevinMusgrave/pytorch-adapt
131
1796434
from .accuracy_validator import AccuracyValidator from .base_validator import BaseValidator from .class_cluster_validator import ClassClusterValidator from .deep_embedded_validator import DeepEmbeddedValidator from .diversity_validator import DiversityValidator from .entropy_validator import EntropyValidator from .erro...
0
0
0
0
0
0
torchbearer/callbacks/imaging/__init__.py
NunoEdgarGFlowHub/torchbearer
358
1796458
""" """ from .imaging import * from .inside_cnns import ClassAppearanceModel, RANDOM
0
0
0
0
0
0
fedlearner/data_join/key_mapper/key_mapping.py
Hsy-Intel/fedlearner
772
1796462
class BaseKeyMapper(object): def leader_mapping(self, item) -> dict: raise NotImplementedError def follower_mapping(self, item) -> dict: raise NotImplementedError @classmethod def name(cls) -> str: return "BASE_KEY_MAPPER"
0
3
0
0
3
0
flare/utils/__init__.py
aaronchen0316/flare
144
1796473
<gh_stars>100-1000 from .element_coder import NumpyEncoder
0
0
0
0
0
0
jina/types/request/data.py
Rohitpandit021/jina
15,179
1796504
<filename>jina/types/request/data.py from . import Request from .mixin import DocsPropertyMixin, GroundtruthPropertyMixin class DataRequest(Request, DocsPropertyMixin, GroundtruthPropertyMixin): """Data request class.""" @property def endpoint(self) -> str: """Get the endpoint. # noqa: D...
0
0
0
0
0
0
module/htmd.py
cyberlimit/DarkWEB
199
1796511
<gh_stars>100-1000 #! ../usr/bin/python2 # import module import subprocess,time,random,sys # colour G = "\033[32m"; O = "\033[33m"; B = "\033[34m"; R = "\033[31m"; W = "\033[0m"; # random.colour x = "\033[" color = (x+"0m",x+"31m",x+"32m",x+"34m",x+"35m",x+"36m") Z = random.choice(color) r = random.choice(color) ...
0
0
0
0
0
0
apps/accounts/utils/profile.py
goztrk/django-htk
206
1796566
# Django Imports from django.contrib.auth import get_user_model # HTK Imports from htk.apps.accounts.utils.general import get_user_profile_model def create_missing_user_profiles(): """Create missing user profiles """ UserModel = get_user_model() UserProfileModel = get_user_profile_model() if User...
0
0
0
0
0
0
WebMirror/management/rss_parser_funcs/feed_parse_extractWuxiaNation.py
fake-name/ReadableWebProxy
193
1796585
<filename>WebMirror/management/rss_parser_funcs/feed_parse_extractWuxiaNation.py def extractWuxiaNation(item): """ 'WuxiaNation' """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol or frag) or 'preview' in item['title'].lower(): return None if 'Announcements' in item...
0
0
0
0
0
0
terrascript/jetstream/r.py
mjuenema/python-terrascript
507
1796586
# terrascript/jetstream/r.py # Automatically generated by tools/makecode.py () import warnings warnings.warn( "using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2 ) import terrascript class jetstream_consumer(terrascript.Resource): pass class jetstream_kv_bucket(terrascript.Resource...
0
0
0
0
0
0
electrumsv/devices/digitalbitbox/qt.py
electrumsv/electrumsv
136
1796609
from typing import cast, TYPE_CHECKING from ...constants import unpack_derivation_path from ...wallet import AbstractAccount from ...wallet_database.types import KeyListRow from ..hw_wallet.qt import QtHandlerBase, QtPluginBase from .digitalbitbox import DigitalBitboxPlugin, DigitalBitbox_KeyStore if TYPE_CHECKING:...
4
3
2
0
9
0
gooey/gui/util/functional.py
Jacke/Gooey
13,430
1796637
<reponame>Jacke/Gooey ''' Utils for functional methodologies throughout Gooey ''' def merge_dictionaries(x,y): """ Merge 2 dictionaries with y taking overwriting x if a key collision is found This is mainly useful for maintaining the dictionary arguments to allow for more expressive & extensib...
0
0
0
0
0
0
PyFunceble/data/alembic/versions/459a0d7b8f09_add_idna_subject_column_into_whois.py
Centaurioun/PyFunceble
213
1796643
<filename>PyFunceble/data/alembic/versions/459a0d7b8f09_add_idna_subject_column_into_whois.py """Add idna_subject column into whois record Revision ID: 459a0d7b8f09 Revises: 45713fea8097 Create Date: 2020-12-07 12:37:52.018637 """ import sqlalchemy as sa from alembic import op # pylint: skip-file # revision identif...
0
0
0
0
0
0
tests/resources/test_default_args.py
elijahbenizzy/hamilton
298
1796696
""" Module for dummy functions to test graph things with. """ def A(required: int, defaults_to_zero: int = 0) -> int: """Function that should become part of the graph - A""" return required + defaults_to_zero def B(A: int) -> int: """Function that should become part of the graph - B""" return A * A ...
4
3
0
0
7
0
modules/google-earth-engine/docker/sepal-ee/sepal/drive/rx/touch.py
BuddyVolly/sepal
153
1796723
from datetime import datetime from sepal.drive import get_service from sepal.drive.rx.observables import execute def touch(credentials, file) -> object: def action(): get_service(credentials).files().update( fileId=file['id'], body={'modifiedTime': datetime.utcnow().strftime("%Y-%...
0
1
0
0
1
0
leetcode.com/python/414_Third_Maximum_Number.py
XSoyOscar/Algorithms
713
1796725
<gh_stars>100-1000 class Solution(object): def thirdMax(self, nums): """ :type nums: List[int] :rtype: int """ threeLargest = [None, None, None] for num in nums: self.updateThreelargest(threeLargest, num) if threeLargest[0] is None: r...
0
0
0
0
0
0
python_legacy/others_src/pgu/pgu/gui/pguglobals.py
garred/only_fighters
421
1796765
"""Contains the global reference to the PGU application.""" # pguglobals.py - A place to stick global variables that need to be accessed # from other modules. To avoid problems with circular imports # this module should not import any other PGU module. # A global reference to the appli...
0
0
0
0
0
0
SimCalorimetry/EcalElectronicsEmulation/test/Flat2Flat_cfg.py
ckamtsikis/cmssw
852
1796811
# The following comments couldn't be translated into the new config version: # Config file description: # test ECAL sequence: tcc hw input -> tp digi -> tcc hw input # check consistency of original and created tcc hardware input files import FWCore.ParameterSet.Config as cms process = cms.Process("TCCFlat2Flat") p...
0
0
0
0
0
0
pruner/fp_mbnetv2.py
cmu-enyac/LeGR
106
1796834
import torch import numpy as np import torch.nn as nn from pruner.filter_pruner import FilterPruner from model.MobileNetV2 import InvertedResidual class FilterPrunerMBNetV2(FilterPruner): def parse_dependency(self): pass def forward(self, x) -> object: if isinstance(self.model, nn.DataParalle...
0
5
0
0
5
0
data_gen/tts/bin/binarize.py
ishine/DiffSinger-1
288
1796840
<reponame>ishine/DiffSinger-1 import os os.environ["OMP_NUM_THREADS"] = "1" import importlib from utils.hparams import set_hparams, hparams def binarize(): binarizer_cls = hparams.get("binarizer_cls", 'data_gen.tts.base_binarizer.BaseBinarizer') pkg = ".".join(binarizer_cls.split(".")[:-1]) cls_name = b...
0
0
0
0
0
0
tests/providers/trino/transfers/test_gcs_trino.py
npodewitz/airflow
8,092
1796906
# # 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...
0
0
0
0
0
0
tests/test_excluded_no_substitution.py
tobgu/pyrthon
123
1796931
<gh_stars>100-1000 def test_no_substitution_when_module_not_registered(): assert type([]) is type(list())
0
0
0
0
0
0
h5Nastran/h5Nastran/post_process/result_readers/punch/__init__.py
ACea15/pyNastran
293
1796934
<gh_stars>100-1000 from __future__ import print_function, absolute_import from ._punch_reader import PunchReader from ._table_data import PunchTableData
0
0
0
0
0
0
tomviz/python/tomviz/state/_models.py
sankhesh/tomviz
284
1796936
from __future__ import annotations import json import jsonpatch from tomviz import operators, modules from ._pipeline import PipelineStateManager from ._utils import to_namespaces op_class_attrs = ['description', 'label', 'script', 'type'] class InvalidStateError(RuntimeError): pass class Base(object): ...
1
6
1
2
10
0
maro/cli/grass/lib/scripts/build_node_image_vm/init_build_node_image_vm.py
yangboz/maro
598
1796979
<filename>maro/cli/grass/lib/scripts/build_node_image_vm/init_build_node_image_vm.py # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. """Init Build Node Image VM. [WARNING] This script is a standalone script, which cannot use the ./utils tools. Only executed in grass/azure mode. After the i...
0
0
0
0
0
0
dictionary/admin/general_report.py
ankitgc1/django-sozluk-master
248
1796998
<reponame>ankitgc1/django-sozluk-master from django.contrib import admin, messages as notifications from django.contrib.admin import DateFieldListFilter from django.utils.translation import gettext, gettext_lazy as _ from dictionary.models import GeneralReport @admin.register(GeneralReport) class GeneralReportAdmin(...
0
0
0
0
0
0
python/graphframes/lib/__init__.py
zero323/graphframes
892
1797001
<gh_stars>100-1000 from .aggregate_messages import AggregateMessages from .pregel import Pregel __all__ = ['AggregateMessages', 'Pregel']
0
0
0
0
0
0
python/28_binary_heap/priority_queue.py
shipan3452/algo
22,028
1797006
#!/usr/bin/python # -*- coding: UTF-8 -*- from __future__ import annotations import math class QueueNode: def __init__(self, priority, data: object | None=None): assert type(priority) is int and priority >= 0 self.priority = priority self.data = data def __repr__(self) -> object: ...
3
7
0
2
12
0
test/spectralFeatures.py
wazenmai/Python-WORLD
113
1797020
<gh_stars>100-1000 # built-in imports import timeit # 3rd-party imports import numpy as np from scipy.io.wavfile import read as wavread from scipy.io.wavfile import write # local imports from world import main def lsd(ori_spec, syn_spec): # N x D orig_spec and N x D syn_spec; N is # frames # remove energy ...
0
0
0
0
0
0
nautobot/virtualization/apps.py
psmware-ltd/nautobot
384
1797025
from nautobot.core.apps import NautobotConfig class VirtualizationConfig(NautobotConfig): name: str = "nautobot.virtualization"
0
0
1
0
1
0
uff/parse_uff_metadata.py
rtzr/tensorrt-utils
205
1797049
<gh_stars>100-1000 #!/usr/bin/env python3 # Copyright 2020 NVIDIA Corporation # # 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
sam_bam/report_coverage_gaps.py
senjoro/biocode
355
1797062
<filename>sam_bam/report_coverage_gaps.py #!/usr/bin/env python3 """ If you have an mpileup file this script scans it to report any gaps (or dips) in coverage levels. It can report any positions where coverage drops below a certain level, for example, using the --min_coverage_depth (-mcd) option to report any spans w...
0
0
0
0
0
0
lib/galaxy/tools/filters/__init__.py
quacksawbones/galaxy-1
1,085
1797072
"""Deprecated module for toolbox filters. Filters placed in this module will still work - but filters should be moved to lib/galaxy/tool_util/toolbox/filters. """
0
0
0
0
0
0
crabageprediction/venv/Lib/site-packages/pandas/tests/indexes/period/methods/test_insert.py
13rianlucero/CrabAgePrediction
28,899
1797077
<reponame>13rianlucero/CrabAgePrediction import numpy as np import pytest from pandas import ( NaT, PeriodIndex, period_range, ) import pandas._testing as tm class TestInsert: @pytest.mark.parametrize("na", [np.nan, NaT, None]) def test_insert(self, na): # GH#18295 (test missing) ...
0
0
0
0
0
0
desktop/core/ext-py/lxml-3.3.6/src/lxml/pyclasslookup.py
kokosing/hue
5,079
1797080
<reponame>kokosing/hue # dummy module for backwards compatibility from etree import PythonElementClassLookup
0
0
0
0
0
0
bentoml/server/gunicorn_marshal_server.py
niits/BentoML
3,451
1797085
# Copyright 2019 Atalaya Tech, 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 writing, ...
7
2
0
1
10
0
converter/convert.py
MaxChangInnodisk/innotis-server
212
1797116
from tool.darknet2pytorch import Darknet import struct import sys def convert_layer_name(name) -> object: parts = name.split(".") parts[0] = "model" parts[2] = ''.join([i for i in parts[2] if not i.isdigit()]) return '.'.join(parts) config = sys.argv[1] model = Darknet(config) weights = sys.argv[2] mo...
0
1
0
0
1
0
tick/solver/tests/adagrad_test.py
sumau/tick
411
1797120
# License: BSD 3 clause import unittest from tick.solver import AdaGrad from tick.solver.tests import TestSolver class AdagradTest(object): def test_solver_adagrad(self): """...Check AdaGrad solver for Logistic Regression with Ridge penalization """ solver = AdaGrad(max_iter=100, verbose...
0
2
0
0
2
0
nerfactor/util/tensor.py
leehsiu/nerfactor
183
1797132
<gh_stars>100-1000 # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
0
0
0
0
0
0
python/cucim/src/cucim/core/operations/spatial/tests/test_flip.py
aasthajh/cucim
131
1797176
import os import cupy import numpy as np import pytest import skimage.data from PIL import Image import cucim.core.operations.spatial as spt def get_input_arr() -> object: img = skimage.data.astronaut() arr = np.asarray(img) arr = np.transpose(arr) return arr def get_flipped_data() -> object: ...
0
2
0
0
2
0
gryphon/data_service/auditors/bitfinex_orderbook_auditor.py
qiquanzhijia/gryphon
1,109
1797199
<gh_stars>1000+ from delorean import Delorean from gryphon.data_service.auditors.orderbook_auditor import OrderbookAuditor class BitfinexOrderbookAuditor(OrderbookAuditor): def __init__(self): super(BitfinexOrderbookAuditor, self).__init__() self.exchange_name = 'BITFINEX' self.orderbook_...
0
0
0
0
0
0
Lib/site-packages/unittest2/util.py
inging44/python3
1,016
1797222
<reponame>inging44/python3<filename>Lib/site-packages/unittest2/util.py """Various utility functions.""" from os.path import commonprefix __unittest = True _MAX_LENGTH = 80 _PLACEHOLDER_LEN = 12 _MIN_BEGIN_LEN = 5 _MIN_END_LEN = 5 _MIN_COMMON_LEN = 5 _MIN_DIFF_LEN = _MAX_LENGTH - \ (_MIN_BEGIN_LEN + ...
0
0
0
0
0
0
tensorwatch/stream.py
lesteve/tensorwatch
3,453
1797229
<reponame>lesteve/tensorwatch<filename>tensorwatch/stream.py # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import weakref, uuid from typing import Any from . import utils from .lv_types import StreamItem class Stream: def __init__(self, stream_name:str=None, console_debug:bool=False): ...
0
0
0
0
0
0
packages/pyright-internal/src/tests/samples/tryExcept8.py
RobertCraigie/pyright
3,934
1797260
# This sample tests the detection of inaccessible exception handlers. from typing import Type, Union def func1() -> None: pass def func2(): try: func1() except OSError: pass except Exception: pass # This should generate an error. except PermissionError: pass...
2
1
0
0
3
0
qstrader/position_sizer/naive.py
ivanliu1989/qstrader
113
1797265
from .base import AbstractPositionSizer class NaivePositionSizer(AbstractPositionSizer): def __init__(self, default_quantity: int=100): self.default_quantity = default_quantity def size_order(self, portfolio, initial_order) -> object: """ This NaivePositionSizer object follows all ...
1
1
0
0
2
0
spruned/dependencies/pycoinnet/PeerEvent.py
darosior/spruned
152
1797301
# # https://github.com/richardkiss/pycoinnet/ # # The MIT License (MIT) # # Copyright (c) 2014 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without ...
0
2
0
2
4
0
lore/io/multi_connection_proxy.py
timgates42/lore
1,549
1797317
import random import logging import re from lore.io.connection import Connection from lore.util import scrub_url logger = logging.getLogger(__name__) class MultiConnectionProxy(object): SQL_RUNNING_METHODS: list[str] = ['dataframe', 'unload', 'select', 'execute', 'temp_table'] def __init__(self, urls, nam...
2
2
1
2
7
0
Plug-and-play module/attention/CCNet/ccnet.py
riciche/SimpleCVReproduction
923
1797325
import functools import time import torch import torch.autograd as autograd import torch.cuda.comm as comm import torch.nn as nn import torch.nn.functional as F from torch.autograd.function import once_differentiable class CA_Weight(autograd.Function): @staticmethod def forward(ctx, t, f) -> object: ...
0
5
0
0
5
0
cloudtunes-server/cloudtunes/library/utils.py
skymemoryGit/cloudtunes
529
1797366
from functools import partial from collections import defaultdict from .models import UNTITLED_ARTIST, UNTITLED_ALBUM FIELDS_ORDER = [ 'id', 'source', 'source_id', 'title', 'number', 'mbid', 'artist_mbid', 'album_mbid' ] def compress_tracks_to_json(tracks) -> object: """ Ser...
0
1
0
0
1
0
tests/containers/test_ListDictContainer.py
ankitshah009/dcase_util
122
1797402
""" Unit tests for ListDictContainer """ import nose.tools import dcase_util from dcase_util.containers import ListDictContainer from nose.tools import * import tempfile import os def test_container(): data = ListDictContainer([ { 'key1': 100, 'key2': 400, }, { ...
0
0
0
0
0
0
deepseries/model/seq2seq/utils.py
EvilPsyCHo/Deep-Time-Series-Prediction
334
1797421
<reponame>EvilPsyCHo/Deep-Time-Series-Prediction<filename>deepseries/model/seq2seq/utils.py # encoding: utf-8 """ @author : <NAME> @contact: <EMAIL> @time : 2020/9/27 15:04 """ import torch import torch.nn as nn class MultiEmbeddings(nn.Module): def __init__(self, *variable_params): # example: *[(name,...
0
0
0
0
0
0
tests/extensions/test_github_actions.py
Bing1012/3
451
1797424
<filename>tests/extensions/test_github_actions.py #!/usr/bin/env python import sys from os.path import exists as path_exists from pyscaffold.api import create_project from pyscaffold.cli import run from pyscaffold.extensions.github_actions import GithubActions def test_create_project_with_github_actions(tmpfolder): ...
0
0
0
0
0
0
app/config.py
awesome-archive/susnote
136
1797472
#!/usr/bin/env python # encoding: utf-8 from configparser import ConfigParser import os config_parser = ConfigParser() config_parser.read(os.path.dirname(os.getcwd()) + "/config") def config_get(section, option) -> object: detail = config_parser.get(section, option) if detail in ['Yes','Y','True','true']: ...
0
1
0
0
1
0
apps/svg_brush.py
AntonBiryukovUofC/diffvg
488
1797524
import sys sys.path.append("../svg") from geometry import GeometryLoss import numpy as np import pygame as pg import torch import pydiffvg import tkinter as tk from tkinter import filedialog def box_kernel(val) -> object: return np.heaviside(-val+1,0) def cone_kernel(val) -> object: return np.ma...
3
9
0
0
12
0
docs/build_rules.py
Olde-Skuul/burgerlib
115
1797529
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Build rules for the makeprojects suite of build tools. This file is parsed by the cleanme, buildme, rebuildme and makeprojects command line tools to clean, build and generate project files. When any of these tools are invoked, this file is loaded and parsed to determ...
0
1
0
0
1
0
Python/Tests/TestData/DebuggerProject/AttachPtvsd.py
techkey/PTVS
404
1797563
import sys if '.' not in sys.path: sys.path.insert(0, '.') # so that we can find ptvsd if 'ptvsd' not in sys.modules: import ptvsd eval('ptvsd.enable_attach(' + sys.argv[1] + ')') ptvsd.wait_for_attach() sys.stdout.write('stdout') sys.stderr.write('stderr') x = 1
0
0
0
0
0
0
mimic/model/__init__.py
ksheedlo/mimic
141
1797586
""" Model objects for Mimic services. """
0
0
0
0
0
0
pycuda/debug.py
hesom/pycuda
1,264
1797633
<filename>pycuda/debug.py import pycuda.driver import sys from optparse import OptionParser from os.path import exists pycuda.driver.set_debugging() parser = OptionParser(usage="usage: %prog [options] SCRIPT-TO-RUN [SCRIPT-ARGUMENTS]") parser.disable_interspersed_args() options, args = parser.parse_args() if len(a...
0
0
0
0
0
0
brumadinho_heatmap/misc/geojson.py
JBezerra/brumadinho_location
666
1797658
#! usr/bin/env python from sys import argv from os.path import exists import json script, in_file, out_file = argv with open(in_file) as f: data = json.load(f) new_data = [] for row in data['results']: new_data.append(row) geojson = { "type": "FeatureCollection", "features": [{ "type": "Featu...
0
0
0
0
0
0
reference-scales.py
Gandedong/matplotlib-cheatsheet
2,960
1797711
# ---------------------------------------------------------------------------- # Title: Scientific Visualisation - Python & Matplotlib # Author: <NAME> # License: BSD # ---------------------------------------------------------------------------- import numpy as np import matplotlib.pyplot as plt from matplotlib.tick...
0
0
0
0
0
0
examples/get_data.py
nkorinek/earthpy
350
1797730
<filename>examples/get_data.py """ Download Data with EarthPy ================================================================== Learn how to download data subsets available in EarthPy and other data accessible via URLs using EarthPy. """ ##############################################################################...
0
0
0
0
0
0
octis/configuration/defaults.py
lei-liu1/OCTIS
340
1797735
<filename>octis/configuration/defaults.py from pathlib import Path ''' # MODELS PARAMETERS # ''' model_descriptions = {'LDA': {'name': 'Latent Dirichlet Allocation (LDA)', 'citation': '<NAME>, <NAME>, <NAME>: Latent Dirichlet Allocation. ' 'NIP...
0
0
0
0
0
0
docs/components_page/components/__tests__/test_dropdown.py
glsdown/dash-bootstrap-components
776
1797745
""" Testing of callbacks in non-Python Dropdown snippets. """ from pathlib import Path import dash.testing.wait as wait from .helpers import load_jl_app, load_r_app HERE = Path(__file__).parent def test_r_dropdown(dashr): r_app = load_r_app((HERE.parent / "dropdown" / "menu_items.R"), "dropdown") dashr.sta...
0
0
0
0
0
0
tests/test_parse.py
timgates42/python-registry
326
1797774
import Registry from fixtures import * def test_file_type(hive): assert hive._regf.file_type() == Registry.RegistryParse.FileType.FILE_TYPE_PRIMARY
0
0
0
0
0
0
i18n/show_full_width_form_punctuation.py
shuge/Qt-Python-Binding-Examples
179
1797787
<gh_stars>100-1000 #!/usr/bin/env python #-*- coding:utf-8 -*- """ show Full width form punctuation Tested environment: Mac OS X 10.6.8 http://developer.qt.nokia.com/forums/viewthread/12102/ """ import sys try: from PySide import QtCore from PySide import QtGui except ImportError: from PyQt4...
0
0
0
0
0
0
util/util_C_GCN.py
BruceW91/CVSE
152
1797806
import math from urllib.request import urlretrieve import torch from PIL import Image from tqdm import tqdm import numpy as np import random import torch.nn.functional as F '''gen_A: co-occur matrix generation''' def gen_A(num_classes, t, adj_file) -> object: import pickle result = pickle.load(open(adj_file, ...
3
5
0
0
8
0
astropy/timeseries/periodograms/bls/__init__.py
jayvdb/astropy
445
1797811
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Box Least Squares ================= AstroPy-compatible reference implementation of the transit periorogram used to discover transiting exoplanets. """ __all__ = ["BoxLeastSquares", "BoxLeastSquaresResults"] from .core import BoxLeastSquares, BoxLe...
0
0
0
0
0
0
optimus/engines/base/distributed/dataframe.py
ironmussa/Optimus
1,045
1797853
from optimus.engines.base.dataframe.dataframe import DataFrameBaseDataFrame class DistributedBaseDataFrame(DataFrameBaseDataFrame): pass
0
0
0
0
0
0
examples/03_extracting_references.py
netlify/sqlfluff
3,024
1797858
"""This is an example of how to extract table names.""" import sqlfluff query_with_ctes = """ WITH foo AS (SELECT * FROM bar.bar), baz AS (SELECT * FROM bap) SELECT * FROM foo INNER JOIN baz USING (user_id) INNER JOIN ban USING (user_id) """ # -------- PARSING ---------- parsed = sqlfluff.parse(query_with_ctes) # ...
0
0
0
0
0
0
insights/parsers/tests/test_avc_hash_stats.py
lhuett/insights-core
121
1797862
import doctest from insights.parsers import avc_hash_stats from insights.parsers.avc_hash_stats import AvcHashStats from insights.tests import context_wrap AVC_HASH_STATS = """ entries: 509 buckets used: 290/512 longest chain: 7 """.strip() def test_avc_hash_stats(): hash_stats = avc_hash_stats.AvcHashStats(cont...
0
0
0
0
0
0
talkgenerator/slide/slide_deck.py
korymath/talk-generator
110
1797868
<gh_stars>100-1000 import logging from typing import List from talkgenerator.slide.slides import Slide logger = logging.getLogger("talkgenerator") class SlideDeck: """ Represents a deck of Slide objects """ def __init__(self, size): self._size = size self._slides : List[Slide] = [None] *...
0
0
0
0
0
0
notMNIST/notMNISTFullyConvultional.py
shekkizh/TensorflowProjects
204
1797873
__author__ = 'Charlie' import numpy as np import os, sys, inspect import tensorflow as tf utils_path = os.path.realpath( os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], ".."))) if utils_path not in sys.path: sys.path.insert(0, utils_path) import TensorflowUtils as utils ...
0
0
0
0
0
0
ambari-common/src/main/python/resource_management/core/providers/packaging.py
likenamehaojie/Apache-Ambari-ZH
1,664
1797885
""" 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 use this ...
0
2
0
0
2
0
desktop/core/ext-py/cx_Oracle-6.4.1/test/Module.py
yetsun/hue
5,079
1797896
#------------------------------------------------------------------------------ # Copyright 2018, Oracle and/or its affiliates. All rights reserved. #------------------------------------------------------------------------------ """Module for testing module methods.""" import datetime import time class TestModule(Ba...
0
0
0
0
0
0
run.py
LaudateCorpus1/flask-website
1,173
1797897
<reponame>LaudateCorpus1/flask-website from flask_website import app app.run(debug=True)
0
0
0
0
0
0
python/vmaf/core/adm_dwt2_py.py
xinglinsky/vmaf
2,874
1797921
<reponame>xinglinsky/vmaf import pywt def adm_dwt2_py(a): a, ds = pywt.dwt2(a, 'db2', 'periodization') h, v, d = ds return a, v, h, d def adm_idwt2_py(a_v_h_d): a, v, h, d = a_v_h_d ds = (h, v, d) a = pywt.idwt2((a, ds), 'db2', 'periodization') return a
0
0
0
0
0
0
dataviz/politics_usnorthsouth.py
Udzu/pudzu
119
1797952
<gh_stars>100-1000 from pudzu.charts import * import seaborn as sns from pudzu.dates import * import dateparser CONFEDERATE = ["South Carolina", "Mississippi", "Florida", "Alabama", "Georgia", "Louisiana", "Texas"] + ["Arkansas", "North Carolina", "Tennessee", "Virginia"] UNION = ["California", "Connecticut", "I...
0
0
0
0
0
0