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
runtimes/mlflow/tests/rest/conftest.py
alexander-manley/MLServer
191
3361122
import pytest from fastapi import FastAPI from fastapi.testclient import TestClient from mlserver.handlers import DataPlane, ModelRepositoryHandlers from mlserver.registry import MultiModelRegistry from mlserver.rest import RESTServer from mlserver.repository import ModelRepository from mlserver import Settings from...
12
8
0
0
20
0
sdk/python/pulumi_gcp/redis/_inputs.py
la3mmchen/pulumi-gcp
121
3361133
<reponame>la3mmchen/pulumi-gcp # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence,...
0
0
0
0
0
0
terrascript/resource/jeffwecan/vault.py
mjuenema/python-terrascript
507
3361135
<reponame>mjuenema/python-terrascript # terrascript/resource/jeffwecan/vault.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:30:10 UTC) import terrascript class vault_alicloud_auth_backend_role(terrascript.Resource): pass class vault_approle_auth_backend_login(terrascript.Resource): pass ...
0
0
0
0
0
0
qf_lib_tests/unit_tests/backtesting/test_order_factory.py
webclinic017/qf-lib
198
3361148
<reponame>webclinic017/qf-lib<gh_stars>100-1000 # Copyright 2016-present CERN – European Organization for Nuclear Research # # 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 # # ...
0
0
0
0
0
0
src/compas/datastructures/mesh/smoothing_numpy.py
funkchaser/compas
235
3361157
from numpy import array from .matrices import trimesh_cotangent_laplacian_matrix __all__ = ['trimesh_smooth_laplacian_cotangent'] def trimesh_smooth_laplacian_cotangent(trimesh, fixed, kmax: int=10): """Smooth a triangle mesh using a laplacian matrix with cotangent weights. Parameters ---------- t...
1
0
0
0
1
0
seqlike/utils/constructor.py
modernatx/seqlike
186
3361159
<filename>seqlike/utils/constructor.py # """Functions that are used in the SeqLike constructor. # They live outside of the SeqLike.py module to keep it unpolluted. # All of the functions here ought to be imported into its sibling __init__.py file # so that it's available at the top of the `seqlike.utils` namespace. #...
0
0
0
0
0
0
cartoframes/exceptions.py
CartoDB/cartoframes
236
3361166
<reponame>CartoDB/cartoframes class DOError(Exception): """This exception is raised when a problem is encountered while using DO functions. """ def __init__(self, message): super(DOError, self).__init__(message) class CatalogError(DOError): """This exception is raised when a problem is encou...
0
0
0
0
0
0
globalValue.py
gdjmck/multitrident
106
3361176
global glb_dict glb_dict = {} def addItem(key, value): glb_dict[key]=value def getItem(key) -> object: return glb_dict[key]
0
1
0
0
1
0
wavelet_prosody_toolkit/wavelet_prosody_toolkit/prosody_tools/lab.py
eugenemfu/TTS_HW
115
3361184
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import annotations """ AUTHOR - <NAME> <<EMAIL>> - <NAME> <<EMAIL>> DESCRIPTION This module provide routines to deal with annotation in TextGrid or HTK label formats LICENSE See https://github.com/asuni/wavelet_prosody_toolkit/blob/master...
14
3
0
0
17
0
k2/python/host/k2host/fsa_util.py
EmreOzkose/k2
491
3361201
# Copyright 2020 Mobvoi Inc. (authors: <NAME>) # See ../../../LICENSE for clarification regarding multiple authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
1
2
0
0
3
0
build/example_repos.bzl
quentinLeDilavrec/semantic
8,844
3361218
<reponame>quentinLeDilavrec/semantic load( "@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", ) _all_example_repos = { "numpy": { "data": [ "**/*.py", ], "commit": "0<PASSWORD>", "repo": "numpy/numpy", "sha256": "8e60c567cbab3309afa9508ee61df...
0
0
0
0
0
0
koalixcrm/crm/factories/factory_customer.py
Cataldir/koalixcrm
290
3361251
<filename>koalixcrm/crm/factories/factory_customer.py # -*- coding: utf-8 -*- import factory from koalixcrm.crm.models import Customer from koalixcrm.crm.factories.factory_contact import StandardContactFactory from koalixcrm.crm.factories.factory_customer_billing_cycle import StandardCustomerBillingCycleFactory clas...
0
0
0
0
0
0
chapter4/chapter4_standard_field_types_01.py
GoodMonsters/Building-Data-Science-Applications-with-FastAPI
107
3361266
<filename>chapter4/chapter4_standard_field_types_01.py from pydantic import BaseModel class Person(BaseModel): first_name: str last_name: str age: int person = Person(first_name="John", last_name="Doe", age=30) print(person) # first_name='John' last_name='Doe' age=30
0
0
0
0
0
0
anomalib/data/utils/download.py
alexriedel1/anomalib
689
3361276
<reponame>alexriedel1/anomalib<gh_stars>100-1000 """Helper to show progress bars with `urlretrieve`, check hash of file.""" # 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 co...
0
0
0
0
0
0
tests/test_code/py/exclude_modules_two_files/exclude_modules_a.py
FreddyZeng/code2flow
2,248
3361330
<reponame>FreddyZeng/code2flow import re from exclude_modules_b import match def a(): re.match() def b(): match() a() b()
0
0
0
0
0
0
src/debug.py
stillmatic/plaitpy
438
3361334
from __future__ import print_function from os import environ as ENV import sys DEBUG="DEBUG" in ENV VERBOSE=False def debug(*args): if DEBUG: print(" ".join(map(str, args)), file=sys.stderr) def verbose(*args): if VERBOSE: print(" ".join(map(str, args)), file=sys.stderr)
0
0
0
0
0
0
test/handlers/test_rgbgradientv2.py
Clueninja/rivalcfg
604
3361360
<reponame>Clueninja/rivalcfg import argparse import pytest from rivalcfg.handlers import rgbgradientv2 class TestProcessValue(object): @pytest.fixture def setting_info1(self): return { "value_type": "rgbgradientv2", "rgbgradientv2_header": { "color_field_lengt...
0
0
0
0
0
0
tests/test_core_methods.py
swills/pykwalify
275
3361363
<reponame>swills/pykwalify # -*- coding: utf-8 -*- import pytest from datetime import datetime from pykwalify.compat import unicode from pykwalify.core import Core # from pykwalify.errors import NotSequenceError, CoreError from pykwalify.errors import CoreError class Rule(object): def __init__(self, sequence=Non...
0
0
0
0
0
0
keystone/tests/protection/v3/test_consumer.py
10088/keystone
615
3361407
# 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, software # d...
0
0
0
0
0
0
Module 2/Chapter 8/load_data.py
saicharanabhishek/machinelearning_examples
101
3361447
<reponame>saicharanabhishek/machinelearning_examples """ Functions to load the dataset. """ import numpy as np def read_data(file_name): """This function is adapted from: https://github.com/benhamner/BioResponse/blob/master/Benchmarks/csv_io.py """ f = open(file_name) # skip header f.readline...
0
0
0
0
0
0
examples/tf/sage/unsupervised_sparse.py
YaoPu2021/galileo
115
3361455
# Copyright 2020 JD.com, Inc. Galileo Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
4
9
0
0
13
0
rllab/envs/mujoco/maze/point_maze_env.py
RussellM2020/maml_gps
1,838
3361473
from rllab.envs.mujoco.maze.maze_env import MazeEnv from rllab.envs.mujoco.point_env import PointEnv class PointMazeEnv(MazeEnv): MODEL_CLASS = PointEnv ORI_IND: int = 2 MAZE_HEIGHT: int = 2 MAZE_SIZE_SCALING: float = 3.0 MANUAL_COLLISION: bool = True
0
0
4
0
4
0
cpmpy/set_covering3.py
tias/hakank
279
3361491
<filename>cpmpy/set_covering3.py """ Set covering in cpmpy Problem from <NAME>: 'Optimization Models for Decision Making', page 302f http://ioe.engin.umich.edu/people/fac/books/murty/opti_model/junior-7.pdf 10 senators making a committee, where there must at least be one representative from each group: group: ...
0
0
0
0
0
0
tests/test_cmemcached.py
andreif/pylibmc
226
3361493
"""Ported cmemcached tests""" # NOTE Don't write new tests here. # These are ported from cmemcached to ensure compatibility. import pylibmc from nose.tools import eq_ from tests import PylibmcTestCase a = "a" I_ = b"I " Do = b"Do" I_Do = b"I Do" n12345 = "12345" num12345 = ...
0
0
0
0
0
0
scripts/treebank_words.py
theblueskies/prose
2,906
3361499
import json import os from nltk.tokenize import TreebankWordTokenizer, sent_tokenize t = TreebankWordTokenizer() with open(os.path.join('testdata', 'tokenize.json')) as d: data = json.load(d) words = [] sents = [] for text in data: for s in sent_tokenize(text): sents.append(s) words.append(t....
0
0
0
0
0
0
util/net/http_transport_test_server.py
hunter-packages/crashpad
777
3361527
#!/usr/bin/env python # coding: utf-8 # Copyright 2014 The Crashpad 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/LICEN...
0
4
3
1
8
0
saas/aiops/api/anomalydetection/setup.py
iuskye/SREWorks
407
3361537
<reponame>iuskye/SREWorks<filename>saas/aiops/api/anomalydetection/setup.py import setuptools try: # for pip >= 10 from pip._internal.req import parse_requirements try: # for pip >= 20.0 from pip._internal.network.session import PipSession except ModuleNotFoundError: # for pip >=...
0
0
0
0
0
0
tests/integration/get_tweet_by_id_test.py
markowanga/stweet
101
3361547
from typing import List, Tuple import stweet as st from stweet import RequestsWebClient from stweet.http_request import RequestDetails, RequestResponse from stweet.http_request.interceptor.logging_requests_web_client_interceptor import \ LoggingRequestsWebClientInterceptor from stweet.twitter_api.twitter_auth_web_...
2
1
0
0
3
0
Demo/classes/Range.py
arvindm95/unladen-swallow
2,293
3361555
"""Example of a generator: re-implement the built-in range function without actually constructing the list of values. OldStyleRange is coded in the way required to work in a 'for' loop before iterators were introduced into the language; using __getitem__ and __len__ . """ def handleargs(arglist): """Take list of ...
0
0
0
0
0
0
Chapter12/04_hierarchical_risk_parity/HRP_MC.py
kksonge/Hands-On-Machine-Learning-for-Algorithmic-Trading
944
3361590
<reponame>kksonge/Hands-On-Machine-Learning-for-Algorithmic-Trading<gh_stars>100-1000 # On 20151231 by MLdP <<EMAIL>> import scipy.cluster.hierarchy as sch,random,numpy as np,pandas as pd,CLA from HRP import correlDist,getIVP,getQuasiDiag,getRecBipart #-------------------------------------------------------------------...
0
0
0
0
0
0
setupegg.py
utkarshdeorah/sympy
8,323
3361616
<gh_stars>1000+ import setuptools exec(open('setup.py').read())
0
0
0
0
0
0
tf_verify/analyzer.py
nathanawmk/eran
254
3361647
<reponame>nathanawmk/eran<filename>tf_verify/analyzer.py<gh_stars>100-1000 """ Copyright 2020 ETH Zurich, Secure, Reliable, and Intelligent Systems Lab 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 L...
0
0
0
0
0
0
openshift_tools/monitoring/zagg_client.py
fahlmant/openshift-tools
164
3361671
#!/usr/bin/env python2 # vim: expandtab:tabstop=4:shiftwidth=4 """ ZaggClient uses the openshift_tools.web/rest.py Example usage: from openshift_tools.monitoring.zagg_common import ZaggConnection ml = [] # UniqueMetric from openshift_tools.monitoring.metricmanager new_metric = UniqueMetric('a','b...
0
0
0
0
0
0
atest/testdata/test_libraries/ThreadLoggingLib.py
phil-davis/robotframework
7,073
3361675
<filename>atest/testdata/test_libraries/ThreadLoggingLib.py import threading import logging import time from robot.api import logger def log_using_robot_api_in_thread(): threading.Timer(0.1, log_using_robot_api).start() def log_using_robot_api(): for i in range(100): logger.info(str(i)) tim...
0
0
0
0
0
0
test/t_stps_cal.py
const7/NeuroRA
110
3361681
# -*- coding: utf-8 -*- ' a module for testing neurora.stps_cal module ' __author__ = '<NAME>' import numpy as np import unittest from neurora.stps_cal import stps, stps_fmri, stps_fmri_roi class test_stps_cal(unittest.TestCase): def test_stps(self): data = np.random.rand(5, 20, 32, 25) label_...
0
0
0
0
0
0
rasterio/control.py
nmandery/rasterio
1,479
3361684
from __future__ import annotations """Ground control points""" import uuid class GroundControlPoint: """A mapping of row, col image coordinates to x, y, z.""" def __init__(self, row: object | None=None, col: object | None=None, x: object | None=None, y: object | None=None, z: object | None=None, ...
7
3
0
0
10
0
pmdarima/arima/tests/test_validation.py
tuomijal/pmdarima
736
3361699
# -*- coding: utf-8 -*- import numpy as np import pytest from pmdarima.compat.pytest import pytest_warning_messages, pytest_error_str from pmdarima.arima import _validation as val from pmdarima.warnings import ModelFitWarning @pytest.mark.parametrize( 'ic,ooss,expect_error,expect_warning,expected_val', [ ...
0
0
0
0
0
0
nipy/algorithms/segmentation/segmentation.py
bpinsard/nipy
236
3361702
from __future__ import absolute_import # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import numpy as np from ._segmentation import _ve_step, _interaction_energy NITERS = 10 NGB_SIZE = 26 BETA = 0.1 nonzero = lambda x: np.maximum(x, 1e-50) log = lambd...
0
0
0
0
0
1
torchx/util/types.py
pytorch/torchx
101
3361712
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import inspect from typing import Any, Callable, Dict, List, Type, Union import typing_inspect def to_dict(a...
19
11
6
0
36
0
brian2/codegen/runtime/GSLcython_rt/__init__.py
awillats/brian2
674
3361724
<gh_stars>100-1000 from .GSLcython_rt import *
0
0
0
0
0
0
docs_src/queries/docs003.py
naterenegar/ormar
905
3361726
<gh_stars>100-1000 import databases import ormar import sqlalchemy database = databases.Database("sqlite:///db.sqlite") metadata = sqlalchemy.MetaData() class Book(ormar.Model): class Meta: tablename = "books" metadata = metadata database = database id: int = ormar.Integer(primary_ke...
0
0
0
0
0
0
locations/spiders/walgreens.py
davidchiles/alltheplaces
297
3361734
<filename>locations/spiders/walgreens.py # -*- coding: utf-8 -*- import json import re import scrapy from scrapy.selector import Selector from locations.items import GeojsonPointItem from locations.hours import OpeningHours class WalgreensSpider(scrapy.Spider): name = "walgreens" allowed_domains = ["www.wal...
0
0
0
0
0
0
src/offazure/azext_offazure/generated/commands.py
Mannan2812/azure-cli-extensions
207
3361748
# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incor...
0
0
0
0
0
0
docs/manual/gears/examples/qinterlace_queue.py
bogdanvuk/pygears
120
3361762
<filename>docs/manual/gears/examples/qinterlace_queue.py from pygears.lib import qinterlace, check, drv from pygears.typing import Uint, Queue di1 = drv(t=Queue[Uint[4], 1], seq=[[1, 2], [3, 4]]) di2 = drv(t=Queue[Uint[4], 1], seq=[[5, 6], [7, 8]]) qinterlace(di1, di2) \ | check(ref=[[[1, 2], [5, 6]], [[3, 4], [7...
0
0
0
0
0
0
tests/unit/driver/core/cisco_iosxr/test_cisco_iosxr_base_driver.py
verbosemode/scrapli
404
3361805
<filename>tests/unit/driver/core/cisco_iosxr/test_cisco_iosxr_base_driver.py import re import pytest from scrapli.driver.core.cisco_iosxr.base_driver import PRIVS @pytest.mark.parametrize( "priv_pattern", [ ("privilege_exec", r"RP/0/RP0/CPU0:ios#"), ("configuration", r"RP/0/RP0/CPU0:ios(conf...
0
0
0
0
0
0
python/flare/struct_typer.py
clayne/flare-ida
1,471
3361809
#!/usr/bin/env python # <NAME> # <EMAIL> # ######################################################################## # Copyright 2013 Mandiant # Copyright 2014,2018 FireEye # # Mandiant licenses this file to you under the Apache License, Version # 2.0 (the "License"); you may not use this file except in compliance with...
1
9
0
0
10
0
mmdet3d/datasets/__init__.py
chetanmreddy/imvoxelnet
136
3361839
from mmdet.datasets.builder import build_dataloader from .builder import DATASETS, build_dataset from .custom_3d import Custom3DDataset from .dataset_wrappers import MultiViewMixin from .kitti_dataset import KittiDataset from .kitti_monocular_dataset import KittiMultiViewDataset, KittiStereoDataset from .lyft_dataset i...
0
0
0
0
0
0
auctioning_platform/web_app/web_app/tests/test_auctions.py
nhdinh/smp-modulith
299
3361864
import factory from flask.testing import FlaskClient import injector import pytest from foundation.value_objects.factories import get_dollars from auctions import BeginningAuction, BeginningAuctionInputDto from main.modules import RequestScope class BeginningAuctionInputDtoFactory(factory.Factory): class Meta: ...
7
5
0
0
12
0
scripts/hackthebox/htb-machines.py
p4yl0ad3livery/OSCP
209
3361865
import requests import json import sys from pwn import * if len(sys.argv[1:]) != 1: print("Usage: {} <htb-api key>".format(sys.argv[0])) sys.exit() url = "https://www.hackthebox.eu/api/machines/get/all?api_token=" api_key = sys.argv[1] url += api_key print(url) headers = {"User-agent": "Mozilla 5.0"} re = requests...
0
0
0
0
0
0
public/bower_components/jvectormap/converter/simplifier.py
Lezappen/Laravel4.2CRUD
445
3361869
import argparse import sys import os from osgeo import ogr from osgeo import osr import anyjson import shapely.geometry import shapely.ops import codecs import time format = '%.8f %.8f' tolerance = 0.01 infile = '/Users/kirilllebedev/Maps/50m-admin-0-countries/ne_50m_admin_0_countries.shp' outfile = 'map.shp' # Open...
0
0
0
0
0
0
lib/galaxy/jobs/runners/util/cli/shell/rsh.py
rikeshi/galaxy
1,085
3361881
import logging import time import paramiko from pulsar.managers.util.retry import RetryActionExecutor from galaxy.util import ( smart_str, string_as_bool, unicodify, ) from galaxy.util.bunch import Bunch from .local import LocalShell log = logging.getLogger(__name__) logging.getLogger("paramiko").setLeve...
0
0
0
0
0
0
day13/Python/fibonacci_aadit.py
Grace0Hud/dailycodebase
249
3361898
<filename>day13/Python/fibonacci_aadit.py<gh_stars>100-1000 """ @author: aaditkamat @date: 07/01/2019 """ def fibonacci_recursive_value(num, array, ctr): if num < 1: return f'Incorrect num #{num} for fibonacci sequence' if num == 1 or num == 2: array[num - 1] = 1 return array[num - 1] if array[num - ...
0
0
0
0
0
0
Windows/etc/email/send_email.py
Dave360-crypto/Oblivion
339
3361905
from __future__ import annotations import mimetypes import smtplib import pathlib import time import coloredlogs import verboselogs from email.message import EmailMessage from email.utils import make_msgid from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from etc.email.valor import *...
3
0
0
0
3
0
tests/integration/catalogue/test_product.py
QueoLda/django-oscar
4,639
3361924
# coding=utf-8 from django.core.exceptions import ValidationError from django.db import IntegrityError from django.test import TestCase from oscar.apps.catalogue.models import ( AttributeOption, Product, ProductAttribute, ProductClass, ProductRecommendation) from oscar.test import factories class ProductTest...
0
0
0
0
0
0
tests/test_basic_api.py
NotSoSmartDev/Tino
143
3361937
<reponame>NotSoSmartDev/Tino from tino import Tino from pydantic import BaseModel import datetime from typing import List, Dict, Optional import pytest from aioredis import ReplyError api = Tino() class MyModel(BaseModel): dt = datetime.datetime @api.command async def awesome(a: int, b: bool, c: List[str], d:...
0
0
0
0
0
0
rotkehlchen/chain/ethereum/modules/curve/__init__.py
rotkehlchenio/rotkehlchen
137
3361945
from .accountant import CurveAccountant # noqa: F401 from .decoder import CurveDecoder # noqa: F401
0
0
0
0
0
0
indy_node/test/validator_info/test_validator_info_handler.py
Rob-S/indy-node
627
3361952
import pytest from indy_common.constants import VALIDATOR_INFO from plenum.common.constants import TXN_TYPE, DATA from plenum.common.types import f from plenum.test.helper import sdk_gen_request, sdk_sign_request_objects def test_validator_info_handler(monkeypatch, sdk_wallet_trustee,...
0
0
0
0
0
0
ssd/structures/container.py
RaKboW/SSD-Resnet-Attention-FeatureFusion
1,349
3361954
class Container: """ Help class for manage boxes, labels, etc... Not inherit dict due to `default_collate` will change dict's subclass to dict. """ def __init__(self, *args, **kwargs): self._data_dict: dict[object,object] = dict(*args, **kwargs) def __setattr__(self, key, value): ...
0
7
0
1
8
0
optimum/onnxruntime/modeling_ort.py
huggingface/optimum
414
3362013
from __future__ import annotations import logging import os import shutil from pathlib import Path from typing import Any, Dict, Optional, Union import torch from transformers import ( AutoConfig, AutoModel, AutoModelForCausalLM, AutoModelForQuestionAnswering, AutoModelForSequenceClassification, ...
36
11
6
1
54
0
nodes/0.9.x/python/RevisionCloud.FromCurves.py
jdehotin/Clockworkfordynamo
147
3362040
<filename>nodes/0.9.x/python/RevisionCloud.FromCurves.py<gh_stars>100-1000 import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * from System.Collections.Generic import * clr.AddReference("RevitNodes") import Revit clr.ImportExtensions(Revit.GeometryConversion) clr.AddReference("RevitServices") impor...
0
0
0
0
0
0
src/textual/_context.py
dpoehls/textual
6,706
3362041
<reponame>dpoehls/textual from typing import TYPE_CHECKING from contextvars import ContextVar if TYPE_CHECKING: from .app import App active_app: ContextVar["App"] = ContextVar("active_app")
0
0
0
0
0
0
reference/NumpyDL-master/applications/chatbot/main.py
code4bw/deep-np
186
3362064
# -*- coding: utf-8 -*- from flask import Flask from flask import jsonify from flask import render_template from flask import request from applications.chatbot.model import Seq2Seq app = Flask(__name__) model = Seq2Seq() @app.route("/") def hello() -> object: return render_template('chat.html') @app.route("/...
0
2
0
0
2
0
tools/ctexplain/bazel_api.py
jobechoi/bazel
16,989
3362081
# Lint as: python3 # Copyright 2020 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
0
0
0
0
0
1
meerk40t/gui/panes/spoolerpanel.py
apbarratt/meerk40t
118
3362085
<gh_stars>100-1000 import wx from wx import aui from meerk40t.gui.icons import icons8_route_50 from meerk40t.gui.mwindow import MWindow _ = wx.GetTranslation def register_panel(window, context): panel = SpoolerPanel(window, wx.ID_ANY, context=context) pane = ( aui.AuiPaneInfo() .Bottom() ...
0
0
0
0
0
0
py2c/common/configuration.py
timgates42/Py2C
149
3362086
from __future__ import annotations """Configuration handler for the program """ from py2c.utils import is_valid_dotted_identifier __all__ = [ "OptionError", "InvalidOptionError", "NoSuchOptionError", "Configuration" ] # ----------------------------------------------------------------------------- # Exceptio...
1
1
0
3
5
0
qiskit_nature/problems/second_quantization/lattice/lattices/triangular_lattice.py
jschuhmac/qiskit-nature
132
3362106
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
8
6
0
2
16
0
tests/slack_sdk_async/web/test_web_client_http_retry.py
priya1puresoftware/python-slack-sdk
2,486
3362163
import unittest from slack_sdk.web.async_client import AsyncWebClient from tests.slack_sdk_async.helpers import async_test from tests.slack_sdk.web.mock_web_api_server import ( setup_mock_web_api_server, cleanup_mock_web_api_server, ) from ..my_retry_handler import MyRetryHandler class TestAsyncWebClient_Htt...
0
0
0
0
0
0
tests/_site/apps/catalogue/migrations/0005_auto_20150604_1450.py
QueoLda/django-oscar
4,639
3362165
<filename>tests/_site/apps/catalogue/migrations/0005_auto_20150604_1450.py # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('catalogue', '0004_auto_20150217_1...
0
0
0
0
0
0
example/market/req_candlestick.py
bailzx5522/huobi_Python
611
3362174
<reponame>bailzx5522/huobi_Python from huobi.client.market import MarketClient from huobi.constant import * from huobi.exception.huobi_api_exception import HuobiApiException def callback(candlestick_req: 'CandlestickReq'): candlestick_req.print_object() def error(e: 'HuobiApiException'): print(e.error_code + ...
0
0
0
0
0
0
models/networks/vgg.py
fyviezhao/dressing-in-order
172
3362252
import torch import torch.nn as nn from torchvision.models import vgg19, vgg16,resnet50 from collections import OrderedDict # VGG 19 vgg_layer = { 'conv_1_1': 0, 'conv_1_2': 2, 'pool_1': 4, 'conv_2_1': 5, 'conv_2_2': 7, 'pool_2': 9, 'conv_3_1': 10, 'conv_3_2': 12, 'conv_3_3': 14, 'conv_3_4': 16, 'pool_3': 18, 'co...
2
3
0
1
6
0
torch/nn/quantized/dynamic/modules/__init__.py
Hacky-DH/pytorch
60,067
3362254
from .linear import Linear from .rnn import LSTM, GRU, LSTMCell, RNNCell, GRUCell __all__ = [ 'Linear', 'LSTM', 'GRU', 'LSTMCell', 'RNNCell', 'GRUCell', ]
0
0
0
0
0
0
db/2/2/054_DLbyABr_03a-BatchTensorFlowWithMatrices.py
chrislangst/scalable-data-science
138
3362264
# Databricks notebook source # MAGIC %md # MAGIC # MAGIC # [SDS-2.2, Scalable Data Science](https://lamastex.github.io/scalable-data-science/sds/2/2/) # MAGIC # MAGIC This is used in a non-profit educational setting with kind permission of [<NAME>](https://www.linkedin.com/in/adbreind). # MAGIC This is not licensed b...
0
0
0
0
0
0
src/std/rfc3264.py
ojimary/titus
108
3362268
<reponame>ojimary/titus # Copyright (c) 2007, <NAME>. All rights reserved. See LICENSING for details. # @implements RFC3264 (offer-answer) # implements only for unicast ''' The SDP offer/answer model for unicast sessions. Suppose the offerer wants to support PCMU and PCMA audio and H261 video, it can use the ...
0
0
0
0
0
0
napari/_qt/containers/qt_layer_list.py
MaksHess/napari
1,345
3362272
from __future__ import annotations from typing import TYPE_CHECKING from qtpy.QtCore import QSortFilterProxyModel, Qt from ...layers import Layer from ...utils.translations import trans from ._base_item_model import SortRole, _BaseEventedItemModel from ._layer_delegate import LayerDelegate from .qt_list_view import ...
4
3
0
0
7
0
saleor/product/migrations/0050_auto_20180131_0746.py
elwoodxblues/saleor
15,337
3362294
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-01-31 13:46 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [("product", "0049_collection")] operations: list[object] = [ migrat...
0
0
2
0
2
0
openpyscad/shapes_2d.py
NuclearManD/openpyscad
105
3362300
<filename>openpyscad/shapes_2d.py from __future__ import absolute_import from .base import _BaseObject __all__ = ['Circle', 'Square', 'Polygon', 'Text'] class _Shape2dObject(_BaseObject): def _is_2d(self): return True Shape2dObject = _Shape2dObject class Circle(_Shape2dObject): pass class Squa...
0
0
0
0
0
0
test/runner/test_events.py
gluhar2006/schemathesis
659
3362303
from schemathesis.runner import events def test_unknown_exception(): try: 1 / 0 except Exception as exc: event = events.InternalError.from_exc(exc) assert event.message == "An internal error happened during a test run" assert event.exception.strip() == "ZeroDivisionError: divis...
0
0
0
0
0
0
boot/rpi/tools/binman/image.py
yodaos-project/yodaos
1,144
3362313
# SPDX-License-Identifier: GPL-2.0+ # Copyright (c) 2016 Google, Inc # Written by <NAME> <<EMAIL>> # # Class for an image, the output of binman # from __future__ import print_function from collections import OrderedDict from operator import attrgetter import re import sys import fdt_util import bsection import tools...
1
1
0
1
3
0
dataset/get_20_newsgroups.py
Leo-xxx/NeuronBlocks
1,257
3362317
<reponame>Leo-xxx/NeuronBlocks # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT license. import os import shutil from os import listdir import tarfile import argparse from sys import version_info from sklearn.model_selection import train_test_split if version_info.major == 2: imp...
0
0
0
0
0
0
vespene/workers/isolation.py
Conan-Kudo/vespene
680
3362326
# Copyright 2018, <NAME> LLC # License: Apache License Version 2.0 # ------------------------------------------------------------------------- # isolation.py - when each build runs, it can be wrapped # in an isolation procedure to prevent the build from doing "too many # dangeorus things". This logic is maintain...
0
3
0
0
3
0
sdk/python/pulumi_gcp/compute/ha_vpn_gateway.py
sisisin/pulumi-gcp
121
3362414
<filename>sdk/python/pulumi_gcp/compute/ha_vpn_gateway.py<gh_stars>100-1000 # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from ty...
0
0
0
0
0
0
recipes/Python/576910_Thread_pool_grows_on_demand/recipe-576910.py
tdiprima/code
2,023
3362421
#! /usr/bin/python import threading import Queue import time import sys Instance = None def getInstance(): global Instance if not Instance: Instance = ThreadPool() return Instance class ThreadPool: def __init__(self,maxWorkers = 10): self.tasks = Queue.Queue() self.workers ...
0
0
0
0
0
0
tests/python/ganglion_resist.py
Cognixion-inc/brainflow
197
3362439
<filename>tests/python/ganglion_resist.py import argparse import time import numpy as np import brainflow from brainflow.board_shim import BoardShim, BrainFlowInputParams, BoardIds from brainflow.data_filter import DataFilter, FilterTypes, AggOperations def main (): parser = argparse.ArgumentParser () parser...
0
0
0
0
0
0
python/ray/workflow/tests/utils.py
linyiyue/ray
21,382
3362479
import pathlib import tempfile import os import ray from ray import workflow from ray.workflow.storage import set_global_storage _GLOBAL_MARK_FILE = pathlib.Path(tempfile.gettempdir()) / "__workflow_test" def unset_global_mark(): if _GLOBAL_MARK_FILE.exists(): _GLOBAL_MARK_FILE.unlink() def set_global_...
0
1
0
0
1
0
chapter06/6-4.py
alberthao/Python-Crash-Course-Homework
138
3362481
<gh_stars>100-1000 glossary = { 'string': 'A series of characters.', 'comment': 'A note in a program that the Python interpreter ignores.', 'list': 'A collection of items in a particular order.', 'loop': 'Work through a collection of items, one at a time.', 'dictionary': "A collection of key-value p...
0
0
0
0
0
0
test/posix/integration/stat/test.py
jaeh/IncludeOS
3,673
3362482
<filename>test/posix/integration/stat/test.py<gh_stars>1000+ #!/usr/bin/env python3 from __future__ import print_function from builtins import str import sys import os from subprocess import call from vmrunner import vmrunner vm = vmrunner.vms[0] num_outputs = 0 def increment(line): global num_outputs num_outp...
0
0
0
0
0
0
python2_source/BlackBoxAuditing/disparate_impact_evaluator.py
alatenko/BlackBoxAuditing
125
3362501
<filename>python2_source/BlackBoxAuditing/disparate_impact_evaluator.py<gh_stars>100-1000 # NOTE: These settings and imports should be the only things that change # across experiments on different datasets and ML model types. from disparate_impact import disparate_impact from consistency_graph import * from os...
0
0
0
0
0
0
proximal/examples/test_noise_est.py
kyleaj/ProxImaL
101
3362532
<reponame>kyleaj/ProxImaL # Proximal import sys sys.path.append('../../') from proximal.utils.utils import * from proximal.utils.metrics import * from proximal.lin_ops import * from proximal.prox_fns import * import cvxpy as cvx import numpy as np from scipy import ndimage import matplotlib.pyplot as plt from PIL im...
0
0
0
0
0
0
nlu/components/chunkers/contextual_parser/contextual_parser.py
milyiyo/nlu
480
3362538
<reponame>milyiyo/nlu from sparknlp_jsl.annotator import ContextualParserModel,ContextualParserApproach class ContextualParser: @staticmethod def get_default_model(): return ContextualParserModel() \ .setInputCols(["document","token"]) \ .setOutputCol("parsed_context") @sta...
0
0
0
0
0
0
barbican/tests/plugin/test_simple_certificate_manager.py
mail2nsrajesh/barbican
177
3362548
# 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, software # distributed under the...
0
0
0
0
0
0
mapproxy/test/unit/test_timeutils.py
cunha17/mapproxy
347
3362560
<reponame>cunha17/mapproxy # This file is part of the MapProxy project. # Copyright (C) 2010 Omniscale <http://omniscale.de> # # 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....
0
0
0
0
0
0
test/test_args.py
demiurgestudios/shovel
202
3362563
<reponame>demiurgestudios/shovel #! /usr/bin/env python '''Ensure our args utilities work''' import unittest from shovel.args import Args class TestArgs(unittest.TestCase): '''Test our argspec wrapper''' def test_basic(self): '''Give it a low-ball function''' def foo(a, b, c): pa...
0
0
0
0
0
0
programmer/check_doctests.py
LoialOtter/BadgeFPGA
265
3362571
<gh_stars>100-1000 #!/usr/bin/env python import doctest import tinyprog doctest.testmod(tinyprog)
0
0
0
0
0
0
diffy/core.py
TheGableMethod/diffy
577
3362627
<filename>diffy/core.py<gh_stars>100-1000 """ .. module: diffy.core :platform: Unix :copyright: (c) 2018 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor:: <NAME> <<EMAIL>> """ import logging logger = logging.getLogger(__name__) def analysis( targe...
0
0
0
0
0
0
upvote/monitoring/metrics.py
iwikmai/upvote
453
3362679
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
0
1
0
1
2
0
KG/CoKE/bin/reader/coke_reader.py
pkulzb/Research
1,319
3362682
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
12
8
0
3
23
0
ppapi/generators/idl_diff.py
zealoussnow/chromium
14,668
3362727
<reponame>zealoussnow/chromium #!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import print_function import glob import os import subprocess import sys from idl_...
0
0
0
0
0
0
toggl/api/base.py
Bass-03/toggl-cli
178
3362730
<filename>toggl/api/base.py<gh_stars>100-1000 import json import logging import re import typing from abc import ABCMeta from collections import OrderedDict from inspect import Signature, Parameter from toggl import utils, exceptions from toggl.api import fields as model_fields logger = logging.getLogger('toggl.api.b...
0
0
0
0
0
0
json_schema_generator/__init__.py
ruairif/json_schema_generator
231
3362748
<gh_stars>100-1000 from .generator import * from .validator import * from .recorder import *
0
0
0
0
0
0
stonesoup/metricgenerator/metrictables.py
Red-Portal/Stone-Soup-1
157
3362760
from operator import attrgetter from typing import Collection import numpy as np import matplotlib from matplotlib import pyplot as plt from .base import MetricTableGenerator, MetricGenerator from ..base import Property class RedGreenTableGenerator(MetricTableGenerator): """Red Green Metric Table Generator clas...
0
1
1
0
2
0