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
alipay/aop/api/domain/QuotaGradientRule.py
antopen/alipay-sdk-python-all
213
12769620
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class QuotaGradientRule(object): def __init__(self): self._score_400 = None self._score_450 = None self._score_500 = None self._score_550 = None self._score_600 ...
tacker/tests/unit/vnfm/policy_actions/respawn/test_respawn.py
takahashi-tsc/tacker
116
12769672
<reponame>takahashi-tsc/tacker # Copyright (c) 2014-2018 China Mobile (SuZhou) Software Technology Co.,Ltd. # 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 # # ...
eip96/eip_96_test_script.py
kevaundray/research
1,351
12769694
from ethereum import tester, vm from ethereum.utils import sha3, encode_int32, safe_ord, encode_hex from ethereum.state_transition import apply_message s = tester.state() c = s.contract('eip_96_blockhash_getter.se.py') blockhash_addr = b'\x00' * 19 + b'\x10' system_addr = b'\xff' * 19 + b'\xfe' s.state.set_code(blockha...
applications/tensorflow/detection/yolov3/evaluate.py
payoto/graphcore_examples
260
12769727
#! /usr/bin/env python # coding=utf-8 # Copyright (c) 2021 Graphcore Ltd. All Rights Reserved. # Copyright (c) 2019 YunYang1994 <<EMAIL>> # License: MIT (https://opensource.org/licenses/MIT) # This file has been modified by Graphcore Ltd. import argparse import json import math import os import shutil import time imp...
apps/init_before_startup.py
osroom/osroom
579
12769737
<filename>apps/init_before_startup.py #!/usr/bin/env python # -*-coding:utf-8-*- # @Time : 2020/03/14 12:44 # @Author : <NAME> import sys from signal import signal, SIGCHLD, SIG_IGN from pymongo.errors import OperationFailure from apps.configs.db_config import DB_CONFIG from apps.core.db.config_mdb import DatabaseConfi...
mac/pyobjc-core/libffi-src/tests/dejagnu.py
albertz/music-player
132
12769762
#!/usr/bin/python """ A very crude emulator of dejagnu, just enough to integrate the libbfi unittests into the pyobjc ones. """ import os import re import sys import signal from fnmatch import fnmatch import unittest from distutils.util import get_platform gDgCommands=re.compile(r''' (?:{\s*(dg-do)\s*run\s*({[...
datasets/spm_dataset.py
chinaliwenbo/ChineseBert
298
12769783
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @file : spm_dataset.py @author: zijun @contact : <EMAIL> @date : 2021/1/21 15:00 @version: 1.0 @desc : Dataset for sentence pair matching tasks """ from functools import partial import torch from torch.utils.data import DataLoader from datasets.chinese_bert_datase...
coding_interviews/leetcode/easy/generate_the_string/generate_the_string.py
LeandroTk/Algorithms
205
12769803
<gh_stars>100-1000 # https://leetcode.com/problems/generate-a-string-with-characters-that-have-odd-counts def generate_the_string(n): if n % 2 == 0: return 'a' * (n - 1) + 'b' return 'a' * n
src/ebonite/ext/sqlalchemy/__init__.py
koskotG/ebonite
270
12769864
from .repository import SQLAlchemyMetaRepository __all__ = ['SQLAlchemyMetaRepository']
demo_word_list_topic_model.py
shettyprithvi/scattertext
1,823
12769877
import scattertext as st from scattertext import RankDifference convention_df = st.SampleCorpora.ConventionData2012.get_data() convention_df['parse'] = convention_df['text'].apply(st.whitespace_nlp_with_sentences) unigram_corpus = (st.CorpusFromParsedDocuments(convention_df, ...
demo/one_shot/train.py
zhuguiqian/PaddleSlim
926
12769885
<gh_stars>100-1000 # Copyright (c) 2020 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 # # Unles...
scripts/cpsg.py
skyhoshi/concfg
864
12769889
""" cpsg.py ~~~~~~ Concfg Preset Screenshot Generator Only works in pure powershell/pwsh session, does not work in terminal like cmder. Prerequisites: Python3.4+, Pillow, jinja2, pywin32 """ import os import sys import glob import time import shutil import argparse import win...
egs/zeroth/s5/data/local/lm/buildLM/_scripts_/sumStatUniqWords.py
SYHPARK/kaldi
330
12769942
<filename>egs/zeroth/s5/data/local/lm/buildLM/_scripts_/sumStatUniqWords.py #!/usr/bin/env python3 # summation all the stat from uniqWord.JOB # build uniq word dictionary with count # # Copyright 2017 Atlas Guide (Author : <NAME>) # # Apache 2.0 # import fileinput import json import sys def main(): nLine = 1 ...
tests/source_image_caching_resolver_ut.py
jamieparkinson/loris
150
12769958
<gh_stars>100-1000 import os import shutil import unittest from tests.abstract_resolver import AbstractResolverTest from loris import resolver class SourceImageCachingResolverTest(AbstractResolverTest, unittest.TestCase): def setUp(self): super(SourceImageCachingResolverTest, self).setUp() tests...
tests/api/single_load/test_optional_types.py
ssato/python-anyconfig
213
12769959
# # Copyright (C) 2021 <NAME> <<EMAIL>> # License: MIT # # pylint: disable=missing-docstring import unittest import anyconfig.api from . import common LOADER_TYPES = frozenset(anyconfig.api.list_types()) @unittest.skipIf('yaml' not in LOADER_TYPES, 'yaml loader is not available') class YamlTestCa...
floo/editor.py
barrasch/floobits-sublime
124
12769988
import sys import os try: import sublime except Exception: pass NEW_ACCOUNT_TXT = '''Welcome {username}!\n\nYou're all set to collaborate. You should check out our docs at https://{host}/help/plugins/sublime#usage. You must run 'Floobits - Complete Sign Up' so you can log in to the website.''' LINKED_ACCOU...
reviewboard/accounts/views.py
amalik2/reviewboard
921
12770007
from __future__ import unicode_literals import logging from django.conf import settings from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.forms.forms import ErrorDict from django.http import HttpResponseRedire...
test/test_image_streamer_deployment_group_facts.py
nabhajit-ray/oneview-ansible
108
12770009
<reponame>nabhajit-ray/oneview-ansible #!/usr/bin/python # -*- coding: utf-8 -*- ### # Copyright (2016-2017) Hewlett Packard Enterprise Development LP # # 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 Lic...
Lib/test/bugs/pr183.py
jimmyyu2004/jython
332
12770013
<gh_stars>100-1000 # Test case for PR#183; print of a recursive PyStringMap causes a JVM stack # overflow. g = globals() print(g)
data/exploits/cve-2015-5287/sosreport-rhel7.py
OsmanDere/metasploit-framework
26,932
12770015
<reponame>OsmanDere/metasploit-framework<filename>data/exploits/cve-2015-5287/sosreport-rhel7.py #!/usr/bin/python # CVE-2015-5287 (?) # abrt/sosreport RHEL 7.0/7.1 local root # rebel 09/2015 # [user@localhost ~]$ python sosreport-rhel7.py # crashing pid 19143 # waiting for dump directory # dump directory: /var/tmp/a...
src/obfuscapk/obfuscators/new_signature/__init__.py
Elyorbe/Obfuscapk
688
12770040
<reponame>Elyorbe/Obfuscapk #!/usr/bin/env python3 from .new_signature import NewSignature
src/genie/libs/parser/iosxe/tests/ShowPlatformSoftwareFedactiveFnfEtAnalyticsFlows/cli/equal/golden_output_expected.py
balmasea/genieparser
204
12770041
<reponame>balmasea/genieparser<filename>src/genie/libs/parser/iosxe/tests/ShowPlatformSoftwareFedactiveFnfEtAnalyticsFlows/cli/equal/golden_output_expected.py expected_output = {'current-eta-records': 0, 'excess-packets-received': 60, 'excess-syn-received': 0, 'total-eta-fnf': 2, 'total-eta-idp': 2, 'total-eta-rec...
iepy/webui/corpus/migrations/0014_data_migration_move_metadata.py
francolq/iepy
813
12770092
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from django.db import models, migrations logging.basicConfig(format="%(asctime)-15s %(message)s") logger = logging.getLogger(__file__) logger.setLevel(logging.INFO) BULK_SIZE = 2500 def move_metadata(apps, schema_editor): IEDocumen...
metrics/fid.py
iviazovetskyi/rewriting
526
12770107
from __future__ import absolute_import, division, print_function import torch import warnings from tqdm import tqdm import pathlib from scipy import linalg import tensorflow as tf import numpy as np import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' def check_or_download_inception(inception_path): ''' Checks if t...
__scraping__/oldnavy.gap.com/main.py
whitmans-max/python-examples
140
12770133
#!/usr/bin/env python3 # date: 2016.11.24 (update: 2020.06.13) # https://stackoverflow.com/questions/40777864/retrieving-all-information-from-page-beautifulsoup/ from selenium import webdriver from bs4 import BeautifulSoup import time # --- get page --- link = 'http://oldnavy.gap.com/browse/category.do?cid=1035712&...
dictionary/views/edit.py
ankitgc1/django-sozluk-master
248
12770142
from django.contrib import messages as notifications from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.messages.views import SuccessMessageMixin from django.db.models import F, Q from django.db.models.functions import Coalesce from django.http import Http404 from django.shortcuts import get_...
bits_wilp/isPalindrome.py
deepak5998/Py
726
12770163
def isPalindrome(str): result = False if str == str[::-1]: result = True return result print("Please enter a string: ") x = input() flag = isPalindrome(x) if flag: print(x, "is a Palindrome") else: print(x, "is NOT a Palindrome")
tests/test_fastapi/test_more_reallife_fastapi.py
ivangirko/ormar
905
12770172
<filename>tests/test_fastapi/test_more_reallife_fastapi.py import asyncio from typing import List, Optional import databases import pytest import sqlalchemy from fastapi import FastAPI from starlette.testclient import TestClient import ormar from tests.settings import DATABASE_URL app = FastAPI() metadata = sqlalche...
scripts/normalization.py
ysy6868/STPF
958
12770195
#! /usr/bin/python ''' Data Normalization ''' from sklearn import preprocessing def normalize(file_dataframe, cols): ''' Data Normalization. ''' for col in cols: preprocessing.normalize(file_dataframe[col], \ axis=1, norm='l2', copy=False) return file_dataframe
veles/loader/pickles.py
AkshayJainG/veles
1,007
12770208
# -*- coding: utf-8 -*- """ .. invisible: _ _ _____ _ _____ _____ | | | | ___| | | ___/ ___| | | | | |__ | | | |__ \ `--. | | | | __|| | | __| `--. \ \ \_/ / |___| |___| |___/\__/ / \___/\____/\_____|____/\____/ Created on Jan 25, 2015 Loaders which get data from pickles ██...
wyze_sdk/service/__init__.py
RebelTat/wyze-sdk
132
12770220
from .api_service import ApiServiceClient # noqa from .auth_service import AuthServiceClient # noqa from .earth_service import EarthServiceClient # noqa from .ford_service import FordServiceClient # noqa from .general_api_service import GeneralApiServiceClient # noqa from .platform_service import PlatformServiceCl...
aiida/backends/sqlalchemy/migrations/versions/162b99bca4a2_drop_dbcalcstate.py
azadoks/aiida-core
180
12770250
<reponame>azadoks/aiida-core<filename>aiida/backends/sqlalchemy/migrations/versions/162b99bca4a2_drop_dbcalcstate.py # -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the ...
contextily/_providers.py
jpn--/contextily
163
12770282
""" Tile providers. This file is autogenerated! It is a python representation of the leaflet providers defined by the leaflet-providers.js extension to Leaflet (https://github.com/leaflet-extras/leaflet-providers). Credit to the leaflet-providers.js project (BSD 2-Clause "Simplified" License) and the Leaflet Provider...
train/experiment.py
deepmind/ithaca
389
12770290
# Copyright 2021 the Ithaca 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
passl/modeling/heads/simclr_contrastive_head.py
juneweng/PASSL
136
12770292
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve. # # 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 ap...
xssor/tcp.py
boundmania/xssor2
2,126
12770323
<filename>xssor/tcp.py sys_name = "XSS'OR" sys_copyright = <EMAIL>cos.me" def sys(req): return { 'sys_name': sys_name, 'sys_copyright': sys_copyright, }
tests/_namespace_util_test.py
poros/data_pipeline
110
12770348
<filename>tests/_namespace_util_test.py # -*- coding: utf-8 -*- # Copyright 2016 Yelp 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 # #...
tests/unit2/test_arcade.py
LiorAvrahami/arcade
824
12770349
<filename>tests/unit2/test_arcade.py import logging import arcade def test_logging(): arcade.configure_logging(logging.WARNING) logger = logging.getLogger('arcade') assert logger.level == logging.WARNING
nndet/core/boxes/anchors.py
joeranbosma/nnDetection
242
12770377
<reponame>joeranbosma/nnDetection """ Parts of this code are from torchvision and thus licensed under BSD 3-Clause License Copyright (c) <NAME> 2016, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: *...
scattertext/termcompaction/ClassPercentageCompactor.py
shettyprithvi/scattertext
1,823
12770384
<reponame>shettyprithvi/scattertext import numpy as np from scattertext.termranking import AbsoluteFrequencyRanker class ClassPercentageCompactor(object): def __init__(self, term_ranker=AbsoluteFrequencyRanker, term_count=2): ''' Limit terms to ones that make up a minimum percentage ...
synapse_antispam/mjolnir/antispam.py
grahamc/mjolnir
153
12770404
# -*- coding: utf-8 -*- # Copyright 2019 The Matrix.org Foundation C.I.C. # # 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...
tests/utils/test_task_handler_with_custom_formatter.py
npodewitz/airflow
8,092
12770417
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
tests/test_raw.py
fredstro/mrq
745
12770434
from mrq.job import Job import datetime from mrq.queue import Queue import time import pytest @pytest.mark.parametrize(["p_queue", "p_pushback", "p_timed", "p_flags"], [ ["test_timed_set", False, True, "--greenlets 10"], ["pushback_timed_set", True, True, "--greenlets 10"], ["test_sorted_set", False, Fals...
qf_lib/common/utils/miscellaneous/kelly.py
webclinic017/qf-lib
198
12770435
<reponame>webclinic017/qf-lib # 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 # # http://www...
pyecharts/charts/mixins.py
CharileWithZoe/pyecharts
11,032
12770442
from ..render import engine class ChartMixin: def add_js_funcs(self, *fns): for fn in fns: self.js_functions.add(fn) return self def load_javascript(self): return engine.load_javascript(self) class CompositeMixin(ChartMixin): def __iter__(self): for chart in ...
oauth/migrations/0003_auto_20190531_0914.py
enjoy-binbin/Django-blog
111
12770470
<reponame>enjoy-binbin/Django-blog # Generated by Django 2.1.5 on 2019-05-31 09:14 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('oauth', '0002_auto_20190512_1129'), ] operations = [ migrations.AlterModelOptions( name='oauthconfig'...
rest-service/manager_rest/security/user_handler.py
TS-at-WS/cloudify-manager
124
12770484
<filename>rest-service/manager_rest/security/user_handler.py ######### # Copyright (c) 2013 GigaSpaces Technologies Ltd. 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 # ...
sympybotics/kinematics.py
ZhangMeiHuiROS/Sym_RobotD
117
12770488
import sympy _id = lambda x: x class Kinematics(object): """Robot symbolic Jacobians. kinobj.J: list of link frame Jacobians - complete (6 x N): [linear_velocity angular_velocity] = J * joint_velocities kinobj.Jc: list of link center-of-mass Jacobians - c...
testproj/testproj/util.py
MilanPecov/drf-yasg
2,788
12770494
from django.templatetags.static import static from django.utils.functional import lazy static_lazy = lazy(static, str)
env/lib/python3.8/site-packages/ask_sdk_core/view_resolvers/locale_template_enumerator.py
adamash99/alexa-play-pot-of-greed
496
12770512
<gh_stars>100-1000 # -- coding: utf-8 -- # # Copyright 2019 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...
security_monkey/auditors/github/org.py
boladmin/security_monkey
4,258
12770530
# Copyright 2017 Netflix # # 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 ag...
npt/datasets/income.py
jacobkimmel/non-parametric-transformers
302
12770538
<filename>npt/datasets/income.py from pathlib import Path import numpy as np import pandas as pd from sklearn.datasets import fetch_openml from npt.datasets.base import BaseDataset class IncomeDataset(BaseDataset): def __init__(self, c): super().__init__( fixed_test_set_index=-99762) ...
libraries/botbuilder-core/tests/test_private_conversation_state.py
Fl4v/botbuilder-python
388
12770540
<filename>libraries/botbuilder-core/tests/test_private_conversation_state.py # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import aiounittest from botbuilder.core import MemoryStorage, TurnContext, PrivateConversationState from botbuilder.core.adapters import TestAdapte...
buildroot/support/testing/infra/emulator.py
rbrenton/hassos
617
12770543
<reponame>rbrenton/hassos import pexpect import infra class Emulator(object): def __init__(self, builddir, downloaddir, logtofile, timeout_multiplier): self.qemu = None self.downloaddir = downloaddir self.logfile = infra.open_log_file(builddir, "run", logtofile) # We use elastic ...
SMPyBandits/Policies/Posterior/DiscountedBeta.py
balbok0/SMPyBandits
309
12770557
# -*- coding: utf-8 -*- r""" Manipulate posteriors of Bernoulli/Beta experiments., for discounted Bayesian policies (:class:`Policies.DiscountedBayesianIndexPolicy`). """ from __future__ import division, print_function # Python 2 compatibility __author__ = "<NAME>" __version__ = "0.9" # Local imports try: from ....
tests/communication/utils.py
yangboz/maro
598
12770564
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import socket from maro.communication import Proxy def get_random_port(): with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as temp_socket: temp_socket.bind(("", 0)) random_port = temp_socket.getsockname()[1] retu...
chapter5_operations/prediction_monitoring_pattern/src/ml/data.py
sudabon/ml-system-in-actions
133
12770567
<reponame>sudabon/ml-system-in-actions from typing import List from pydantic import BaseModel class Data(BaseModel): data: List[List[float]] = [[5.1, 3.5, 1.4, 0.2]]
oslo_messaging/tests/rpc/test_dispatcher.py
sapcc/oslo.messaging
131
12770589
<gh_stars>100-1000 # Copyright 2013 Red Hat, 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 app...
tabnine-vim/third_party/ycmd/third_party/frozendict/setup.py
MrMonk3y/vimrc
239
12770629
from distutils.core import setup setup( name = 'frozendict', version = '0.3', url = 'https://github.com/slezica/python-frozendict', author = '<NAME>', author_email = '<EMAIL>', packages = ['frozendict'], license = 'MIT License', description = 'An immutable dicti...
mode/examples/Basics/Structure/Loop/Loop.pyde
timgates42/processing.py
1,224
12770637
<reponame>timgates42/processing.py """ Loop. The loop() function causes draw() to execute repeatedly. If noLoop is called in setup() the draw() is only executed once. In this example click the mouse to execute loop(), which will cause the draw() to execute repeatedly. """ y = 100 def setup(): """ The state...
model_zoo/YoloFastest/model/detector.py
danieltao1993/YoloAll
190
12770639
<reponame>danieltao1993/YoloAll import torch import torch.nn as nn from model.fpn import * from model.backbone.shufflenetv2 import * class Detector(nn.Module): def __init__(self, classes, anchor_num, load_param): super(Detector, self).__init__() out_depth = 112 stage_out_channels = [-1, 24...
tests/unit/test_readHelper.py
woshiange/python-lambda
1,441
12770670
<filename>tests/unit/test_readHelper.py import os import unittest import yaml from aws_lambda.helpers import read class TestReadHelper(unittest.TestCase): TEST_FILE = "readTmp.txt" def setUp(self): with open(TestReadHelper.TEST_FILE, "w") as tmp_file: tmp_file.write("testYaml: testing"...
tests/http_provider_hosted_test.py
ilblackdragon/studio
397
12770690
import unittest import os import tempfile import uuid from studio import model from model_test import get_test_experiment # We are not currently working with HTTP providers. @unittest.skip class HTTPProviderHostedTest(unittest.TestCase): def get_db_provider(self, config_name): config_file = os.path.join(...
chamfer_pytorch/test_chamfer.py
jiyeonkim127/PSI
138
12770717
<filename>chamfer_pytorch/test_chamfer.py import torch import dist_chamfer as ext distChamfer = ext.chamferDist() from torch.autograd import Variable def pairwise_dist(x, y): xx, yy, zz = torch.mm(x, x.t()), torch.mm(y, y.t()), torch.mm(x, y.t()) rx = xx.diag().unsqueeze(0).expand_as(xx) ry = yy.diag().u...
examples/strategies/double_ma.py
mcFore/ctpbee
461
12770727
<filename>examples/strategies/double_ma.py from ctpbee import CtpbeeApi, CtpBee from ctpbee.constant import Offset, TradeData, Direction from ctpbee.indicator.ta_lib import ArrayManager class DoubleMaStrategy(CtpbeeApi): def __init__(self, name): super().__init__(name) self.manager = ArrayManager(...
tests/test_forms.py
azmeuk/webtest
239
12770747
<gh_stars>100-1000 import cgi import os.path import struct import sys import webtest from webob import Request from webtest.debugapp import DebugApp from webtest.compat import to_bytes from webtest.forms import NoValue, Submit, Upload from tests.compat import unittest from tests.compat import u class TestForms(unitt...
regtests/test-all.py
ahakingdom/Rusthon
622
12770760
<filename>regtests/test-all.py import os, subprocess os.chdir( os.path.split(__file__)[0] ) subprocess.check_call(['python', 'test-c++.py']) subprocess.check_call(['python', 'test-go.py']) subprocess.check_call(['python', 'test-javascript.py']) subprocess.check_call(['python', 'test-markdowns.py'])
rastervision_core/rastervision/core/utils/misc.py
theoway/raster-vision
1,577
12770766
<reponame>theoway/raster-vision import io from pydantic import confloat from PIL import Image import numpy as np import imageio import logging Proportion = confloat(ge=0, le=1) log = logging.getLogger(__name__) def save_img(im_array, output_path): imageio.imwrite(output_path, im_array) def numpy_to_png(array...
python-sdk/experimental/deploy-triton/src/score_densenet.py
0mza987/azureml-examples
331
12770767
<gh_stars>100-1000 import io import numpy as np import os from azureml.core import Model from azureml.contrib.services.aml_request import rawhttp from azureml.contrib.services.aml_response import AMLResponse from PIL import Image from onnxruntimetriton import InferenceSession def preprocess(img, scaling): # , dtype...
resource_tracker/migrations/0005_auto_20211015_1015.py
LaudateCorpus1/squest
112
12770793
# Generated by Django 3.2.7 on 2021-10-15 08:15 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('resource_tracker', '0004_alter_resourcepoolattributedefinition_resource_pool'), ] operations = [ migrations.RenameField( model_name='res...
src/main/python/systemds/operator/algorithm/builtin/shortestPath.py
mdbloice/systemds
372
12770804
<reponame>mdbloice/systemds # ------------------------------------------------------------- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF lice...
algorithms/math/modular_exponentiation.py
jainrocky/python-ds
1,723
12770811
# to compute modular power # Iterative Function to calculate # (x^y)%p in O(log y) def power(x, y, p) : res = 1 # Initialize result # Update x if it is more # than or equal to p x = x % p while (y > 0) : # If y is odd, multiply # x with result ...
asset/api.py
745184532/cmdb
251
12770820
from rest_framework import generics from .models import AssetInfo from .serializers import AssetSerializer from rest_framework import permissions class AssetList(generics.ListCreateAPIView): queryset = AssetInfo.objects.all() serializer_class = AssetSerializer permission_classes = (permissions.AllowAny,) ...
data_collection/gazette/spiders/sc_pescaria_brava.py
kaiocp/querido-diario
454
12770827
from gazette.spiders.base.fecam import FecamGazetteSpider class ScPescariaBravaSpider(FecamGazetteSpider): name = "sc_pescaria_brava" FECAM_QUERY = 'entidade:"Prefeitura Municipal de Pescaria Brava"' TERRITORY_ID = "4212650"
2021/CVE-2021-34429/poc/pocsploit/CVE-2021-34429.py
hjyuan/reapoc
421
12770845
<reponame>hjyuan/reapoc import requests # Vuln Base Info def info(): return { "author": "cckuailong", "name": '''Jetty Authorization Before Parsing and Canonicalization Variation''', "description": '''For Eclipse Jetty versions 9.4.37-9.4.42, 10.0.1-10.0.5 & 11.0.1-11.0.5, URIs can be craf...
assignment1/q2_neural.py
gyubokLee/CS224
125
12770851
<reponame>gyubokLee/CS224 import numpy as np import random from q1_softmax import softmax from q2_sigmoid import sigmoid, sigmoid_grad from q2_gradcheck import gradcheck_naive def affine_forward(x, w, b): """ Computes the forward pass for an affine (fully-connected) layer. The input x has shape (N, d_1, ...
ch22-直方图/hist-normalized-numpy-2.py
makelove/OpenCV-Python-Tutorial
2,875
12770889
<filename>ch22-直方图/hist-normalized-numpy-2.py # -*-coding:utf8-*-# __author__ = 'play4fun' """ create time:15-10-24 下午5:26 """ import cv2 import numpy as np from matplotlib import pyplot as plt img = cv2.imread('../data/contrast75.png', 0) # flatten() 将数组变成一维 hist, bins = np.histogram(img.flatten(), 256, [0, 256]) # ...
pyclustering/nnet/__init__.py
JosephChataignon/pyclustering
1,013
12770963
<reponame>JosephChataignon/pyclustering<gh_stars>1000+ """! @brief Neural and oscillatory network module. Consists of models of bio-inspired networks. @authors <NAME> (<EMAIL>) @date 2014-2020 @copyright BSD-3-Clause """ import math from enum import IntEnum class initial_type(IntEnum): """! ...
leonardo/module/web/widgets/tables.py
timgates42/django-leonardo
102
12770980
import floppyforms as forms from django.forms.models import modelformset_factory from django.utils.translation import ugettext_lazy as _ from horizon import tables from horizon.tables.formset import FormsetDataTable, FormsetRow from leonardo.module.web.models import WidgetDimension class Slider(forms.RangeInput): ...
qt__pyqt__pyside__pyqode/pyqt5__QComboBox.py
DazEB2/SimplePyScripts
117
12771000
<reponame>DazEB2/SimplePyScripts<filename>qt__pyqt__pyside__pyqode/pyqt5__QComboBox.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' from PyQt5.Qt import * class MainWindow(QWidget): def __init__(self): super().__init__() self.tb_result = QTextBrowser() self.c...
mne/viz/tests/test_figure.py
stevemats/mne-python
1,953
12771029
# Authors: <NAME> <<EMAIL>> # # License: Simplified BSD import pytest from mne.viz._mpl_figure import _psd_figure from mne.viz._figure import _get_browser def test_browse_figure_constructor(): """Test error handling in MNEBrowseFigure constructor.""" with pytest.raises(TypeError, match='an instance of Raw, E...
alphamind/benchmarks/data/winsorize.py
rongliang-tech/alpha-mind
186
12771041
<gh_stars>100-1000 # -*- coding: utf-8 -*- """ Created on 2017-4-25 @author: cheng.li """ import datetime as dt import numpy as np import pandas as pd from alphamind.data.winsorize import winsorize_normal def benchmark_winsorize_normal(n_samples: int, n_features: int, n_loops: int) -> None: pr...
examples/00-mapdl-examples/contact_elements.py
RGPATCHI/pymapdl
194
12771047
""" .. _ref_contact_example: Contact Element Example ~~~~~~~~~~~~~~~~~~~~~~~ This example demonstrates how to create contact elements for general contact. Begin by launching MAPDL. """ from ansys.mapdl import core as pymapdl mapdl = pymapdl.launch_mapdl() ##########################################################...
snapchat_problems/problem_5.py
loftwah/Daily-Coding-Problem
129
12771078
<filename>snapchat_problems/problem_5.py """This problem was asked by Snapchat. You are given an array of length N, where each element i represents the number of ways we can produce i units of change. For example, [1, 0, 1, 1, 2] would indicate that there is only one way to make 0, 2, or 3 units, and two ways of mak...
pyringe/plugins/mod_base.py
Freezind/pyringe
507
12771087
#! /usr/bin/env python # # Copyright 2014 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 requ...
AutoDL_sample_code_submission/at_toolkit/interface/adl_classifier.py
dianjixz/AutoDL
1,044
12771103
<reponame>dianjixz/AutoDL import numpy as np class AdlClassifier(object): def init(self, class_num: int, init_params: dict): self.class_num = class_num self.label_map = list() self.clf_name = None raise NotImplementedError def fit(self, train_examples_x: np.ndarray, train_exam...
rasalit/apps/nlucluster/app.py
omidforoqi/rasalit
261
12771105
<reponame>omidforoqi/rasalit<gh_stars>100-1000 import os import pathlib from io import StringIO from pkg_resources import resource_filename import streamlit as st from whatlies.language import CountVectorLanguage from whatlies.transformers import Pca, Umap from whatlies import EmbeddingSet, Embedding import sentencep...
Python/Algorithms/Sieve Algorithms/Sieve of Eratosthenes.py
m-payal/AlgorithmsAndDataStructure
195
12771112
<reponame>m-payal/AlgorithmsAndDataStructure<gh_stars>100-1000 """ Sieve of Eratosthenes : Generate all the primes less than any integer nn """ from math import sqrt def get_primes(n): m = n + 1 # numbers = [True for i in range(m)] numbers = [True] * m for i in range(2, int(sqrt(n) + 1)): ...
atlas/workflow/scripts/convert_jgi2vamb_coverage.py
alienzj/atlas
204
12771173
<reponame>alienzj/atlas<filename>atlas/workflow/scripts/convert_jgi2vamb_coverage.py #!/usr/bin/env python import os import sys import re def main(jgi_file): # parsing input header = {} col2keep = ["contigName", "contigLen", "totalAvgDepth"] with open(jgi_file) as inF: for i, line in enumerate...
tests/pipeline_runners/pipeline_runner_utils_test.py
elifesciences/sciencebeam
272
12771207
<gh_stars>100-1000 from unittest.mock import patch, MagicMock import pytest import sciencebeam.pipeline_runners.pipeline_runner_utils as pipeline_runner_utils_module from sciencebeam.pipeline_runners.pipeline_runner_utils import ( get_remaining_file_list_for_args ) BASE_TEST_PATH = '/tmp/test/conversion-pipelin...
setup.py
asmiyusau/ShazamIO
111
12771214
import setuptools with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setuptools.setup( name="shazamio", version="0.0.5", author="dotX12", description="Is a FREE asynchronous library from reverse engineered Shazam API written in Python 3.6+ with asyncio and aiohttp. I...
chrome/installer/mac/universalizer.py
zealoussnow/chromium
14,668
12771215
#!/usr/bin/env python # coding: utf-8 # Copyright 2020 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 argparse import errno import filecmp import os import plistlib import shutil import stat import subprocess impo...
test/test_teams.py
Galtozzy/basketball_reference_scraper
191
12771233
<filename>test/test_teams.py import unittest from basketball_reference_scraper.teams import get_roster, get_team_stats, get_opp_stats, get_roster_stats, get_team_misc class TestTeams(unittest.TestCase): def test_get_roster(self): df = get_roster('GSW', 2019) curry_df = df[df['PLAYER']=='<NAME>'] ...
tests/test_helpers.py
baurt/sqladmin
319
12771274
from sqladmin.helpers import secure_filename def test_secure_filename(monkeypatch): assert secure_filename("My cool movie.mov") == "My_cool_movie.mov" assert secure_filename("../../../etc/passwd") == "etc_passwd" assert ( secure_filename("i contain cool \xfcml\xe4uts.txt") == "i_contain_co...
rasa_nlu/tokenizers/yaha_tokenizer.py
hetaomilk123/Rasa_NLU_Chi
1,304
12771279
# -*- coding: utf-8 -*- """ Created on Thu Nov 23 14:54:35 2017 @author: user """ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from typing import Any from typing import Dict from typing import List ...
alipay/aop/api/response/AlipayOpenServicemarketCommodityQueryResponse.py
snowxmas/alipay-sdk-python-all
213
12771297
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AlipayOpenServicemarketCommodityQueryResponse(AlipayResponse): def __init__(self): super(AlipayOpenServicemarketCommodityQueryResponse, self).__init__() self._app_hot...
aliyun-python-sdk-videoenhan/aliyunsdkvideoenhan/request/v20200320/ChangeVideoSizeRequest.py
yndu13/aliyun-openapi-python-sdk
1,001
12771354
<filename>aliyun-python-sdk-videoenhan/aliyunsdkvideoenhan/request/v20200320/ChangeVideoSizeRequest.py<gh_stars>1000+ # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ...
tests/r/test_bio_chemists.py
hajime9652/observations
199
12771355
<reponame>hajime9652/observations<gh_stars>100-1000 from __future__ import absolute_import from __future__ import division from __future__ import print_function import shutil import sys import tempfile from observations.r.bio_chemists import bio_chemists def test_bio_chemists(): """Test module bio_chemists.py by ...
addons/mendeley/views.py
gaybro8777/osf.io
628
12771370
# -*- coding: utf-8 -*- from .provider import MendeleyCitationsProvider from website.citations.views import GenericCitationViews mendeley_views = GenericCitationViews('mendeley', MendeleyCitationsProvider)
tools/dns-sync/dns_sync/api.py
ruchirjain86/professional-services
2,116
12771375
# Copyright 2017 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 agreed to in wr...