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
autotest/ogr/ogr_dwg.py
WorldCosplayGirl/gdal
3,100
1634535
<reponame>WorldCosplayGirl/gdal #!/usr/bin/env pytest ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test DWG Driver. # Author: <NAME> <jgr at geomaster dot pt> # #####################################################################...
0
0
0
0
0
0
docs_src/extra_models/tutorial004.py
Aryabhata-Rootspring/fastapi
53,007
1634555
from typing import List from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: str items = [ {"name": "Foo", "description": "There comes my hero"}, {"name": "Red", "description": "It's my aeroplane"}, ] @app.get("/items/", respons...
0
1
2
0
3
0
tests/test_read_write.py
josephcc/s2orc-doc2json
132
1634600
import os import unittest import json from doc2json.s2orc import load_s2orc JSON_INPUT_DATA = os.path.join('tests', 'pdf', 'N18-3011.json') class TestS2ORC(unittest.TestCase): def test_read_write(self): """ Check loading current s2orc files :return: """ with open(JSON_IN...
0
0
0
0
0
0
py/bitbox02/bitbox02/communication/devices.py
thisconnect/bitbox02-firmware
119
1634631
# Copyright 2019 Shift Cryptosecurity AG # # 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...
6
17
3
0
26
0
neutronclient/tests/unit/flavor/test_cli20_flavor_profile.py
BobzhouCH/python-neutronclient-acc
120
1634641
# Copyright 2015 Hewlett-Packard Development Company, L.P. # All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2....
0
0
0
0
0
0
bin/gftools-lang-fallback.py
twardoch/gftools
150
1634643
<filename>bin/gftools-lang-fallback.py<gh_stars>100-1000 #!/usr/bin/env python3 """ gftools lang Generates Language/Region metadata. CLDR info is supplemented with Hyperglot (https://github.com/rosettatype/hyperglot), which pulls from other data sources and consequently has a more complete set of language metadata. ...
0
0
0
0
0
0
tests/testnet/aio/test_jsonrpc.py
silverchen0402/python-bitshares
102
1634667
# -*- coding: utf-8 -*- import asyncio import pytest import logging from bitshares.aio.asset import Asset logger = logging.getLogger("websockets") logger.setLevel(logging.DEBUG) log = logging.getLogger("grapheneapi") log.setLevel(logging.DEBUG) @pytest.mark.asyncio async def test_parallel_queries(event_loop, bitsh...
0
0
0
0
0
0
arkane/encorr/bac.py
1212Prajwol-Pdl/RMG-Py
250
1634672
<filename>arkane/encorr/bac.py<gh_stars>100-1000 #!/usr/bin/env python3 ############################################################################### # # # RMG - Reaction Mechanism Generator # # ...
0
0
0
0
0
0
netdev/vendors/juniper/juniper_junos.py
maliciousgroup/netdev
199
1634680
<filename>netdev/vendors/juniper/juniper_junos.py from netdev.logger import logger from netdev.vendors.junos_like import JunOSLikeDevice class JuniperJunOS(JunOSLikeDevice): """Class for working with Juniper JunOS""" _cli_check = ">" """Checking string for shell mode""" _cli_command = "cli...
0
0
0
0
0
0
backend/database/users.py
uwer/coco-annotator
1,584
1634688
from __future__ import annotations import datetime from mongoengine import * from flask_login import UserMixin from .annotations import AnnotationModel from .categories import CategoryModel from .datasets import DatasetModel from .images import ImageModel class UserModel(DynamicDocument, UserMixin): password =...
0
8
0
0
8
0
lib-src/lv2/suil/waflib/Tools/md5_tstamp.py
joshrose/audacity
7,892
1634692
#! /usr/bin/env python # encoding: utf-8 """ Re-calculate md5 hashes of files only when the file time have changed:: def options(opt): opt.load('md5_tstamp') The hashes can also reflect either the file contents (STRONGEST=True) or the file time and file size. The performance benefits of this module are usually i...
0
1
0
0
1
0
scripts/stl/udp_1pkt_pcap_relative_path.py
ajitkhaparde/trex-core
956
1634706
from trex_stl_lib.api import * import argparse # stream from pcap file. continues pps 10 in sec # path_relative_to_profile = True class STLS1(object): def get_streams (self, direction, tunables, **kwargs) -> list[object]: parser = argparse.ArgumentParser(description='Argparser for {}'.format(os.path.bas...
0
2
0
0
2
0
shader_noise.py
christian-rauch/noise
329
1634712
"""shader_noise shader function and texture generator as described in "GPU Gems" chapter 5: http://http.developer.nvidia.com/GPUGems/gpugems_ch05.html """ __version__ = "$Id: shader_noise.py 37 2008-06-27 22:25:39Z casey.duncan $" from noise import pnoise3 import ctypes from pyglet.gl import * class ShaderNoiseText...
2
0
0
0
2
0
lenstronomy/Plots/plot_quasar_images.py
DarthLazar/lenstronomy
107
1634760
<filename>lenstronomy/Plots/plot_quasar_images.py<gh_stars>100-1000 from lenstronomy.Util.magnification_finite_util import setup_mag_finite import numpy as np from lenstronomy.LensModel.lens_model_extensions import LensModelExtensions def plot_quasar_images(lens_model, x_image, y_image, source_x, source_y, kwargs_lens...
0
0
0
0
0
0
models/TransBTS/IntmdSequential.py
yuyuan871111/TransBTS
163
1634763
from __future__ import annotations import torch.nn as nn class IntermediateSequential(nn.Sequential): def __init__(self, *args, return_intermediate: bool=True): super().__init__(*args) self.return_intermediate = return_intermediate def forward(self, input) -> object | tuple[object, object]: ...
1
1
0
0
2
0
mediaMicroservices/gen-py/media_service/ttypes.py
rodrigo-bruno/DeathStarBench
364
1634784
# # Autogenerated by Thrift Compiler (0.12.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException from thrift.TRecursive impo...
0
0
0
0
0
0
app/backend/src/couchers/helpers/clusters.py
foormea/couchers
226
1634785
from typing import List from geoalchemy2.shape import from_shape from couchers.models import Cluster, ClusterRole, ClusterSubscription, Node, Page, PageType, PageVersion, Thread DEFAULT_PAGE_CONTENT = "There is nothing here yet..." DEFAULT_PAGE_TITLE_TEMPLATE = "Main page for the {name} {type}" def create_node(ses...
6
2
0
0
8
0
models/beam_modes/ex_modal.py
ACea15/pyNastran
293
1634876
from pyNastran.bdf.bdf import read_bdf from pyNastran.op2.op2 import read_op2 bdf_filename = 'beam_modes.dat' op2_filename = 'beam_modes_m2.op2' #2) Open an op2 op2_model = read_op2(op2_filename) print(op2_model.get_op2_stats()) subcase = 1 # 3a) Load grid point locations model = read_bdf(bdf_filename) # I'm assumi...
0
0
0
0
0
0
densmap/trial_densmap.py
hhcho/densvis
102
1634889
<gh_stars>100-1000 import numpy as np import densmap from densmap.load_trial import load_trial try: import matplotlib.pyplot as plt import matplotlib.cm as cm mpl = True except: mpl = False data = load_trial() print(data.shape) # densMAP run print('Running densMAP') emb, ro, re = densmap.densMAP(verb...
0
0
0
0
0
0
benchmarks/benchmarks/multigpu/bench_multigpu_rgcn.py
ketyi/dgl
9,516
1634926
from __future__ import annotations """ Modeling Relational Data with Graph Convolutional Networks Paper: https://arxiv.org/abs/1703.06103 Code: https://github.com/tkipf/relational-gcn Difference compared to tkipf/relation-gcn * l2norm applied to all weights * remove nodes that won't be touched """ import argparse impor...
8
4
0
0
12
0
examples/py/fetch-all-okex-ohclv.py
diwenshi61/ccxt
24,910
1634934
# -*- coding: utf-8 -*- import os import sys root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(root + '/python') import ccxt # noqa: E402 from ccxt.base.exchange import Exchange # noqa: E402 # An example of OOP / class inheritance in Python class ohlcv(Exchange)...
1
1
0
0
2
0
internal/core/src/index/thirdparty/faiss/tests/test_io.py
mfkiwl/milvus
10,504
1634938
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. #!/usr/bin/env python3 import numpy as np import unittest import faiss import tempfile import os import io import sys import warnings from mu...
0
2
0
0
2
0
forms-flow-api/src/formsflow_api/resources/application.py
andrepestana-aot/forms-flow-ai
132
1634950
<reponame>andrepestana-aot/forms-flow-ai<filename>forms-flow-api/src/formsflow_api/resources/application.py """API endpoints for managing application resource.""" from http import HTTPStatus from flask import current_app, g, request from flask_restx import Namespace, Resource from formsflow_api.exceptions import Bus...
0
0
0
0
0
0
tensorboard/util/grpc_util.py
Digitaltransform/tensorboard
6,139
1634967
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
2
10
3
1
16
0
ecosystem_tools/mindconverter/mindconverter/code_analysis.py
mindspore-ai/mindinsight
216
1635007
<filename>ecosystem_tools/mindconverter/mindconverter/code_analysis.py # Copyright 2020 Huawei Technologies Co., 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/...
0
0
0
0
0
0
cooka/handler/sys_hander.py
DataCanvasIO/Cooka
222
1635019
<filename>cooka/handler/sys_hander.py # -*- encoding: utf-8 -*- from tornado import gen from cooka.common.authentication import authenticated from cooka.handler.base_handler import BaseHandler from cooka.common import consts import requests, json class ConfigHandler(BaseHandler): @gen.coroutine @authentica...
0
0
0
0
0
0
tests/access/protected/test_not_self.py
dmytrostriletskyi/design-kit
107
1635024
<gh_stars>100-1000 """ Provide tests for protected accessibility level that is used in cases of unfollowing naming convention. """ import pytest from accessify.access import protected from accessify.errors import ( INACCESSIBLE_DUE_TO_ITS_PROTECTION_LEVEL_EXCEPTION_MESSAGE, InaccessibleDueToItsProtectionLevelEx...
0
0
0
0
0
0
WebMirror/processor/MarkdownProcessor.py
awesome-archive/ReadableWebProxy
193
1635039
<filename>WebMirror/processor/MarkdownProcessor.py from . import ProcessorBase import markdown # import TextScrape.RelinkLookup # import TextScrape.RELINKABLE as RELINKABLE ######################################################################################################################## # # ## ## ...
0
0
0
0
0
0
tests/entire_book_quick_test.py
guy4261/fight-churn
151
1635052
import os import unittest import sys import tempfile sys.path.append('../fightchurn') sys.path.append('../datagen') from fightchurn import run_churn_listing from fightchurn.datagen import churndb class TestFightChurnWIthData(unittest.TestCase): def test_run_entire_book(self): database=username=password='...
0
0
0
0
0
0
tests/ImageSharp.Drawing.Tests/Shapes/Scan/IntersectionsGenerator.py
iguanaware/ImageSharp.Drawing
171
1635057
<filename>tests/ImageSharp.Drawing.Tests/Shapes/Scan/IntersectionsGenerator.py from sympy import Point, Polygon, Line from sympy.geometry.point import Point2D from sympy.geometry.line import Segment2D def HLine(y): s = Point(-1000,y) e = Point(1000,y) return Line(s,e) def Points2Str(pts): res = ""; ...
0
0
0
0
0
0
基础教程/A2-神经网络基本原理/第9步 - 循环神经网络/src/ch19-RNNBasic/MiniFramework/DropoutLayer.py
microsoft/ai-edu
11,094
1635066
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE file in the project root for full license information. from MiniFramework.EnumDef_6_0 import * from MiniFramework.Layer import * class DropoutLayer(CLayer): def __init__(self, input_size, ratio: float=0.5): self....
2
2
0
1
5
0
eventsourcing/tests/test_popo.py
johnbywater/eventsourcing
972
1635086
from eventsourcing.popo import ( Factory, POPOAggregateRecorder, POPOApplicationRecorder, POPOProcessRecorder, ) from eventsourcing.tests.base_aggregate_recorder_tests import ( AggregateRecorderTestCase, ) from eventsourcing.tests.base_application_recorder_tests import ( ApplicationRecorderTestC...
0
8
0
0
8
0
tests/unit/requests_respectful/test_respectful_requester.py
SerpentAI/requests-respectful
113
1635112
<reponame>SerpentAI/requests-respectful<filename>tests/unit/requests_respectful/test_respectful_requester.py # -*- coding: utf-8 -*- import pytest from requests_respectful import RespectfulRequester from requests_respectful import RequestsRespectfulError, RequestsRespectfulConfigError, RequestsRespectfulRateLimitedErr...
0
0
0
0
0
0
boundary_layer/logger.py
aksswami/boundary-layer
252
1635138
# -*- coding: utf-8 -*- # Copyright 2018 Etsy 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...
0
1
0
0
1
0
h2o-docs/src/booklets/v2_2015/source/DeepLearning_Vignette_code_examples/deeplearning_crossval.py
ahmedengu/h2o-3
6,098
1635157
<reponame>ahmedengu/h2o-3 # Perform 5-fold cross-validation on training_frame model_cv = H2ODeepLearningEstimator( distribution="multinomial", activation="RectifierWithDropout", hidden=[32,32,32], input_dropout_ratio=0.2, sparse=True, l1=1e-5, epochs=10, ...
0
0
0
0
0
0
tests/test_backend.py
DoubleCai/django-redis
727
1635160
<gh_stars>100-1000 import datetime import threading import time from datetime import timedelta from typing import List, Union, cast from unittest.mock import patch import pytest from django.core.cache import caches from pytest_django.fixtures import SettingsWrapper from pytest_mock import MockerFixture import django_...
0
0
0
0
0
0
src/rosdistro/release_cache.py
andre-rosa/rosdistro-1
742
1635161
# Software License Agreement (BSD License) # # Copyright (c) 2013, Open Source Robotics Foundation, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code mus...
2
3
1
1
7
0
inference-engine/tests/ie_test_utils/functional_test_utils/layer_tests_summary/merge_xmls.py
monroid/openvino
2,406
1635238
# Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import argparse import os import glob import xml.etree.ElementTree as ET from utils import utils logger = utils.get_logger('XmlMerger') def parse_arguments() -> object: parser = argparse.ArgumentParser() input_folders_help =...
5
2
0
0
7
0
utc-time/utc-time.py
TedsTechShack/google-authenticator-libpam
1,390
1635259
#!/usr/bin/env python # Copyright 2011 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
0
0
0
0
0
0
ask-sdk/tests/unit/test_standard.py
P2707951/alexa-skills-kit-sdk-for-python
496
1635358
# -*- coding: utf-8 -*- # # Copyright 2018 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 i...
0
0
0
0
0
0
Gfg/Python/RotateArray.py
abdzitter/Daily-Coding-DS-ALGO-Practice
289
1635364
<gh_stars>100-1000 def leftRotate(arr, d, n): for i in range(d): leftRotatebyOne(arr, n) #Function to left Rotate arr[] of size n by 1*/ def leftRotatebyOne(arr, n): temp = arr[0] for i in range(n-1): arr[i] = arr[i+1] arr[n-1] = temp # utility function to print an...
0
0
0
0
0
0
openconfig/ydk/models/openconfig/openconfig_rib_bgp_types.py
CiscoDevNet/ydk-py
177
1635385
<filename>openconfig/ydk/models/openconfig/openconfig_rib_bgp_types.py """ openconfig_rib_bgp_types Defines identity and type defintions associated with the OpenConfig BGP RIB modules """ import sys from collections import OrderedDict from ydk.types import Entity as _Entity_ from ydk.types import EntityPath, Identi...
0
0
0
0
0
0
openl3/models.py
lclichen/openl3
279
1635447
from __future__ import annotations import os import warnings import sklearn.decomposition import numpy as np from .openl3_exceptions import OpenL3Error with warnings.catch_warnings(): # Suppress TF and Keras warnings when importing warnings.simplefilter("ignore") import tensorflow as tf import tensorfl...
12
15
0
0
27
0
src/sims4communitylib/utils/sims/common_sim_body_utils.py
velocist/TS4CheatsInfo
118
1635458
<gh_stars>100-1000 """ The Sims 4 Community Library is licensed under the Creative Commons Attribution 4.0 International public license (CC BY 4.0). https://creativecommons.org/licenses/by/4.0/ https://creativecommons.org/licenses/by/4.0/legalcode Copyright (c) COLONOLNUTTY """ from typing import Tuple from sims.sim_...
0
0
0
0
0
0
tests/test_windows_renderer.py
MarkHoo/rich
4,407
1635479
import sys from unittest.mock import call, create_autospec import pytest try: from rich._win32_console import LegacyWindowsTerm, WindowsCoordinates from rich._windows_renderer import legacy_windows_render except: # These modules can only be imported on Windows pass from rich.segment import ControlType...
0
1
0
0
1
0
tools/Raw2LUTImages/conversion_lib/basic_utils.py
ladt/SeeingThroughFog
143
1635486
<gh_stars>100-1000 import cv2 import os import numpy as np import json def read_meta_file(path): with open(path, 'r') as f: data = json.load(f) return data def parse_day_night(data, DEBUG=False): if DEBUG: print(data['daytime']) if data is None: return True day = data['day...
0
0
0
0
0
0
tests/errors/semantic/blocking/ex2.py
dina-fouad/pyccel
206
1635494
# pylint: disable=missing-function-docstring, missing-module-docstring/ e2 = y[2] + 3 y[0] = 1
0
0
0
0
0
0
torch2trt_dynamic/converters/flatten.py
jinfagang/torch2trt_dynamic
155
1635508
<gh_stars>100-1000 import tensorrt as trt import torch from ..torch2trt_dynamic import get_arg, tensorrt_converter, trt_ from .identity import convert_identity @tensorrt_converter('torch.Tensor.flatten') @tensorrt_converter('torch.flatten') def convert_flatten(ctx): input = ctx.method_args[0] start_dim = ge...
0
0
0
0
0
0
archai/algos/nasbench101/model_metrics_pb2.py
microsoft/archai
344
1635514
<gh_stars>100-1000 # Copyright 2019 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
0
0
0
0
0
0
scale/job/test/seed/test_metadata.py
kaydoh/scale
121
1635539
<reponame>kaydoh/scale from __future__ import unicode_literals import django from django.test import TestCase from job.seed.exceptions import InvalidSeedMetadataDefinition from job.seed.metadata import SeedMetadata class TestSeedMetadata(TestCase): """Tests functions in the manifest module.""" def setUp(sel...
0
0
0
0
0
0
budgetml/gcp/storage.py
strickvl/budgetml
1,316
1635542
<reponame>strickvl/budgetml import logging from google.cloud import storage from google.cloud.exceptions import Conflict def upload_blob(bucket_name, source_file_name, destination_blob_name): """Uploads a file to the bucket.""" storage_client = storage.Client() bucket = storage_client.bucket(bucket_name)...
0
0
0
0
0
0
src/simian/mac/munki/handlers/uauth.py
tristansgray/simian
326
1635545
#!/usr/bin/env python # # Copyright 2010 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
0
2
0
0
2
0
junior_class/chapter-3-Computer_Vision/code/nets/AlexNet.py
wwhio/awesome-DeepLearning
1,150
1635560
<filename>junior_class/chapter-3-Computer_Vision/code/nets/AlexNet.py # Copyright (c) 2021 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 # # h...
0
0
0
0
0
0
src/dispatch/tag/scheduled.py
roor0/dispatch
3,417
1635564
<gh_stars>1000+ """ .. module: dispatch.tag.scheduled :platform: Unix :copyright: (c) 2019 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. """ import logging from schedule import every from dispatch.database.core import SessionLocal from dispatch.decorators import sche...
0
0
0
0
0
0
DQM/SiStripMonitorClient/test/SiStripCAFHarvest_template_cfg.py
ckamtsikis/cmssw
852
1635580
<reponame>ckamtsikis/cmssw<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms process = cms.Process( "SiStripDQMConvertOfflineGlobalRun" ) ### Miscellanous ### process.options = cms.untracked.PSet( fileMode = cms.untracked.string( 'FULLMERGE' ), wantSummary = cms.untracked.bool( True ) ) # Logging ...
0
0
0
0
0
0
cli/tests/pcluster/validators/test_cluster_validators.py
rdimaio/aws-parallelcluster
415
1635593
<filename>cli/tests/pcluster/validators/test_cluster_validators.py # Copyright 2021 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...
0
0
0
0
0
0
chapter2/chapter2_list_comprehensions_04.py
GoodMonsters/Building-Data-Science-Applications-with-FastAPI
107
1635640
from random import randint, seed seed(10) # Set random seed to make examples reproducible random_dictionary = {i: randint(1, 10) for i in range(5)} print(random_dictionary) # {0: 10, 1: 1, 2: 7, 3: 8, 4: 10}
0
0
0
0
0
0
usdtransaction/AL/usd/__init__.py
garvitverma/AL_USDMaya
507
1635698
try: __import__('pkg_resources').declare_namespace(__name__) except: pass
0
0
0
0
0
0
acme/wrappers/open_spiel_wrapper_test.py
novatig/acme
2,650
1635706
# python3 # Copyright 2018 DeepMind Technologies Limited. 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 re...
0
0
1
0
1
0
exp/sympy/bezier_model.py
NMinhNguyen/wordsandbuttons
367
1635709
<reponame>NMinhNguyen/wordsandbuttons<gh_stars>100-1000 from sympy import * ax, bx, cx, dx, ay, by, cy, dy, t = symbols('ax bx cx dx ay by cy dy t') x1, y1, x2, y2, x3, y3, x4, y4 = symbols('x1 y1 x2 y2 x3 y3 x4 y4') xt = ax*t**3 + bx*t**2 + cx*t + dx yt = ay*t**3 + by*t**2 + cy*t + dy the_x_system = [ xt.subs(t...
0
0
0
0
0
0
WebMirror/management/rss_parser_funcs/feed_parse_extractBorahae7WordpressCom.py
fake-name/ReadableWebProxy
193
1635739
from __future__ import annotations def extractBorahae7WordpressCom(item) -> bool | object | None: ''' Parser for 'borahae7.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('Prophet'...
0
1
0
0
1
0
tests/test_download.py
farhadmpr/tehran-stocks
380
1635799
<filename>tests/test_download.py from tehran_stocks import download SAIPA = "44891482026867833" class TestNames: def test_id_from_group(self): ids = download.get_stock_ids(34) assert ids, "no id available" def test_saipa_in_that(self): ids = download.get_stock_ids(34) assert...
0
0
0
0
0
0
tests/test_validation.py
vkubyshko/cloud-custodian
2,415
1635821
# Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 import argparse import yaml from .common import BaseTest from c7n.commands import validate as validate_yaml_policies class CommandsValidateTest(BaseTest): def test_duplicate_key(self): # try dupes with top level keys ...
0
0
0
0
0
0
tests/test_blocks.py
t-makaro/animatplot
402
1635845
from matplotlib.testing import setup import numpy as np import numpy.testing as npt import matplotlib.pyplot as plt import matplotlib as mpl import packaging.version import pytest import animatplot as amp from tests.tools import animation_compare from animatplot.blocks import Block, Title setup() class TestTitleB...
0
9
0
0
9
0
tests/integration/weatherapi25/test_cityidregistry_reads_fs.py
ahertz/pyowm
799
1635851
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from os import sep from pyowm.commons.cityidregistry import CityIDRegistry from pyowm.weatherapi25.location import Location class TestCityIDRegistryReadsFS(unittest.TestCase): _prefix = 'cityids'+sep _instance = CityIDRegistry(_prefix+'%03d-%03d....
0
0
0
0
0
0
Configuration/ProcessModifiers/python/allSonicTriton_cff.py
ckamtsikis/cmssw
852
1635876
import FWCore.ParameterSet.Config as cms from Configuration.ProcessModifiers.enableSonicTriton_cff import enableSonicTriton # collect all SonicTriton-related process modifiers here allSonicTriton = cms.ModifierChain(enableSonicTriton)
0
0
0
0
0
0
release/stubs.min/System/ComponentModel/__init___parts/EditorAttribute.py
htlcnn/ironpython-stubs
182
1635893
class EditorAttribute(Attribute,_Attribute): """ Specifies the editor to use to change a property. This class cannot be inherited. EditorAttribute() EditorAttribute(typeName: str,baseTypeName: str) EditorAttribute(typeName: str,baseType: Type) EditorAttribute(type: Type,baseType: Type) """ ...
0
0
0
0
0
0
Chapter7/listing7_7.py
hohsieh/osgeopy-code
160
1635895
# Use GPS locations and elapsed time to get maximum speeds. from datetime import datetime from osgeo import ogr import ch7funcs date_format = '%Y-%m-%d %H:%M:%S.%f' ds = ogr.Open(r'D:\osgeopy-data\Galapagos') lyr = ds.GetLayerByName('albatross_lambert') # Loop through each tag, initialize max_speed to 0, and limit t...
0
0
0
0
0
0
visualization.py
titu1994/BatchRenormalization
109
1635901
<filename>visualization.py import seaborn as sns sns.set_style('whitegrid') import json with open('history/batchnorm_history.txt') as f, open('history/batch_renorm_history.txt') as f2: history_bn = json.load(f) history_renorm_mode_0 = json.load(f2) sns.plt.subplot(1, 2, 1) sns.plt.plot(history_bn['loss'], l...
0
0
0
0
0
0
tests/unit/ec2/test_instancestatus.py
Yurzs/boto
5,079
1635951
<reponame>Yurzs/boto<gh_stars>1000+ #!/usr/bin/env python from tests.compat import mock, unittest from boto.ec2.connection import EC2Connection INSTANCE_STATUS_RESPONSE = br"""<?xml version="1.0" encoding="UTF-8"?> <DescribeInstanceStatusResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/"> <requestId>3be15...
0
0
0
0
0
0
core/string_utils.py
exatel/ph0neutria
277
1635959
<gh_stars>100-1000 #!/usr/bin/python3 from .config_utils import get_base_config from fuzzywuzzy import fuzz from .log_utils import get_module_logger from tldextract import extract, TLDExtract from urllib.parse import urlparse import Levenshtein import os import re import statistics import string import sys CDIR = ...
0
0
0
0
0
0
examples/pizza_plots/plot_pizza_comparison.py
ThomasSeidl/mplsoccer
157
1635970
""" ============================== Comparison Pizza (Percentiles) ============================== * Author: `slothfulwave612 <https://twitter.com/slothfulwave612>`_ * ``mplsoccer``, ``py_pizza`` module helps one to plot pizza charts in a few lines of code. * The design idea is inspired by `<NAME> <https://twitter.com...
0
0
0
0
0
0
programs/pyeos/tests/python/purchase/purchase.py
learnforpractice/pyeos
144
1635976
<reponame>learnforpractice/pyeos ''' pragma solidity ^0.4.22; contract Purchase { uint public value; address public seller; address public buyer; enum State { Created, Locked, Inactive } State public state; // Ensure that `msg.value` is an even number. // Division will truncate if it is an...
0
0
0
0
0
0
winton_kafka_streams/state/factory/value_store_factory.py
wintoncode/winton-kafka-streams
330
1636019
<reponame>wintoncode/winton-kafka-streams from typing import TypeVar, Generic from winton_kafka_streams.processor.serialization import Serde from winton_kafka_streams.processor.serialization.serdes import * from .key_value_store_factory import KeyValueStoreFactory KT = TypeVar('KT') # Key type. VT = TypeVar('VT') #...
0
0
0
0
0
0
angrmanagement/plugins/chess_manager/diagnose_handler.py
DennyDai/angr-management
474
1636020
from __future__ import annotations import asyncio import json import logging import os.path import threading from logging import Formatter from time import sleep from typing import Optional from getmac import get_mac_address as gma from sqlalchemy.exc import OperationalError from tornado.platform.asyncio import AnyTh...
3
3
1
5
12
0
src/seabreeze/pyseabreeze/features/wificonfiguration.py
TeamPiccolo/python-seabreeze
159
1636027
from seabreeze.pyseabreeze.features._base import SeaBreezeFeature # Definition # ========== # # TODO: This feature needs to be implemented for pyseabreeze # class SeaBreezeWifiConfigurationFeature(SeaBreezeFeature): identifier: str = "wifi_configuration" def get_wifi_mode(self, interface_index): rais...
0
0
1
0
1
0
tests/conftest.py
James-Archer/numpy-stl
464
1636033
<gh_stars>100-1000 import py import pytest def pytest_generate_tests(metafunc): # Run all tests both with and without speedups metafunc.fixturenames.append('speedups') metafunc.parametrize('speedups', [False, True]) @pytest.fixture(scope='session') def cwd(): return py.path.local(__file__).dirpath()...
0
0
0
0
0
0
flatdata-generator/flatdata/generator/tree/nodes/resources/__init__.py
gferon/flatdata
140
1636036
from .base import ResourceBase from .archive import Archive from .multivector import Multivector from .instance import Instance from .rawdata import RawData from .vector import Vector from .bound_resource import BoundResource
0
0
0
0
0
0
Providers/nxOMSAutomationWorker/automationworker/3.x/worker/runtime.py
chsamala2/PowerShell-DSC-for-Linux
110
1636059
<gh_stars>100-1000 #!/usr/bin/env python3 # ==================================== # Copyright (c) Microsoft Corporation. All rights reserved. # ==================================== """Runtime module. Contains runtime base class and language specific runtime classes.""" import signal import subprocess import sys import...
0
0
0
0
0
0
Chapter 5/tf_hub.py
shantam21/Deep-Learning-with-TensorFlow-2-and-Keras
267
1636090
<filename>Chapter 5/tf_hub.py<gh_stars>100-1000 import matplotlib.pylab as plt import tensorflow as tf import tensorflow_hub as hub import numpy as np import PIL.Image as Image classifier_url ="https://tfhub.dev/google/tf2-preview/mobilenet_v2/classification/2" #@param {type:"string"} IMAGE_SHAPE = (224, 224) # wra...
0
0
0
0
0
0
tests/integrations/postgresql/tests/test_datetime.py
RobertCraigie/prisma-client-py
518
1636119
import datetime import pytest from prisma import Client # TODO: add tests for every database provider we support @pytest.mark.asyncio async def test_precision_loss(client: Client) -> None: """https://github.com/RobertCraigie/prisma-client-py/issues/129""" date = datetime.datetime.utcnow() post = await...
1
1
0
0
2
0
desktop/core/ext-py/Django-1.11/tests/model_meta/test_removedindjango21.py
kokosing/hue
5,079
1636127
import warnings from django.test import SimpleTestCase from .models import Person class HasAutoFieldTests(SimpleTestCase): def test_get_warns(self): with warnings.catch_warnings(record=True) as warns: warnings.simplefilter('always') Person._meta.has_auto_field self.asser...
0
0
0
0
0
0
test_runner/performance/test_parallel_copy_to.py
libzenith/zenith
189
1636129
from io import BytesIO import asyncio import asyncpg from fixtures.zenith_fixtures import ZenithEnv, Postgres from fixtures.log_helper import log from fixtures.benchmark_fixture import MetricReport, ZenithBenchmarker pytest_plugins = ("fixtures.zenith_fixtures", "fixtures.benchmark_fixture") async def repeat_bytes(b...
14
0
0
0
14
0
opytimizer/utils/__init__.py
anukaal/opytimizer
528
1636137
"""Utility package for all common opytimizer modules. """
0
0
0
0
0
0
vul/10-docker-getshell.py
zx273983653/vulscan
582
1636142
<reponame>zx273983653/vulscan #!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright (c) 2014-2015 pocsuite developers (http://seebug.org) See the file 'docs/COPYING' for copying permission """ #命令行 from pocsuite import pocsuite_cli #验证模块 from pocsuite import pocsuite_verify #攻击模块 from pocsuite import pocsuite_at...
0
0
0
0
0
0
deep_qa/data/instances/sequence_tagging/pretokenized_tagging_instance.py
richarajpal/deep_qa
459
1636174
<reponame>richarajpal/deep_qa<filename>deep_qa/data/instances/sequence_tagging/pretokenized_tagging_instance.py from typing import List import numpy from overrides import overrides from .tagging_instance import TaggingInstance from ...data_indexer import DataIndexer class PreTokenizedTaggingInstance(TaggingInstance)...
0
0
0
0
0
0
atlas/foundations_contrib/src/integration/fixtures/user_stageless_script.py
DeepLearnI/atlas
296
1636183
import foundations print('Hello from stageless script')
0
0
0
0
0
0
CodeChef/LONG/JULY15/MAXDIFFW/gen.py
VastoLorde95/Competitive-Programming
170
1636185
print 50 cnt = 1 for i in xrange(50): for j in xrange(50): if i == j: print 0, else: print cnt, cnt += 1 print
0
0
0
0
0
0
tests/types/test_number.py
achievement008/followthemoney
137
1636188
import unittest from followthemoney.types import registry numbers = registry.number class NumberTest(unittest.TestCase): def test_cast_num(self): self.assertEqual(numbers.to_number("1,00,000"), 100000.0) self.assertEqual(numbers.to_number(" -999.0"), -999.0) self.assertEqual(numbers.to_n...
0
0
0
0
0
0
bin/LLAMA.py
fchapoton/CrisisMappingToolkit
178
1636192
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'LLAMA_UI.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s) -...
0
3
0
0
3
0
cacreader/swig-4.0.2/Examples/test-suite/python/unions_runme.py
kyletanyag/LL-Smartcard
1,031
1636193
<filename>cacreader/swig-4.0.2/Examples/test-suite/python/unions_runme.py # This is the union runtime testcase. It ensures that values within a # union embedded within a struct can be set and read correctly. import unions import sys import string # Create new instances of SmallStruct and BigStruct for later use smal...
0
0
0
0
0
0
cli/src/pcluster/api/models/describe_cluster_instances_response_content.py
enrico-usai/cfncluster
415
1636216
<reponame>enrico-usai/cfncluster<gh_stars>100-1000 # Copyright 2021 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/ap...
0
0
0
0
0
0
tests/compas/geometry/test_point.py
funkchaser/compas
235
1636219
<reponame>funkchaser/compas<filename>tests/compas/geometry/test_point.py<gh_stars>100-1000 import compas from compas.geometry import Point if not compas.IPY: def test_data(): p = Point(0, 0, '0') assert p.data == p.validate_data() o = Point.from_data(p.data) assert p == o a...
0
0
0
0
0
0
src/lib/decimal.py
DTenore/skulpt
2,671
1636280
<reponame>DTenore/skulpt import _sk_fail; _sk_fail._("decimal")
0
0
0
0
0
0
tests/components/pushbullet/__init__.py
domwillcode/home-assistant
30,023
1636285
"""Tests for the pushbullet component."""
0
0
0
0
0
0
tests/network.py
ShaneLee/piston
1,320
1636286
<filename>tests/network.py """ Description Accessing external resources could be potentially dangerous """ import urllib.request contents = urllib.request.urlopen("https://emkc.org").read()
0
0
0
0
0
0
tests/test_pagination.py
stevenj/PynamoDB
1,586
1636289
import pytest from pynamodb.pagination import RateLimiter class MockTime(): def __init__(self): self.current_time: float = 0.0 def sleep(self, amount): self.current_time += amount def time(self) -> object: return self.current_time def increment_time(self, amount): se...
0
1
0
1
2
0
psy/irt/__init__.py
Alias-Alan/pypsy
169
1636292
from psy.irt import grm
0
0
0
0
0
0
paraphase/util/rnn.py
tingkai-zhang/Paraphase
354
1636302
import tensorflow as tf def last_relevant_output(output, sequence_length) -> object: """ Given the outputs of a LSTM, get the last relevant output that is not padding. We assume that the last 2 dimensions of the input represent (sequence_length, hidden_size). Parameters ---------- output:...
0
1
0
0
1
0
tapas/datasets/dataset.py
Martin36/tapas
816
1636321
<reponame>Martin36/tapas<filename>tapas/datasets/dataset.py # coding=utf-8 # Copyright 2019 The Google AI Language Team 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:/...
0
0
0
0
0
0