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
WebDevelopment/BackEndWorkspaceFiles/solutions/1_flask_exercise/worldbankapp/routes.py
vmukund100/dsnd_vm
1,030
3306906
<reponame>vmukund100/dsnd_vm<filename>WebDevelopment/BackEndWorkspaceFiles/solutions/1_flask_exercise/worldbankapp/routes.py<gh_stars>1000+ from worldbankapp import app from flask import render_template @app.route('/') @app.route('/index') def index(): return render_template('index.html') @app.route('/projec...
0
0
0
0
0
0
svplot/extract_svs.py
bgruening/bcbb
339
3306920
<filename>svplot/extract_svs.py #!/usr/bin/env python """Extract structural variations in regions of interest into tab delimited files for circos plots. """ import csv import os import subprocess import pysam def main(): samples = {"H1047R": ["H1047R-2-3", "H1047R-2-7", "H1047R-2-9", "H1047R-P"], "...
0
0
0
0
0
0
deepspeed/runtime/swap_tensor/pipelined_optimizer_swapper.py
jglaser/DeepSpeed
6,728
3306942
<reponame>jglaser/DeepSpeed """ Copyright 2020 The Microsoft DeepSpeed Team. Licensed under the MIT license. Functionality of swapping optimizer tensors to/from (NVMe) storage devices. """ import os import torch from deepspeed.utils.logging import logger from deepspeed.ops.aio import AsyncIOBuilder from deepspeed.r...
0
0
0
0
0
0
insights/parsers/tests/test_saphostexec.py
haithcockce/insights-core
121
3306971
<reponame>haithcockce/insights-core from insights.parsers import saphostexec, SkipException, ParseException from insights.parsers.saphostexec import SAPHostExecStatus, SAPHostExecVersion from insights.tests import context_wrap import pytest import doctest STATUS_DOC = """ saphostexec running (pid = 9159) sapstartsrv r...
0
0
0
0
0
0
openchat/base/agents/convai2.py
mgorkove/openchat
383
3306997
<gh_stars>100-1000 from openchat.base import ParlaiGenerationAgent class ConvAI2Agent(ParlaiGenerationAgent): def add_persona(self, histories, user_id, text): histories[user_id]["prefix"].append(f"your persona: {text}") def clear_persona(self, histories, user_id): histories[user_id]["prefix"...
0
0
0
0
0
0
examples/HybridTut/HybridTut_run.py
adamjhn/netpyne
120
3307008
import HybridTut # import parameters file from netpyne import sim # import netpyne init module sim.createSimulateAnalyze(netParams = HybridTut.netParams, simConfig = HybridTut.simConfig) # create and simulate network # Check the model output: sim.checkOutput is used for testing purposes. Please comment out the fo...
0
0
0
0
0
0
tests/unitary/LiquidityGaugeWrapperUnit/test_transferFrom.py
AqualisDAO/curve-dao-contracts
217
3307021
#!/usr/bin/python3 import brownie import pytest @pytest.fixture(scope="module", autouse=True) def setup(accounts, gauge_controller, minter, liquidity_gauge, unit_gauge, token, mock_lp_token): token.set_minter(minter, {"from": accounts[0]}) gauge_controller.add_type(b"Liquidity", 10 ** 10, {"from": accounts[0...
0
0
0
0
0
0
src/auth/oauth.py
piwaniuk/critic
216
3307038
# -*- mode: python; encoding: utf-8 -*- # # Copyright 2014 the Critic contributors, Opera Software ASA # # 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...
1
2
0
0
3
0
data/imagenet.py
TuSimple/neuron-selectivity-transfer
127
3307049
<gh_stars>100-1000 import os import sys import config sys.path.insert(0, config.mxnet_path) import mxnet as mx def imagenet_iterator(data_dir, batch_size, kv): train = mx.io.ImageRecordIter( path_imgrec = os.path.join(data_dir, "train.rec"), label_width = 1, da...
0
0
0
0
0
0
singular-value-decomposition/statistics.py
dawidvdh/programmers-introduction-to-mathematics
2,915
3307114
if __name__ == "__main__": import json with open('all_stories.json', 'r') as infile: data = json.loads(infile.read()) allWords = set() for entry in data: allWords |= set(entry['words']) print('{} unique words in all the stories'.format(len(allWords))) print('{} documents total...
0
0
0
0
0
0
moderngl_window/meta/__init__.py
minuJeong/moderngl-window
142
3307154
<filename>moderngl_window/meta/__init__.py<gh_stars>100-1000 from .data import DataDescription # noqa from .texture import TextureDescription # noqa from .scene import SceneDescription # noqa from .program import ProgramDescription # noqa
0
0
0
0
0
0
djassembla/wrapper.py
annevandalfsen/screenbird
121
3307170
from __future__ import annotations from djassembla.models import Space, Ticket from urllib2 import urlopen, Request, build_opener, HTTPHandler import base64 from djassembla.errors import AssemblaError from xml.dom.minidom import parseString from lxml import etree import urllib class Connection(object): ...
5
12
1
1
19
0
docs/plugins.py
mattkram/dirty-equals
386
3307188
<reponame>mattkram/dirty-equals<gh_stars>100-1000 import logging import os import re from mkdocs.config import Config from mkdocs.structure.files import Files from mkdocs.structure.pages import Page try: import pytest except ImportError: pytest = None logger = logging.getLogger('mkdocs.test_examples') def ...
0
0
0
0
0
0
code/deep/DAAN/data_loader.py
jiaruonan/transferlearning
9,657
3307204
<reponame>jiaruonan/transferlearning from torchvision import datasets, transforms import torch import numpy as np from torchvision import transforms import os from PIL import Image, ImageOps class ResizeImage(): def __init__(self, size): if isinstance(size, int): self.size = (int(size), int...
0
0
0
0
0
0
pyhn/gui.py
TimothyDJones/pyhn
127
3307219
# -*- coding: utf-8 -*- from __future__ import annotations import sys import urwid import subprocess import threading from pyhn.popup import Popup from pyhn.poller import Poller from pyhn.config import Config, FALSE_WORDS, TRUE_WORDS from pyhn import __version__ PY3 = False if sys.version_info.major == 3: PY3 = T...
5
3
0
10
18
0
datadog_checks_dev/datadog_checks/dev/tooling/commands/meta/scripts/remove_labels.py
mchelen-gov/integrations-core
663
3307231
<gh_stars>100-1000 # (C) Datadog, Inc. 2020-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import click import requests from ...console import CONTEXT_SETTINGS, abort, echo_success @click.command( 'remove-labels', context_settings=CONTEXT_SETTINGS, short_help='Remove al...
0
0
0
0
0
0
etl/parsers/etw/Microsoft_Windows_Kernel_IO.py
IMULMUL/etl-parser
104
3307244
<reponame>IMULMUL/etl-parser # -*- coding: utf-8 -*- """ Microsoft-Windows-Kernel-IO GUID : abf1f586-2e50-4ba8-928d-49044e6f0db7 """ from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct from etl.utils import WString, CString, SystemTime, Guid from e...
0
0
0
0
0
0
server/storage.py
chrononyan/ok
148
3307269
<filename>server/storage.py import os import hmac import hashlib import base64 import datetime as dt import logging import random import string from urllib.parse import urlencode, urljoin from werkzeug.utils import secure_filename from libcloud.storage.types import Provider from libcloud.storage.providers import get_d...
0
0
0
0
0
0
tests/bip/bip32/test_bip32_key_data.py
MIPPLTeam/bip_utils
149
3307273
<reponame>MIPPLTeam/bip_utils # Copyright (c) 2021 <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 limitation the rights # to use, copy, modify...
0
0
0
0
0
0
model_compiler/src/model_compiler/models/targets/tflite_model.py
yuanliya/Adlik
548
3307282
<filename>model_compiler/src/model_compiler/models/targets/tflite_model.py<gh_stars>100-1000 # Copyright 2019 ZTE corporation. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import os from typing import NamedTuple, Optional, Sequence, Tuple import tensorflow as tf from .. import data_format, repo...
0
0
0
0
0
0
projects/arcface/arcface_loss.py
KaiyuYue/torchshard
265
3307284
<reponame>KaiyuYue/torchshard<filename>projects/arcface/arcface_loss.py import warnings import math from typing import Optional, TypeVar, List import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor from torch.nn import Module from torch.nn import init from torch.nn.parameter import...
0
0
0
0
0
0
recipes/Python/576922_Delete_all_message_older_thgiven_date_pop/recipe-576922.py
tdiprima/code
2,023
3307290
<filename>recipes/Python/576922_Delete_all_message_older_thgiven_date_pop/recipe-576922.py import os, sys, getpass import poplib # http://docs.python.org/library/poplib.html from email.utils import parsedate_tz import calendar import datetime # The main parameter last_wanted = datetime.datetime(2009, 10, 5) print last...
0
0
0
0
0
0
dotnet/private/rules/libraryset.bzl
purkhusid/rules_dotnet
143
3307298
"libraryset rules" load( "@io_bazel_rules_dotnet//dotnet/private:providers.bzl", "DotnetLibraryInfo", ) load("@io_bazel_rules_dotnet//dotnet/private:rules/common.bzl", "collect_transitive_info") load("@io_bazel_rules_dotnet//dotnet/private:common.bzl", "as_iterable") def _libraryset_impl(ctx) -> list[object]:...
0
1
0
0
1
0
pipenv/vendor/pexpect/exceptions.py
Enzime/pipenv
18,636
3307300
<gh_stars>1000+ """Exception classes used by Pexpect""" import traceback import sys class ExceptionPexpect(Exception): '''Base class for all exceptions raised by this module. ''' def __init__(self, value): super(ExceptionPexpect, self).__init__(value) self.value = value def __str__(s...
0
0
0
0
0
0
questions/remove-all-adjacent-duplicates-in-string/Solution.py
achow113/LeetCode
141
3307339
<gh_stars>100-1000 """ Given a string S of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and removing them. We repeatedly make duplicate removals on S until we no longer can. Return the final string after all such duplicate removals have been made.  It is guaranteed the an...
0
0
0
0
0
0
office365/sharepoint/search/query/tenantCustomQuerySuggestions.py
wreiner/Office365-REST-Python-Client
544
3307352
<filename>office365/sharepoint/search/query/tenantCustomQuerySuggestions.py from office365.runtime.client_value import ClientValue class TenantCustomQuerySuggestions(ClientValue): pass
0
0
0
0
0
0
archai/nas/finalizers.py
cclauss/archai
344
3307369
<reponame>cclauss/archai # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from archai.common.config import Config from typing import List, Tuple, Optional, Iterator from overrides import EnforceOverrides from torch import nn from archai.nas.model import Model from archai.nas.cell im...
0
0
0
0
0
0
kafka/tools/assigner/__main__.py
akashvacher/kafka-tools
578
3307371
# 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...
0
5
0
0
5
0
pythran/tests/openmp.legacy/omp_single_private.py
davidbrochart/pythran
1,647
3307386
<gh_stars>1000+ import omp def omp_single_private(): nr_threads_in_single = 0 nr_iterations = 0 result = 0 LOOPCOUNT = 1000 if 'omp parallel': use_parallel = omp.in_parallel() myresult = 0 myit = 0 for i in range(LOOPCOUNT): if 'omp single private(nr_thr...
0
0
0
0
0
0
locations/spiders/mcdonalds_ch.py
davidchiles/alltheplaces
297
3307457
<gh_stars>100-1000 # -*- coding: utf-8 -*- import scrapy import re import json import datetime from locations.items import GeojsonPointItem class McDonalsCHSpider(scrapy.Spider): name = "mcdonalds_ch" item_attributes = { 'brand': "McDonald's" } allowed_domains = ["www.mcdonalds.ch"] start_urls = ( ...
0
0
0
0
0
0
tests/client/test_frontiers.py
pardo/python-scrapinghub
163
3307471
import time from types import GeneratorType from collections import Iterable from six import string_types from scrapinghub.client.frontiers import Frontiers, Frontier, FrontierSlot from ..conftest import TEST_FRONTIER_SLOT def _add_test_requests_to_frontier(frontier): slot = frontier.get(TEST_FRONTIER_SLOT) ...
0
0
0
0
0
0
flearn/models/shakespeare/stacked_lstm.py
litian96/fair-federated-learning
171
3307486
from __future__ import annotations import numpy as np from tqdm import trange import json import os import sys import tensorflow as tf from tensorflow.contrib import rnn utils_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) utils_dir = os.path.join(utils_dir, 'utils') sys.path.ap...
3
8
0
0
11
0
utils/download.py
pwqbot/eoj3
107
3307517
<filename>utils/download.py<gh_stars>100-1000 import mimetypes import os from django.conf import settings from django.http import Http404 from django.http import HttpResponse from django.utils.encoding import iri_to_uri def respond_as_attachment(request, file_path, original_filename, document_root=None): if docume...
0
0
0
0
0
0
tst/regression/scripts/tests/shearingbox/ssheet.py
kahoooo/athena-public
174
3307540
# Regression test of shearing box and orbital advection with 2d hydro shwave. # Modules import logging import cmath import math import mpmath as mp import scripts.utils.athena as athena import sys sys.path.insert(0, '../../vis/python') import athena_read # noqa athena_read.check_nan_flag = True logger = logging.getLo...
0
1
0
0
1
0
Python/Tests/TestData/Grammar/FromImportStmt.py
techkey/PTVS
695
3307541
<filename>Python/Tests/TestData/Grammar/FromImportStmt.py<gh_stars>100-1000 from sys import winver from sys import winver as baz from sys.fob import winver from sys.fob import winver as baz from ...fob import oar from ....fob import oar from ......fob import oar from .......fob import oar from fob import (fob as oar, b...
0
0
0
0
0
0
bughunt_loop.py
k0keoyo/KernelFuzzer
377
3307560
from subprocess import call, TimeoutExpired import fnmatch import sys import shutil import os import time # Current timeout set to 25 minutes, i.e. 25*60 seconds. #TIMEOUT=1500 TIMEOUT=600 THREADS=1 # Current number of executions is 1M. #EXECUTIONS=1000000 EXECUTIONS=350000 SEED=1 COMMAND='bughunt.exe' # Change work...
0
0
0
0
0
0
ptr_gen.py
acmd/GIT-TCC-ACMD
1,014
3307562
#!/usr/bin/env python from string import Template import sys HEADER = Template('''\ package goquic import ( "sync" "math" ) // Generated by `ptr_gen.py ${args}` // Do not edit manually! ''') TMPL = Template('''\ var ${inst}Ptr = &${cls}Ptr{pool: make(map[int64]*${cls})} type ${cls}Ptr struct { sync.RWMutex ...
0
0
0
0
0
0
datasets/format_market_train.py
kurnianggoro/Deep-Mutual-Learning
317
3307563
""" Format Market-1501 training images with consecutive labels. This code modifies the data preparation method of "Learning Deep Feature Representations with Domain Guided Dropout for Person Re-identification". """ import shutil from glob import glob from datasets.utils import * def _format_train_data(in_...
0
0
0
0
0
0
tests/pytest/test_runner.py
lavanyajagan/cocotb
350
3307564
<filename>tests/pytest/test_runner.py # Copyright cocotb contributors # Licensed under the Revised BSD License, see LICENSE for details. # SPDX-License-Identifier: BSD-3-Clause import os import pytest import cocotb from cocotb.runner import get_runner from cocotb.triggers import Timer pytestmark = pytest.mark.simul...
0
0
0
0
0
0
test/test_evaluate_bind.py
ROZBEH/rdflib
1,424
3307578
""" Verify evaluation of BIND expressions of different types. See <http://www.w3.org/TR/sparql11-query/#rExpression>. """ from rdflib import Graph, URIRef, Literal, Variable def test_bind(): base = "http://example.org/" g = Graph() g.add((URIRef(base + "thing"), URIRef(base + "ns#comment"), Literal("anyth...
0
0
0
0
0
0
tests/chainer_tests/training_tests/triggers_tests/test_time_trigger.py
zaltoprofen/chainer
3,705
3307581
import io import unittest import chainer from chainer import testing class DummyTrainer(object): def __init__(self): self.elapsed_time: int = 0 class TestTimeTrigger(unittest.TestCase): def setUp(self): self.trigger = chainer.training.triggers.TimeTrigger(1) self.trainer = DummyTr...
0
0
0
1
1
0
model-optimizer/extensions/front/onnx/aten_ext.py
monroid/openvino
2,406
3307594
# Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 from extensions.ops.aten import ATen from mo.front.extractor import FrontExtractorOp from mo.front.onnx.extractors.utils import onnx_attr class ATenFrontExtractor(FrontExtractorOp): op: str = 'ATen' enabled: bool = True @c...
0
1
2
0
3
0
227 Basic Calculator II.py
krishna13052001/LeetCode
872
3307644
""" Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, +, -, *, / operators and empty spaces . The integer division should truncate toward zero. You may assume that the given expression is always valid. Some examples: "3+2*2" = 7 " 3/2 " = ...
0
5
0
0
5
0
tools/tensorflow/fc/read_cifar10.py
feifeibear/dlbench
181
3307655
import os import tensorflow as tf IMAGE_SIZE = 32 # Global constants describing the CIFAR-10 data set. NUM_CLASSES = 10 NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN = 50000 NUM_EXAMPLES_PER_EPOCH_FOR_EVAL = 10000 def read_cifar10(filenames, use_queue: bool=False) -> object: class CIFAR10Record(object): pass result = CI...
1
1
0
0
2
0
mmdet2trt/models/backbones/__init__.py
tehkillerbee/mmdetection-to-tensorrt
496
3307673
<gh_stars>100-1000 from .base_backbone import BaseBackboneWraper __all__ = ['BaseBackboneWraper']
0
0
0
0
0
0
spotdl/tests/test_config.py
khjxiaogu/spotify-downloader
4,698
3307701
<reponame>khjxiaogu/spotify-downloader<filename>spotdl/tests/test_config.py import spotdl.config import argparse import os import sys import yaml import pytest @pytest.mark.xfail @pytest.fixture(scope="module") def config_path(tmpdir_factory): config_path = os.path.join(str(tmpdir_factory.mktemp("config")), "con...
0
0
0
0
0
0
alipay/aop/api/domain/AntMerchantExpandLogisticsorderCreateModel.py
snowxmas/alipay-sdk-python-all
213
3307703
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import annotations import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.OrderExtInfo import OrderExtInfo class AntMerchantExpandLogisticsorderCreateModel(object): def __init__(self): self._ext_info: None...
0
30
0
28
58
0
lisa/web_api/__init__.py
jrespeto/LiSa
244
3307706
""" Web API. """
0
0
0
0
0
0
johnnydep/env_check.py
pombredanne/johnnydep
254
3307719
<filename>johnnydep/env_check.py import json import os import platform import sys def format_full_version(info): version = "{0.major}.{0.minor}.{0.micro}".format(info) kind = info.releaselevel if kind != "final": version += kind[0] + str(info.serial) return version # cribbed from packaging.m...
0
0
0
0
0
0
tests/nn/config/test_config_utils.py
preeti98/sleap
156
3307723
import attr import pytest from typing import Optional, Text from sleap.nn.system import use_cpu_only use_cpu_only() # hide GPUs for test from sleap.nn.config import utils def test_one_of(): @utils.oneof @attr.s(auto_attribs=True) class ExclusiveClass: a: Optional[Text] = None b: Option...
0
0
2
0
2
0
base/site-packages/news/feeds.py
edisonlz/fastor
285
3307727
from django.contrib.syndication.feeds import Feed from django.contrib.sites.models import Site from django.core.urlresolvers import reverse from news.models import NewsItem class NewsFeed(Feed): def title(self) -> object: return u"%s" % Site.objects.get_current().name def description(self) -> object: return u'...
0
5
0
0
5
0
workspace.py
nlp201/AlfredWorkflow-DEVONthink-Search
456
3307731
<filename>workspace.py<gh_stars>100-1000 #!/usr/bin/python # -*- coding: UTF-8 -*- import ast import json import shlex import subprocess cmdScript = "osascript -e 'tell application \"DEVONthink 3\" to get workspaces' -s s" cmdList = shlex.split(cmdScript) cmdResult = subprocess.check_output(cmdList) workspaceList = as...
0
0
0
0
0
0
tests/test_exception_handler_settings.py
sumeet-/Zappa
12,888
3307744
API_STAGE = 'dev' APP_FUNCTION = 'raises_exception' APP_MODULE = 'tests.test_handler' BINARY_SUPPORT = False CONTEXT_HEADER_MAPPINGS = {} DEBUG = 'True' DJANGO_SETTINGS = None DOMAIN = 'api.example.com' ENVIRONMENT_VARIABLES = {} LOG_LEVEL = 'DEBUG' PROJECT_NAME = 'raises_exception' COGNITO_TRIGGER_MAPPING = {} EXCEPTI...
0
0
0
0
0
0
tools/bigquery_user_info_updater_tool/cron/bigquery_user_info_updater/tests/test_nested_user_info_updater.py
ruchirjain86/professional-services
2,116
3307762
# 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.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
0
2
0
0
2
0
examples/src/dbnd_examples/pipelines/top_artists_class_tasks.py
ipattarapong/dbnd
224
3307768
<filename>examples/src/dbnd_examples/pipelines/top_artists_class_tasks.py import datetime import random from collections import defaultdict from datetime import timedelta from heapq import nlargest import six from dbnd import data, output, parameter from dbnd.tasks import DataSourceTask, PipelineTask, PythonTask fro...
0
0
0
0
0
0
evosax/networks/shared.py
RobertTLange/evosax
102
3307769
import jax import jax.numpy as jnp from flax import linen as nn import chex from jax.nn.initializers import ( glorot_normal, glorot_uniform, he_normal, he_uniform, kaiming_normal, kaiming_uniform, lecun_normal, lecun_uniform, xavier_normal, xavier_uniform, ) kernel_init_fn = { ...
15
5
0
0
20
0
setup.py
amykhuang/cld3
529
3307775
<filename>setup.py<gh_stars>100-1000 """Setup utility for gcld3.""" import os import platform import shutil import subprocess import setuptools from setuptools.command import build_ext __version__ = '3.0.13' _NAME = 'gcld3' REQUIREMENTS = ['pybind11 >= 2.5.0', 'wheel >= 0.34.2'] PROTO_FILES = [ 'src/feature_ext...
0
0
0
0
0
0
pyrate/configuration.py
sixy6e/PyRate
145
3307776
# This Python module is part of the PyRate software package. # # Copyright 2021 Geoscience Australia # # 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/...
12
19
0
7
38
0
basic/modules.py
DingKe/pytorch_workplace
184
3307801
import math import torch import torch.nn as nn from functions import * class ReLU(nn.Module): def forward(self, input) -> object: return relu(input) class Linear(nn.Module): r"""Applies a linear transformation to the incoming data: :math:`y = Ax + b` Args: in_features: size of each in...
1
3
0
0
4
0
projects/samples/howto/custom_robot_window_simple/controllers/custom_robot_window_simple/custom_robot_window_simple.py
Justin-Fisher/webots
1,561
3307809
<gh_stars>1000+ # Copyright 1996-2021 Cyberbotics Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
0
0
0
0
0
0
problems/examples/on-demand/artifact/challenge.py
minhnq1618/picoCTF
280
3307826
from hacksport.docker import DockerChallenge, Netcat class Problem(DockerChallenge): # by overriding the setup class a challenge author can pass custom arguments # to the docker build process as well as specify custom descriptions for the # dynamically assigned ports def setup(self): # The us...
0
0
0
0
0
0
petl/test/io/test_tees.py
OptionMetrics/petl
495
3307831
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division from tempfile import NamedTemporaryFile from petl.test.helpers import ieq import petl as etl def test_teepickle(): t1 = (('foo', 'bar'), ('a', 2), ('b', 1), ('c', 3)) f1 = NamedTemporar...
0
0
0
0
0
0
clearml/backend_api/session/jsonmodels/__init__.py
arielleoren/clearml
2,097
3307857
# coding: utf-8 __author__ = '<NAME>' __email__ = '<EMAIL>' __version__ = '2.4' from . import models from . import fields from . import errors __all__ = ["models", "fields", "errors"]
0
0
0
0
0
0
tests/integration/test_tcp_handler_http_responses/test_case.py
pdv-ru/ClickHouse
15,577
3307874
"""Test HTTP responses given by the TCP Handler.""" from pathlib import Path import pytest from helpers.cluster import ClickHouseCluster import requests cluster = ClickHouseCluster(__file__) node_with_http = cluster.add_instance( 'node_with_http', main_configs=["configs/config.d/http-port-31337.xml"] ) HTTP_P...
0
0
0
0
0
0
setup.py
iamthad/blendergltf
343
3307908
<gh_stars>100-1000 from distutils.core import setup setup( name='blendergltf', packages=['.'] )
0
0
0
0
0
0
StockAnalysisSystem/core/Trader/Sizer.py
lifg2000/StockAnalysisSystem
138
3307910
from .Interface import IBroker, ISizer class BuyCashPercent(ISizer): def __init__(self, percent: float): self.__percent = percent super(BuyCashPercent, self).__init__() def amount(self, security: str, price: float, broker: IBroker) -> int: if price < 0.01: return 0 ...
16
4
0
0
20
0
mail_templated/test_utils/run.py
artemrizhov/django-mail-templated
105
3307925
#!/usr/bin/env python """ Run tests without Django project. This module is added to the app package to make it possible for everyone to run the tests outside of any Django project context. """ import sys from django_setup import setup_django def run_tests(): # Old Django versions requires Django initialisation ...
0
0
0
0
0
0
simplekv/net/azurestore.py
sharathpuranik/simplekv
104
3307927
# coding=utf8 try: from azure.storage.blob import BlockBlobService # noqa: F401 from ._azurestore_old import AzureBlockBlobStore except ImportError: from ._azurestore_new import AzureBlockBlobStore __all__ = ["AzureBlockBlobStore"]
0
0
0
0
0
0
gn/ar.py
pospx/external_skia
2,151
3307933
<filename>gn/ar.py<gh_stars>1000+ #!/usr/bin/env python # # Copyright 2016 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import subprocess import sys # Equivalent to: rm -f $2 && $1 rcs $2 @$3 ar, output, rspfile = sys.argv[1:] if os.pa...
0
0
0
0
0
0
misc/pytorch_toolkit/face_antispoofing/eval_protocol.py
dqawami/openvino_training_extensions
256
3307975
<reponame>dqawami/openvino_training_extensions """ Copyright (c) 2020 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 re...
0
0
0
0
0
0
openbook_posts/migrations/0021_auto_20190309_1532.py
TamaraAbells/okuna-api
164
3307987
<filename>openbook_posts/migrations/0021_auto_20190309_1532.py # Generated by Django 2.2b1 on 2019-03-09 14:32 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('openbook_posts', '0020_auto_20190309_1527'), ] operations = [ migrations.Alte...
0
0
0
0
0
0
tests/util/test_check_data.py
xiangze/edward
5,200
3308021
<filename>tests/util/test_check_data.py from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from edward.models import Normal from edward.util import check_data class test_check_data_class(tf.test.TestCase): def te...
0
0
0
0
0
0
server/common/management/commands/dump_csv.py
paulu/opensurfaces
137
3308023
import csv from django.core.management.base import BaseCommand from django.contrib.contenttypes.models import ContentType from django.utils.encoding import smart_unicode class Command(BaseCommand): args = '' help = 'Helper to export CSV data' def handle(self, *args, **options): outdir = args[0] ...
0
0
0
0
0
0
kmip/core/misc.py
ondrap/PyKMIP
179
3308037
# Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory # 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/LICEN...
4
4
0
0
8
0
graphistry/tests/test_compute.py
cerebis/pygraphistry
1,595
3308083
<filename>graphistry/tests/test_compute.py # -*- coding: utf-8 -*- from typing import Iterable import os, numpy as np, pandas as pd, pyarrow as pa, pytest, queue from common import NoAuthTestCase from concurrent.futures import Future from mock import patch from graphistry.plotter import PlotterBase from graphistry.co...
0
0
0
0
0
0
test/scripts/cuda_memcheck_common.py
Hacky-DH/pytorch
60,067
3308100
<reponame>Hacky-DH/pytorch<gh_stars>1000+ # this file contains a simple parser that parses report # from cuda-memcheck class ParseError(Exception): """Whenever the simple parser is unable to parse the report, this exception will be raised""" pass class Report: """A report is a container of errors, and a ...
0
0
0
0
0
0
examples/calibration/calibration_flash_v5.py
4ndr3aR/depthai-python
182
3308102
<gh_stars>100-1000 #!/usr/bin/env python3 from pathlib import Path import cv2 import depthai as dai import argparse boardConfigFile = str((Path(__file__).parent / Path('../models/BW1098OBC.json')).resolve().absolute()) calibBinaryFile = str((Path(__file__).parent / Path('../models/depthai_v5.calib')).resolve().absolu...
0
0
0
0
0
0
Lib/site-packages/pbr/tests/testpackage/pbr_testpackage/__init__.py
inging44/python3
1,738
3308104
import pbr.version __version__ = pbr.version.VersionInfo('pbr_testpackage').version_string()
0
0
0
0
0
0
rnnmorph/util/embeddings.py
AliceCyber/rnnmorph
124
3308108
# -*- coding: utf-8 -*- # Автор: <NAME> # Описание: Вспомогательные функции для работы с словными эмбеддингами. import numpy as np from rnnmorph.data_preparation.word_vocabulary import WordVocabulary def shrink_w2v(input_filename, border, output_filename, print_step: int=10000): vocabulary_embeddings = dict() ...
4
1
0
0
5
0
source/soccer_data_api/leagueids.py
Heisenberg0ye/Soccer-Chat-Bot
1,185
3308127
LEAGUE_IDS = { "BSA": 2013, "BL": 2002, "FL1": 2015, "PL": 2021, "ELC": 2016, "PD": 2014, "SA": 2019, "PPL": 2017, "DED": 2003, "CL": 2001 }
0
0
0
0
0
0
RecoEcal/EgammaClusterProducers/python/particleFlowSuperClusterECALOnly_cfi.py
ckamtsikis/cmssw
852
3308151
<reponame>ckamtsikis/cmssw import FWCore.ParameterSet.Config as cms from RecoEcal.EgammaClusterProducers.particleFlowSuperClusterECALMustache_cfi import particleFlowSuperClusterECALMustache as _particleFlowSuperClusterECALMustache # "Mustache" clustering particleFlowSuperClusterECALOnly = _particleFlowSuperClusterECA...
0
0
0
0
0
0
tests/processors/test_basic_processors.py
saedx1/Maha
152
3308156
import pytest from maha.processors import FileProcessor, TextProcessor from tests.processors.test_base_processor import TestBaseProcessor class TestTextProcessor(TestBaseProcessor): __test__: bool = True @pytest.fixture() def processor(self, multiple_tweets: str) -> object: return TextProcessor....
1
4
1
0
6
0
emukit/quadrature/kernels/quadrature_matern32.py
amzn/emukit
272
3308167
"""The product Matern32 kernel embeddings.""" from typing import Optional, Union import numpy as np from ...quadrature.interfaces.standard_kernels import IProductMatern32 from ..measures import IntegrationMeasure, LebesgueMeasure from .quadrature_kernels import LebesgueEmbedding, QuadratureProductKernel class Quad...
10
10
0
0
20
0
widgy/management/commands/delete_orphan_versiontrackers.py
IndiumTechnology/django-widgy
168
3308178
<reponame>IndiumTechnology/django-widgy from optparse import make_option from django.core.management.base import BaseCommand from django.core import urlresolvers from django.contrib.sites.models import Site from widgy.models import VersionTracker class Command(BaseCommand): """ Deletes orphaned VersionTracke...
0
0
0
0
0
0
yinyang/src/core/OptionGenerator.py
rainoftime/yinyang
143
3308215
# MIT License # # Copyright (c) [2020 - 2020] The yinyang authors # # 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...
2
1
2
3
8
0
test/unit/test_test.py
rsennewald/ClusterRunner
164
3308233
import os from os.path import basename, dirname, relpath from test.framework.base_unit_test_case import BaseUnitTestCase class TestTest(BaseUnitTestCase): """ This test class is a place for "meta-tests" that attempt to ensure that our tests are being run correctly. """ def test_all_test_subdirectorie...
0
0
0
0
0
0
skylark/pmd_test.bzl
zabrewer/batfish
763
3308235
"""Test rule that executes PMD against a given library.""" def _impl(ctx) -> list[object]: lib = ctx.attr.lib[JavaInfo] src_jars = lib.source_jars if len(lib.source_jars) != 1: fail("Expecting a single java library") src_jar = lib.source_jars[0] # We'd like this to be the compile-time jar...
0
1
0
0
1
0
DQM/SiStripCommissioningSources/data/conversion_template_cfg.py
ckamtsikis/cmssw
852
3308241
import FWCore.ParameterSet.Config as cms process = cms.Process("Convert") process.load("DQM.SiStripCommon.MessageLogger_cfi") process.source = cms.Source("NewEventStreamFileReader", fileNames = cms.untracked.vstring("file:DATFILE") ) maxEvents = cms.PSet( input = cms.untracked.int32(-1) ) process.anal = cms.E...
0
0
0
0
0
0
doc/modules/code_samples/plot_hawkes_sum_exp_kernels.py
sumau/tick
411
3308248
import matplotlib.pyplot as plt from tick.plot import plot_hawkes_kernels from tick.hawkes import SimuHawkesSumExpKernels, SimuHawkesMulti, \ HawkesSumExpKern end_time = 1000 n_realizations = 10 decays = [.5, 2., 6.] baseline = [0.12, 0.07] adjacency = [[[0, .1, .4], [.2, 0., .2]], [[0, 0, 0], [.6, ...
0
0
0
0
0
0
Python3/793.py
rakhi2001/ecom7
854
3308267
<filename>Python3/793.py __________________________________________________________________________________________________ sample 28 ms submission import math class Solution: def preimageSizeFZF(self, K: int) -> int: def f(x): ans = 0 while x: x = x // 5 ans += x return ans ...
0
0
0
0
0
0
localstack/services/kinesis/kinesis_listener.py
AshwinParmar/localstack
8,330
3308277
from __future__ import annotations import random import json from requests.models import Response from localstack import constants, config from localstack.services.awslambda import lambda_api from localstack.utils.common import to_str def update_kinesis(method, path, data, headers, response: object | None=None, retur...
2
2
0
0
4
0
alex/applications/PublicTransportInfoCS/data/expand_stops.py
michlikv/alex
184
3308285
<filename>alex/applications/PublicTransportInfoCS/data/expand_stops.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ Expanding Czech stop/city/train names with inflection forms in all given morphological cases. Usage: ./expand_stops.py [-c 1,2,4] [-n] [-l] [-p] [-m previous.expanded.txt] stops.txt [stops-2.txt ....
0
0
0
0
0
0
pycket/test/racket-tests.py
namin/pycket
129
3308314
import pytest import subprocess def test_struct_test(): return_code = subprocess.call("./racket-tests.sh pycket/test/struct-test.rkt", shell=True) assert return_code == 0 @pytest.mark.xfail def test_struct_test_object_name(): return_code = subprocess.call("./racket-tests.sh pycket/test/struct-test-objec...
0
0
0
0
0
0
utils.py
JiangtaoFeng/MaskGIT-pytorch
163
3308319
from __future__ import annotations import os import albumentations import numpy as np import torch.nn as nn from PIL import Image from torch.utils.data import Dataset, DataLoader import matplotlib.pyplot as plt # --------------------------------------------- # # Data Utils # -------------...
2
4
0
0
6
0
pymnn/examples/MNNTrain/module_save/grad_test.py
xhuan28/MNN
6,958
3308361
import numpy as np import MNN nn = MNN.nn F = MNN.expr v0 = F.const([0.3,0.1, -0.3,0.4], [4]) v2 = F.const([0.3,0.1, -0.3,0.4], [4]) v1 = v0 * v0 outputDiff = F.const([0.05, 0.03, 0.02, 0.01], [4]) v0Grad = nn.grad(v1, [v0, v2], [outputDiff], "") print(v0Grad) print(v0Grad[0].read()) F.save(v0Grad, "temp.grad")
0
0
0
0
0
0
tests/r/test_cuckoos.py
hajime9652/observations
199
3308384
from __future__ import absolute_import from __future__ import division from __future__ import print_function import shutil import sys import tempfile from observations.r.cuckoos import cuckoos def test_cuckoos(): """Test module cuckoos.py by downloading cuckoos.csv and testing shape of extracted data has 12...
0
0
0
0
0
0
xnmt/output.py
msperber/misc
195
3308412
""" This module contains features related to outputs generated by a model. The main responsibilities are data structures for holding such outputs, and code to translate outputs into readable strings. """ from typing import List, Union from xnmt.persistence import Serializable, serializable_init class OutputProcesso...
9
9
4
0
22
0
tests/unionfind_test.py
williamsmj/prakhar1989-algorithms
2,797
3308418
import os, sys sys.path.append(os.path.join(os.getcwd(), os.path.pardir)) import unittest from union_find.unionfind import UnionFind class test_unionfind(unittest.TestCase): def setUp(self): self.uf = UnionFind() self.uf.insert("a", "b") self.uf.insert("b", "c") self.uf.insert("i",...
0
0
0
0
0
0
hikyuu/gui/HikyuuTDX.py
alenstar/hikyuu
1,283
3308439
<gh_stars>1000+ # -*- coding: utf-8 -*- import os import sys import shutil import logging import datetime from configparser import ConfigParser from PyQt5.QtWidgets import QApplication, QMainWindow, QFileDialog, QMessageBox from PyQt5.QtCore import pyqtSlot, QObject, pyqtSignal from PyQt5.QtGui import QIcon, QTextCur...
0
0
0
0
0
0
kinto/core/authorization.py
robinbanbury/kinto
4,618
3308449
<filename>kinto/core/authorization.py import functools import logging from pyramid.authorization import Authenticated from pyramid.interfaces import IAuthorizationPolicy from pyramid.settings import aslist from zope.interface import implementer from kinto.core import utils from kinto.core.storage import exceptions as...
0
0
0
0
0
0