max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
7
115
max_stars_count
int64
101
368k
id
stringlengths
2
8
content
stringlengths
6
1.03M
tools/binary_size/libsupersize/test_util.py
zealoussnow/chromium
14,668
11055639
<reponame>zealoussnow/chromium<filename>tools/binary_size/libsupersize/test_util.py # Copyright 2018 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. import difflib import logging import describe class Golden: """Utili...
tests/syntax/invalid_octal.py
matan-h/friendly
287
11055690
<reponame>matan-h/friendly b = 0O1876
src/main/python/counts_tools/exec/visualize_network.py
cday97/beam
123
11055693
import ConfigParser import time import geopandas as gpd import matplotlib.pyplot as plt import numpy as np import pandas as pd from utils import spatial_tools __author__ = "<NAME>" if __name__ == '__main__': if len(sys.argv) < 2: print 'ERROR: need to supply the path to the conifg file' config_path ...
.buildozer/android/platform/build-armeabi-v7a/build/other_builds/pyjnius-python3-sdl2/armeabi-v7a__ndk_target_21/pyjnius/tests/test_enum.py
VPetras/mobile-test-app
908
11055695
''' Enum in Java returns itself when trying to get a value, e.g.: SimpleEnum.GOOD is of class instance SimpleEnum. `javap -s SimpleEnum.class`:: public final class org.jnius.SimpleEnum ... { public static final org.jnius.SimpleEnum GOOD; descriptor: Lorg/jnius/SimpleEnum; <-- this ...
src/prisma/engine/utils.py
adriangb/prisma-client-py
518
11055735
<reponame>adriangb/prisma-client-py import os import sys import time import socket import logging import subprocess from pathlib import Path from typing import NoReturn, Dict, Type, Any from . import errors from .. import errors as prisma_errors from ..http import Response from ..utils import time_since from ..binari...
.circleci/cimodel/data/simple/nightly_android.py
Hacky-DH/pytorch
60,067
11055779
<filename>.circleci/cimodel/data/simple/nightly_android.py from cimodel.data.simple.util.docker_constants import ( DOCKER_IMAGE_NDK, DOCKER_REQUIREMENT_NDK ) class AndroidNightlyJob: def __init__(self, variant, template_name, extra_props=None, ...
proxy/validateData.py
KEN-LJQ/ZhihuSpider
107
11055812
import requests import re import logging import time from Core.Logger import log # 代理 IP 验证网站 url = 'http://icanhazip.com/' # 请求头信息 header = {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Accept-Encoding': 'gzip, deflate, sdch', 'Accept-Language...
observations/r/oil.py
hajime9652/observations
199
11055815
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import csv import numpy as np import os import sys from observations.util import maybe_download_and_extract def oil(path): """Oil Investment a cross-section from 1969 to 1992 ...
examples/pybullet/gym/pybullet_envs/minitaur/envs_v2/evaluation/metric_logger.py
felipeek/bullet3
9,136
11055848
# Lint as: python3 """The system to log and manage all metrics.""" import logging from typing import Any, Callable, Dict, Sequence, Text, Union import numpy as np from pybullet_envs.minitaur.envs_v2.evaluation import metric as metric_lib def _merge_dict_throw_on_duplicates( dict_1: Dict[Text, Any], dict_2: ...
docs/source/_config.py
MitchellTesla/datasets
3,395
11055849
default_branch_name = "master" version_prefix = ""
what_is_the_python_decorator/demo8.py
NightmareQAQ/python-notes
106
11055893
<reponame>NightmareQAQ/python-notes class MyDecorator: def __init__(self, func): self.__func = func def __call__(self, *args, **kwargs): print('do something before calling function {}'.format(self.__func.__name__)) self.__func(*args, **kwargs) print('do something after calling f...
algorithms/pangrams.py
gajubadge11/HackerRank-1
340
11055918
#!/usr/bin/env python3 import string alphabet = string.ascii_lowercase def is_pangram(s): return set(alphabet) < set(s.lower()) if __name__ == "__main__": if is_pangram(input().strip()): print("pangram") else: print("not pangram")
clients/python/labels.py
GowthamKudupudi/yolov4-triton-tensorrt
212
11055974
from enum import Enum class COCOLabels(Enum): PERSON = 0 BICYCLE = 1 CAR = 2 MOTORBIKE = 3 AEROPLANE = 4 BUS = 5 TRAIN = 6 TRUCK = 7 BOAT = 8 TRAFFIC_LIGHT = 9 FIRE_HYDRANT = 10 STOP_SIGN = 11 PARKING_METER = 12 BENCH = 13 BIRD = 14 CAT = 15 DOG = 16 ...
tensortrade/stochastic/utils/__init__.py
zeeshanalipanhwar/tensortrade
3,081
11055984
from .helpers import * from .parameters import *
docs/examples/simple-example/setup.py
qunaibit/hpy
262
11055999
from setuptools import setup, Extension from os import path setup( name="hpy-simple-example", hpy_ext_modules=[ Extension('simple', sources=[path.join(path.dirname(__file__), 'simple.c')]), ], setup_requires=['hpy'], )
spytest/tests/routing/NAT/test_nat.py
shubav/sonic-mgmt
132
11056000
<gh_stars>100-1000 # ################ Author Details ################ # Name: <NAME> ; <NAME> # Email: <EMAIL> ; <EMAIL> # ################################################ # # 1. test_ft_static_nat - Verify static NAT establishes a one-to-one mapping between the inside local address and an # inside global address. # 2....
core/Arch.py
SpudGunMan/spraykatz
726
11056016
# coding: utf-8 # Author: @aas_s3curity # Imports import logging from impacket.dcerpc.v5.transport import DCERPCTransportFactory from impacket.dcerpc.v5.rpcrt import DCERPCException from impacket.dcerpc.v5.epm import MSRPC_UUID_PORTMAP from core.Colors import warningRed def get_os_arch(target): try: ...
ci/fih_test_docker/damage_image.py
Innoseis/mcuboot
299
11056031
# Copyright (c) 2020 Arm Limited # # 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 writi...
backUp/jd_bs.py
lllrrr2/jd-3
3,125
11056043
#/* # 小米运动更新步数 #[task_local] # 小米运动更新步数 #0 15 15 * * #*/ import requests import random number2 = random.randint(50001,65000) dict = { # '小米运行账号':'密码' '':'' } header={ 'User_Agent':'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3...
fexm/test/test_builder.py
fgsect/fexm
105
11056056
<filename>fexm/test/test_builder.py<gh_stars>100-1000 from unittest import TestCase import os parentdir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) os.sys.path.insert(0, parentdir) import builders.builder class TestBuilder(TestCase): def test_install_opt_depens_for_pacman(self): b = bu...
examples/custom_code/model_create.py
zyfra/ebonite
270
11056061
<reponame>zyfra/ebonite """This model creates ebonite model from fucntion run imported from other module""" import pandas as pd from examples.custom_code._custom_code import run_my_model from ebonite import Ebonite def main(): # create local ebonite client. This client stores metadata and artifacts on local fs...
app-testing/src/pages/app_page.py
anuwrag/opentrons
235
11056118
<filename>app-testing/src/pages/app_page.py """Model for the App page that displays info and settings for the app.""" from selenium.webdriver.chrome.webdriver import WebDriver from selenium.webdriver.common.by import By from selenium.webdriver.remote.webelement import WebElement from selenium.webdriver.support.wait imp...
lib/context.py
kei-iketani/plex
153
11056122
<reponame>kei-iketani/plex #********************************************************************* # content = context # executes other scripts on PUBLISH (on task in file name) # version = 0.1.0 # date = 2019-12-01 # # license = MIT <https://github.com/alexanderrichtertd> # author = <NAME> <<E...
rpython/jit/backend/x86/profagent.py
nanjekyejoannah/pypy
381
11056153
class ProfileAgent(object): """ A class that communicates to a profiler which assembler code belongs to which functions. """ def startup(self): pass def shutdown(self): pass def native_code_written(self, name, address, size): pass
ven2/lib/python2.7/site-packages/zope/proxy/_compat.py
manliu1225/Facebook_crawler
4,410
11056174
import sys PY3 = sys.version_info[0] >= 3
cloudbaseinit/plugins/common/userdataplugins/cloudconfigplugins/users.py
andia10240/cloudbase-init
160
11056190
<filename>cloudbaseinit/plugins/common/userdataplugins/cloudconfigplugins/users.py # Copyright 2019 Cloudbase Solutions Srl # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # ...
rssant_api/migrations/0020_feed_checksum_data.py
zuzhi/rssant
1,176
11056195
<reponame>zuzhi/rssant<gh_stars>1000+ # Generated by Django 2.2.12 on 2020-04-16 11:17 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('rssant_api', '0019_feed_use_proxy'), ] operations = [ migrations.AddField( model_name='fe...
tests/httputil_test.py
wecatch/app-turbo
157
11056222
# -*- coding:utf-8 -*- from __future__ import absolute_import, division, print_function, with_statement import turbo.httputil as hu from util import unittest class HttpUtilTest(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_encode_http_params(self): ...
download-logicprox-content.py
jmyork/adminscripts
221
11056248
<gh_stars>100-1000 #!/usr/bin/env python # encoding: utf-8 # ================================================================================ # download-logicprox-content.py # # This script downloads the content packages for Logic Pro X. It also arranges # them in subdirectories the same way as displayed in the Logic ...
fooltrader/datamanager/cryptocurrency_manager.py
beaquant/fooltrader
1,103
11056258
# -*- coding: utf-8 -*- import argparse from fooltrader.connector.kafka_connector import cryptocurrency_tick_to_kafka if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('exchange', help='the exchange to crawl') parser.add_argument('--pairs', help='the pair list') args =...
tests/unit/ext/__init__.py
whysage/python-dependency-injector
1,997
11056264
<reponame>whysage/python-dependency-injector """Dependency injector extension unit tests."""
recipes/Python/573471_Update_stock_quote_using_Yahoo_Finance_web/recipe-573471.py
tdiprima/code
2,023
11056293
# -*- coding: UTF-8 -*- """Usage: update_quote.py [log_filename] This script will scan your Excel spreadsheet for stock symbols. It will fetch the stock quote from the web and update the data in the spreadsheet. The spreadsheet should have a table on active sheet. The first row should be the header names and the firs...
tests/functional/utils.py
ekmixon/aws-lambda-powertools-python
1,208
11056294
<reponame>ekmixon/aws-lambda-powertools-python<filename>tests/functional/utils.py<gh_stars>1000+ import json from pathlib import Path from typing import Any def load_event(file_name: str) -> Any: path = Path(str(Path(__file__).parent.parent) + "/events/" + file_name) return json.loads(path.read_text())
scale/storage/test/messages/test_move_files.py
kaydoh/scale
121
11056295
from __future__ import unicode_literals import os import django from django.test import TestCase from storage.messages.move_files import create_move_file_message, MoveFile from storage.models import ScaleFile from storage.test import utils as storage_test_utils class TestMoveFiles(TestCase): def setUp(self): ...
guv/support/greendns.py
timgates42/guv
120
11056311
import struct import sys from .. import patcher from ..green import _socket3 from ..green import time from ..green import select dns = patcher.import_patched('dns', socket=_socket3, time=time, select=select) for pkg in ('dns.query', 'dns.exception', 'dns.inet', 'dns.message', 'dns.rdatatype', 'dns.resolve...
tools/Vitis-AI-Quantizer/vai_q_pytorch/pytorch_binding/pytorch_nndct/parse/trace_helper.py
bluetiger9/Vitis-AI
848
11056353
# # Copyright 2019 Xilinx Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
docs/TEMPLATES/template_module/template_module_impl/inherited_template_module_impl.py
TragedyN/SiamFCpp
737
11056362
<reponame>TragedyN/SiamFCpp<filename>docs/TEMPLATES/template_module/template_module_impl/inherited_template_module_impl.py<gh_stars>100-1000 # -*- coding: utf-8 -*- from loguru import logger from copy import deepcopy from typing import Dict, List, Tuple import cv2 import numpy as np from yacs.config import CfgN...
tests/memlet_propagation_volume_test.py
jnice-81/dace
227
11056364
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved. from dace.memlet import Memlet from dace.dtypes import Language, StorageType from dace.properties import CodeProperty from dace.sdfg import propagation from dace.sdfg.sdfg import InterstateEdge from dace.symbolic import symbol import dace N = ...
src/mlspace/requirements/base.py
abhishekkrthakur/mlspace
283
11056404
requirements = """ black==21.9b0 click==8.0.3 jupyter==1.0.0 jupyterlab==3.2.1 opencv-python==4.5.4.58 pandas==1.3.4 numpy==1.21.3 scikit-learn==1.0.1 scipy==1.7.1 """
ambari-common/src/test/python/mock/__init__.py
likenamehaojie/Apache-Ambari-ZH
1,664
11056405
__author__ = '<NAME>'
tests/validation/test_known_directives.py
closeio/graphql-core
590
11056441
from functools import partial from graphql.utilities import build_schema from graphql.validation import KnownDirectivesRule from .harness import assert_validation_errors, assert_sdl_validation_errors schema_with_directives = build_schema( """ type Query { dummy: String } directive @onQuery on ...
ml_collections/config_dict/examples/examples_test.py
wyddmw/ViT-pytorch-1
311
11056458
# Copyright 2021 The ML Collections 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 by applicable law or agreed...
test/label_test.py
screamingskulls/sofi
402
11056505
from sofi.ui import Label def test_basic(): assert(str(Label()) == "<span class=\"label label-default\"></span>") def test_text(): assert(str(Label("test")) == "<span class=\"label label-default\">test</span>") def test_danger_severity(): assert(str(Label("text", "danger")) == "<span class=\"label label-...
vision/body_analysis/arcface/dependencies/face_postprocess.py
oblanchet/models
4,678
11056522
<gh_stars>1000+ # SPDX-License-Identifier: Apache-2.0 import sklearn def postprocess(embedding): embedding = sklearn.preprocessing.normalize(embedding).flatten() return embedding
cnn_vis.py
DEVESHTARASIA/cnn-vis
554
11056546
<filename>cnn_vis.py import argparse, os, tempfile from collections import defaultdict import matplotlib.pyplot as plt import numpy as np from scipy.misc import imresize, imsave, imread from scipy.ndimage.filters import gaussian_filter import caffe def tv_norm(x, beta=2.0, verbose=False, operator='naive'): """ ...
mindsdb/integrations/trinodb/trinodb.py
yarenty/mindsdb
261
11056605
from mindsdb_datasources import TrinoDS class TrinodbConnectionChecker: def __init__(self, **kwargs): self.user = kwargs.get('user') self.password = kwargs.get('password') self.host = kwargs.get('host') self.port = kwargs.get('port') self.catalog = kwargs.get('catalog') ...
python/interpret-core/interpret/utils/test/test_utils.py
prateekiiest/interpret
2,674
11056618
# Copyright (c) 2019 Microsoft Corporation # Distributed under the MIT software license import pytest import numpy as np import pandas as pd from .. import gen_feat_val_list, gen_name_from_class from .. import reverse_map, unify_data, unify_vector @pytest.fixture def fixture_feat_val_list(): return [("race", 3),...
h2o-py/tests/testdir_algos/gbm/pyunit_PUBDEV_8294_binomial_response_warning.py
vishalbelsare/h2o-3
6,098
11056620
<reponame>vishalbelsare/h2o-3<filename>h2o-py/tests/testdir_algos/gbm/pyunit_PUBDEV_8294_binomial_response_warning.py<gh_stars>1000+ from __future__ import print_function import sys sys.path.insert(1,"../../../") import h2o from h2o.estimators.gbm import H2OGradientBoostingEstimator from tests import pyunit_utils de...
code/generate_hit_candidates.py
modestyachts/ImageNetV2
173
11056673
<gh_stars>100-1000 import argparse import candidate_data from datetime import date import datetime import json from near_duplicate_checker import print_nn_stats import mturk_data import pickle thresholds = { 'l2' : 1e8, 'dssim' : 1e32, 'fc7' : 1e4 } def remove_blacklist_candidates(candidates, blacklist): ...
plenum/server/request_handlers/ledgers_freeze/ledger_freeze_helper.py
IDunion/indy-plenum
148
11056679
<gh_stars>100-1000 from plenum.common.constants import CONFIG_LEDGER_ID from plenum.server.request_handlers.utils import decode_state_value from plenum.server.request_handlers.state_constants import MARKER_FROZEN_LEDGERS class StaticLedgersFreezeHelper: LEDGER = "ledger" STATE = "state" SEQ_NO = "seq_no...
observations/r/__init__.py
hajime9652/observations
199
11056735
"""[Observations.r](https://github.com/edwardlib/observations/r) submodule provides a one line Python API for loading popular R data sets. This module is collection of 1100+ datasets that were originally distributed alongside the statistical software environment R and its add-on packages. """ from __future__ import abs...
datapackage_pipelines/lib/load.py
gperonato/datapackage-pipelines
109
11056778
from dataflows import Flow, load from datapackage_pipelines.wrapper import ingest from datapackage_pipelines.utilities.flow_utils import spew_flow from datapackage_pipelines.utilities.resources import PROP_STREAMING, PROP_STREAMED_FROM def flow(parameters): _from = parameters.pop('from') num_resources = 0 ...
test/functional/master/test_console_output.py
rsennewald/ClusterRunner
164
11056827
import os import tempfile import yaml from test.framework.functional.base_functional_test_case import BaseFunctionalTestCase from test.functional.job_configs import JOB_WITH_SETUP_AND_TEARDOWN class TestConsoleOutput(BaseFunctionalTestCase): def setUp(self): super().setUp() self.project_dir = t...
model/transformer.py
Chuhanxx/FontAdaptor
116
11056831
<filename>model/transformer.py<gh_stars>100-1000 """" Code edited from: https://nlp.seas.harvard.edu/2018/04/03/attention.html """ import torch import torch.nn as nn import random import time import math import torch.nn.functional as F from torch.nn.utils.rnn import pack_padded_sequence,pad_packed_sequence from torch...
src/api/impl/changeset.py
piwaniuk/critic
216
11056871
<reponame>piwaniuk/critic # -*- mode: python; encoding: utf-8 -*- # # Copyright 2017 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://...
pubnub/models/consumer/objects_v2/sort.py
natekspencer/pubnub-python
146
11056910
from enum import Enum class PNSortKeyValue(Enum): ID = 1 NAME = 2 UPDATED = 3 class PNSortDirection(Enum): ASC = 1 DESC = 2 class PNSortKey: def __init__(self, sort_key_value, direction): self._sort_key_value = sort_key_value self._direction = direction @staticmethod ...
tests/crow/test_symmetric_psd.py
rinelson456/raven
159
11056941
# Copyright 2017 Battelle Energy Alliance, 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 t...
knowledge_repo/app/deploy/flask.py
romj/knowledge-repo
5,290
11056945
<gh_stars>1000+ from .common import KnowledgeDeployer class FlaskDeployer(KnowledgeDeployer): _registry_keys = ['flask'] def run(self, **kwargs): self.app.start_indexing() return self.app.run( debug=self.app.config['DEBUG'], host=self.host, port=self.port,...
Python/vipassna.py
kennethsequeira/Hello-world
1,428
11056948
x = 1 if x == 1: # indented four spaces print("x is 1.")
__main__.py
lucasschoenhold/nes-py
128
11057018
<gh_stars>100-1000 """The main script for development testing.""" from nes_py.app.cli import main # execute the main entry point of the CLI main()
404 Sum of Left Leaves.py
ChiFire/legend_LeetCode
872
11057045
""" Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ 15 7 There are two left leaves in the binary tree, with values 9 and 15 respectively. Return 24. """ __author__ = 'Daniel' # Definition for a binary tree node. class TreeNode(object): def __init__(self, x): ...
FleetIQ/server.py
nkwangjun/aws-gamelift-sample
131
11057062
<reponame>nkwangjun/aws-gamelift-sample<gh_stars>100-1000 import socket import boto3 import requests GameServerGroupName = 'GameServerGroups' GameServerId = 'game-server-1' InstanceId = requests.get('http://169.254.169.254/latest/meta-data/instance-id').text ConnectionInfo = requests.get('http://169.254.169.254/lates...
gaiadet/models/__init__.py
zengming16/GAIA-det
149
11057104
from .backbones import * # noqa: F401, F403 from .detectors import * # noqa: F401, F403 from .necks import * # noqa: F401, F403 from .utils import * # noqa: F401, F403
mask2former/data/dataset_mappers/coco_instance_new_baseline_dataset_mapper.py
Niklas-AD/Mask2Former
143
11057111
<gh_stars>100-1000 # Copyright (c) Facebook, Inc. and its affiliates. # Modified by <NAME> from https://github.com/facebookresearch/detr/blob/master/d2/detr/dataset_mapper.py import copy import logging import numpy as np import torch from detectron2.config import configurable from detectron2.data import detection_uti...
test/fixtures/python/corpus/generator-expression.A.py
matsubara0507/semantic
8,844
11057154
(c for b in a) (d for e in f)
detect_secrets_server/adhoc/github/webhook.py
ekmixon/detect-secrets-server
110
11057173
""" For organizations that integrate with Github, they have the ability to setup a webhook to receive events for all repos under the entire organization. In such cases, this script allows you to scan other fields in which secrets may be leaked, rather than just focusing on secrets in code. """ import io try: from c...
docs/source/examples/demo/__init__.py
flowersw/compose
181
11057191
import os import warnings warnings.filterwarnings("ignore") PWD = os.path.dirname(__file__)
src/tests/presale/test_checkoutflow.py
fabm3n/pretix
1,248
11057205
# # This file is part of pretix (Community Edition). # # Copyright (C) 2014-2020 <NAME> and contributors # Copyright (C) 2020-2021 rami.io GmbH and contributors # # This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General # Public License as published by the Free...
modules/mobi_split.py
rmkarasev/fb2mobi
103
11057208
<gh_stars>100-1000 # -*- coding: utf-8 -*- # borrowed from https://github.com/kevinhendricks/KindleUnpack and modified from __future__ import unicode_literals, division, absolute_import, print_function import struct import string import re from PIL import Image from io import BytesIO # note: struct pack, unpack, un...
Self-Consistent-Field/SAD/external.py
andyj10224/psi4numpy
214
11057227
import time import numpy as np class DIIS_helper(object): def __init__(self, max_vec=6): self.error = [] self.vector = [] self.max_vec = max_vec def add(self, matrix, error): if len(self.error) > 1: if self.error[-1].shape[0] != error.size: raise Ex...
tests/parser/exceptions/test_type_mismatch_exception.py
Doc-Pixel/vyper
1,471
11057234
import pytest from pytest import raises from vyper import compiler from vyper.exceptions import TypeMismatch fail_list = [ """ @external def foo(): a: uint256 = 3 b: int128 = 4 c: uint256 = min(a, b) """, """ @external def broken(): a : uint256 = 3 b : int128 = 4 c : uint256 = unsa...
gossip/control/convert.py
Gokul1077/PytGossip
122
11057258
<gh_stars>100-1000 # Copyright 2016 <NAME>, <NAME>, <NAME> # # 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...
tests/cosrlibtests/document/html/test_samples.py
commonsearch/cosr-back
141
11057281
import pytest import os import json from cosrlib.document.html import HTMLDocument from tests.testdata.html_page_samples import SAMPLES NEWSPAPER_DIR = "tests/testdata/html_newspaper_testcases" NEWSPAPER_TESTCASES = os.listdir("%s/html/" % NEWSPAPER_DIR) MOZILLA_READABILITY_DIR = "tests/testdata/html_mozilla_readabil...
sacredboard/app/data/pymongo/mongodb.py
akretz/sacredboard
188
11057283
<reponame>akretz/sacredboard # coding=utf-8 """Accesses data in Sacred's MongoDB.""" import pymongo from sacredboard.app.data.datastorage import Cursor, DataStorage from sacredboard.app.data.pymongo import GenericDAO, MongoMetricsDAO, MongoFilesDAO from sacredboard.app.data.pymongo.rundao import MongoRunDAO class Mo...
examples/flask_mongoengine/models.py
pfrantz/graphene-mongo
260
11057298
from datetime import datetime from mongoengine import Document, EmbeddedDocument from mongoengine.fields import ( DateTimeField, EmbeddedDocumentField, ListField, ReferenceField, StringField, ) class Department(Document): meta = {"collection": "department"} name = StringField() class Ro...
check/crontab_autocheck.py
MrLai/Django-Data-quality-system
148
11057303
import requests, datetime, math, threading quarter = str(datetime.datetime.now().year)+"Q"+str(math.ceil(datetime.datetime.now().month/3.)) url = "http://dataquality.utrustfintech.com/check/rule_execute" def post_rule_execute(company, quarter): data = {'company': company, 'username': 'crontab', 'quarter': quarter...
tests/modules/contrib/test_zpool.py
spxtr/bumblebee-status
1,089
11057313
import pytest pytest.importorskip("pkg_resources") def test_load_module(): __import__("modules.contrib.zpool")
examples/rfcn/lib/datasets/luna.py
ayzk/ft-caffe-public
933
11057320
# -------------------------------------------------------- # LUNA dataset reader # <NAME> (<EMAIL>) # -------------------------------------------------------- import os from datasets.imdb import imdb import datasets.ds_utils as ds_utils import xml.etree.ElementTree as ET import numpy as np import scipy.sparse import s...
src/models.py
Ynjxsjmh/mtl
385
11057325
<gh_stars>100-1000 import utils import src.convnet as cnn import tensorflow as tf from tensorflow.contrib.slim.nets import resnet_v1, resnet_utils import os from tensorflow.python.ops import nn import sys slim = tf.contrib.slim FLAGS = tf.app.flags.FLAGS class NeuralNet: def conv(self, x, filter_size, channels_shap...
astroML/clustering/tests/test_MST_clustering.py
aragilar/astroML
735
11057332
<gh_stars>100-1000 import numpy as np from numpy.testing import assert_, assert_allclose from astroML.clustering import HierarchicalClustering, get_graph_segments def test_simple_clustering(): np.random.seed(0) N = 10 X = np.random.random((N, 2)) model = HierarchicalClustering(8, edge_cutoff=0.5) ...
appsettings/migrations/0004_auto_20200716_0637.py
NGXTDN/webvirtcloud
1,246
11057336
# Generated by Django 2.2.13 on 2020-07-16 06:37 from django.db import migrations from django.utils.translation import gettext_lazy as _ def add_default_settings(apps, schema_editor): setting = apps.get_model("appsettings", "AppSettings") db_alias = schema_editor.connection.alias setting.objects.using(db...
mpi4jax/_src/__init__.py
Thenerdstation/mpi4jax
122
11057345
<filename>mpi4jax/_src/__init__.py # make sure to import mpi4py before anything else # this calls MPI_Init and registers mpi4py's atexit handler from mpi4py import MPI # this registers our custom XLA functions from . import xla_bridge # import public API from .collective_ops.allgather import allgather # noqa: F401 f...
tests/e2e/mysqloperator/operator/operator_t.py
sjmudd/mysql-operator
206
11057353
<reponame>sjmudd/mysql-operator<gh_stars>100-1000 # Copyright (c) 2020, Oracle and/or its affiliates. # # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ # # multiple operator instances in the same cluster # don't touch mysql pods that aren't ours # operator cra...
river/checks/reco.py
fox-ds/river
1,105
11057360
<gh_stars>1000+ import random def check_reco_routine(ranker): users = ["Tom", "Anna"] items = {"politics", "sports", "music", "food", "finance", "health", "camping"} def get_reward(user, item) -> bool: if user == "Tom": return item in {"music", "politics"} if user == "Anna": ...
tests/libs/metrics/top_level_metric_risk_levels_test.py
phc-health/covid-data-model
155
11057423
import pytest import pandas as pd from libs.metrics.top_level_metric_risk_levels import RiskLevel from libs.metrics import top_level_metric_risk_levels as metric_risk_levels from libs.metrics import top_level_metrics from tests.libs.metrics import top_level_metrics_test def test_calc_risk_level_below_limit(): """...
pycozmo/logger.py
nalbion/pycozmo
123
11057440
""" Logging. """ import logging __all__ = [ "logger", "logger_protocol", "logger_robot", "logger_reaction", "logger_behavior", "logger_animation", ] # General logger - general PyCozmo log messages. logger = logging.getLogger("pycozmo.general") # Protocol logger - log messages related to t...
cortex_DIM/models/prior_matching.py
Soapy-Salted-Fish-King/DIM
749
11057447
'''Module for prior matching. ''' import torch.nn as nn from cortex_DIM.functions.gan_losses import generator_loss from cortex_DIM.models.discriminator import Discriminator from cortex_DIM.nn_modules.convnet import Convnet class PriorMatching(Discriminator): '''Model for matching the output of a network to a p...
autobahn/wamp/gen/wamp/proto/CallerFeatures.py
rapyuta-robotics/autobahn-python
1,670
11057458
# automatically generated by the FlatBuffers compiler, do not modify # namespace: proto import flatbuffers class CallerFeatures(object): __slots__ = ['_tab'] @classmethod def GetRootAsCallerFeatures(cls, buf, offset): n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) x ...
wrappers/Python/CoolProp/State.py
pauliacomi/CoolProp
520
11057461
from __future__ import absolute_import # We made everything build into one module for simplicity as it makes the code much nicer to compile from .CoolProp import *
cyclegan/nets/resnet.py
xwshi/GAN-keras
197
11057462
<reponame>xwshi/GAN-keras import keras from keras.models import * from keras.layers import * from keras import layers import keras.backend as K from keras_contrib.layers.normalization.instancenormalization import InstanceNormalization IMAGE_ORDERING = 'channels_last' def one_side_pad( x ): x = ZeroPadding...
examples/twenty_newsgroups/nslda/nslda.py
casmlab/lda2vec
3,282
11057506
import chainer import chainer.links as L import chainer.functions as F from lda2vec import utils, dirichlet_likelihood import numpy as np class NSLDA(chainer.Chain): def __init__(self, counts, n_docs, n_topics, n_dim, n_vocab, n_samples=5): factors = np.random.random((n_topics, n_dim)).astype('float32')...
configs/mmocr/text-recognition/text-recognition_onnxruntime_dynamic.py
zhiqwang/mmdeploy
746
11057536
<reponame>zhiqwang/mmdeploy _base_ = [ './text-recognition_dynamic.py', '../../_base_/backends/onnxruntime.py' ]
tests/torch/test_se3_torch.py
MisterMap/liegroups
230
11057541
import copy import torch from liegroups.torch import SE3, SO3, utils def test_from_matrix(): T_good = SE3.from_matrix(torch.eye(4)) assert isinstance(T_good, SE3) \ and isinstance(T_good.rot, SO3) \ and T_good.trans.shape == (3,) \ and SE3.is_valid_matrix(T_good.as_matrix()).all() ...
recipes/Python/576443_Renamer/recipe-576443.py
tdiprima/code
2,023
11057543
<reponame>tdiprima/code<filename>recipes/Python/576443_Renamer/recipe-576443.py #! /usr/bin/python # -*- coding: utf-8 -*- # Credits to <NAME> <<EMAIL>>, the author of pyRenamer , as I copied some code from it # Dependencies - zenity import os import re import sys import time choice = ...
flask_editablesite/database.py
Jaza/flask-editablesite
115
11057657
<reponame>Jaza/flask-editablesite<filename>flask_editablesite/database.py # -*- coding: utf-8 -*- """Database module, including the SQLAlchemy database object and DB-related utilities. """ from datetime import datetime from sqlalchemy.exc import IntegrityError from sqlalchemy.orm import relationship, validates from ...
test/characterization/test_characterization.py
paulineollitrault/qiskit-ignis
182
11057682
<filename>test/characterization/test_characterization.py # -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2019. # # 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 ...
Sketchbots/sw/labqueue/lask/server/http/ldc_handlers.py
rlugojr/ChromeWebLab
306
11057684
<filename>Sketchbots/sw/labqueue/lask/server/http/ldc_handlers.py # Copyright 2013 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/licens...
runway/constants.py
avosper-intellaegis/runway
134
11057730
"""Runway constants.""" from pathlib import Path from typing import Any, Dict # A global credential cache that can be shared among boto3 sessions. This is # inherently threadsafe thanks to the GIL: # https://docs.python.org/3/glossary.html#term-global-interpreter-lock BOTO3_CREDENTIAL_CACHE: Dict[str, Any] = {} DOT_R...
facebook_business/adobjects/serverside/delivery_category.py
MyrikLD/facebook-python-business-sdk
576
11057738
# Copyright 2014 Facebook, Inc. # You are hereby granted a non-exclusive, worldwide, royalty-free license to # use, copy, modify, and distribute this software in source code or binary # form for use in connection with the web services and APIs provided by # Facebook. # As with any software that integrates with the Fa...
truckersmp_cli/truckersmp.py
lhark/truckersmp-cli
121
11057745
<reponame>lhark/truckersmp-cli """ TruckersMP handler for truckersmp-cli main script. Licensed under MIT. """ import hashlib import json import logging import os import sys import urllib.parse import urllib.request from .utils import check_hash, download_files from .variables import Args, URL def determine_game_br...