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
pulsar/apps/http/decompress.py
PyCN/pulsar
1,410
11127391
<reponame>PyCN/pulsar<gh_stars>1000+ import zlib class GzipDecompress: def __call__(self, data): deco = zlib.decompressobj(16 + zlib.MAX_WBITS) return deco.decompress(data) class DeflateDecompress: def __call__(self, data): try: return zlib.decompressobj().decompress(da...
bayespy/inference/__init__.py
dungvtdev/upsbayescpm
622
11127472
################################################################################ # Copyright (C) 2013 <NAME> # # This file is licensed under the MIT License. ################################################################################ """ Package for Bayesian inference engines Inference engines -----------------...
RecoJets/JetProducers/python/hltMVAJetPuId_cff.py
Purva-Chaudhari/cmssw
852
11127476
from RecoJets.JetProducers.hltPUIdAlgo_cff import * import RecoJets.JetProducers.MVAJetPuIdProducer_cfi as _mod hltMVAJetPuIdCalculator = _mod.MVAJetPuIdProducer.clone( produceJetIds = False, algos = cms.VPSet(cms.VPSet(full_74x)), jec = "AK4PFchs" ) hltMVAJetPuIdEvaluator = hltMVAJetPuIdCalculator.c...
tests/test_suite.py
chopeen/dataverse
681
11127478
# This contain a list of individual test and will be run from Jenkins. import unittest import test_access import test_create_test_account import test_root_dataverse import test_account import test_dataverse import test_dataset import test_dataset_fileupload # This is a list of testFileName.testClass def suite(): ...
examples/tutorials/tutorial3.py
uaca/deepy
260
11127494
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging, os logging.basicConfig(level=logging.INFO) import numpy as np import theano import theano.tensor as T from deepy.dataset import MnistDataset, MiniBatches from deepy.networks import ComputationalGraph from deepy.trainers import optimize_updates from tutori...
src/api/migrations/0012_delete_ffadminuser.py
nixplay/bullet-train-api
1,259
11127503
<filename>src/api/migrations/0012_delete_ffadminuser.py<gh_stars>1000+ # -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-05-18 10:42 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('api', '0011_auto_20180517_16...
imap_tools/folder.py
unqx/imap_tools
344
11127537
import re from typing import AnyStr, Optional, Iterable, List, Dict, Tuple from . import imap_utf7 from .consts import MailBoxFolderStatusOptions from .utils import check_command_status, pairs_to_dict, encode_folder from .errors import MailboxFolderStatusValueError, MailboxFolderSelectError, MailboxFolderCreateError, ...
textworld/generator/tests/test_logger.py
JohnnySun8/TextWorld
307
11127539
<gh_stars>100-1000 # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT license. import numpy as np from os.path import join as pjoin import textworld from textworld.utils import make_temp_directory from textworld.generator.logger import GameLogger def test_logger(): rng = np.ra...
realnvp/realnvp_helpers.py
bjlkeng/sandbox
158
11127548
<reponame>bjlkeng/sandbox import numpy as np from tensorflow.keras import backend as K from tensorflow.python.keras.layers import (InputSpec, Layer) from tensorflow.python.keras.layers.normalization import BatchNormalizationBase from tensorflow.python.keras.utils import tf_utils from tensorflow.python.framework impor...
migrations/versions/62c10b7111e4_.py
brayest/testcode
652
11127552
"""empty message Revision ID: <KEY> Revises: <PASSWORD> Create Date: 2019-04-01 19:52:11.577324 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = 'c4734f6489df' branch_labels = None depends_on = None def upgrade(): # ### commands aut...
plugins/sublime/tandem.py
geoffxy/tandem
732
11127595
import os import sys import random from subprocess import Popen, PIPE from threading import Thread, Event import sublime import sublime_plugin from tandem.diff_match_patch import diff_match_patch from tandem.edit import Edit # sys hack to add enum, required by the messages module file sys.path.append(os.path.join(o...
common/setup.py
krisshol/bach-kmno
248
11127610
from distutils.core import setup from src import __version__ setup( name="irma.common", version=__version__, author="Quarkslab", author_email="<EMAIL>", description="The common component of the IRMA software", packages=["irma.common", "irma.common.base", "irma.common...
external-import/crowdstrike/src/crowdstrike/report/__init__.py
tiiibs/connectors
132
11127617
<filename>external-import/crowdstrike/src/crowdstrike/report/__init__.py # -*- coding: utf-8 -*- """OpenCTI CrowdStrike report module."""
spec/fixtures/repeated_packed_write.py
Hyhyx/lua-pb
225
11127661
<filename>spec/fixtures/repeated_packed_write.py<gh_stars>100-1000 import repeated_packed_pb2 thing = repeated_packed_pb2.Thing() thing.parts.append(77) thing.parts.append(999) f = open('repeated_packed.bin', 'wb') f.write(thing.SerializeToString()) f.close()
recipes/Python/303338_Helper_subclass/recipe-303338.py
tdiprima/code
2,023
11127679
"""Helper code for win32pdhquery. For clarification of discussion, a "tick" is a measurement taken after a pre- defined amount of elapsed time. Data is stored in the following format:: {kind name : {instance name : {counter name : tick measurements}}} If a counter does not have an applicable...
Chapter12/libbots/utils.py
feiwang20/DRLHandsOn-Playground
2,497
11127689
import string from nltk.translate import bleu_score from nltk.tokenize import TweetTokenizer def calc_bleu_many(cand_seq, ref_sequences): sf = bleu_score.SmoothingFunction() return bleu_score.sentence_bleu(ref_sequences, cand_seq, smoothing_function=sf.method1, ...
tests/queue_test.py
maratsarbasov/aioprocessing
517
11127698
<reponame>maratsarbasov/aioprocessing import unittest from concurrent.futures import ProcessPoolExecutor import aioprocessing from aioprocessing.mp import Process, Event, util from ._base_test import BaseTest, _GenMixin def queue_put(q, val): val = q.put(val) return val def queue_get(q, e): val = q.get...
tests/pytests/unit/states/test_redismod.py
babs/salt
9,425
11127711
""" :codeauthor: <NAME> <<EMAIL>> """ import pytest import salt.states.redismod as redismod from tests.support.mock import MagicMock, patch @pytest.fixture def configure_loader_modules(): return {redismod: {}} def test_string(): """ Test to ensure that the key exists in redis with the value specifi...
webstruct/features/block_features.py
vishalbelsare/webstruct
210
11127725
# -*- coding: utf-8 -*- from __future__ import absolute_import __all__ = ['parent_tag', 'InsideTag', 'borders', 'block_length'] def _inside_tag(elem, tagname): """ >>> from lxml.html import fragment_fromstring >>> root = fragment_fromstring('<div><i>foo</i><strong><p>head 1</p></strong></div>') >>> el...
components/aws/sagemaker/tests/unit_tests/tests/common/dummy_component.py
Strasser-Pablo/pipelines
2,860
11127734
<reponame>Strasser-Pablo/pipelines<filename>components/aws/sagemaker/tests/unit_tests/tests/common/dummy_component.py from tests.unit_tests.tests.common.dummy_spec import ( DummyInputs, DummyOutputs, DummySpec, ) from common.sagemaker_component import ComponentMetadata, SageMakerComponent @ComponentMetada...
theseus/utils/tests/test_utils.py
jeffin07/theseus
236
11127800
<gh_stars>100-1000 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import numpy as np import pytest # noqa: F401 import torch import torch.nn as nn import theseus.utils as thutils def ...
Python/03 - Strings/06 - String Validators.py
srgeyK87/Hacker-Rank-30-days-challlenge
275
11127806
<gh_stars>100-1000 # ======================== # Information # ======================== # Direct Link: https://www.hackerrank.com/challenges/string-validators/problem # Difficulty: Easy # Max Score: 10 # Language: Python # ======================== # Solution # ======================== if __name__ == '__...
watermask_remover_and_split_data/tools/preprocess_for_test.py
ericosmic/2019-CCF-BDCI-OCR-MCZJ-OCR-IdentificationIDElement
886
11127853
<filename>watermask_remover_and_split_data/tools/preprocess_for_test.py import cv2 import numpy as np import os from multiprocessing import Pool def _resize_image(img, dst_height): h_old = img.shape[0] w_old = img.shape[1] height = dst_height width = int(w_old * height / h_old) resized_...
chrome/common/extensions/docs/server2/cache_chain_object_store.py
nagineni/chromium-crosswalk
231
11127887
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from future import Future from object_store import ObjectStore class _GetMultiFuture(object): '''A Future for GetMulti. Params: - |toplevel_cache| Ca...
networks/scitile/pd_solve/gradtest.py
ZhouXiaolin/plaidml
4,535
11127916
import numpy as np import os import sys import plaidml2 import plaidml2.edsl as edsl import plaidml2.exec as pld_exec import plaidml2.op as op import unittest import numpy.testing as npt def matmul_2_2(A, B): I, J, K = edsl.TensorDims(3) i, j, k = edsl.TensorIndexes(3) A.bind_dims(I, J) B.bind_dims(...
mpf/commands/build.py
haggispinball/mpf_fathom_fast
163
11127958
<filename>mpf/commands/build.py """Command to build artifacts for non-dev operations.""" import pickle import argparse from mpf.core.utility_functions import Util from mpf.core.config_loader import YamlMultifileConfigLoader, ProductionConfigLoader from mpf.commands import MpfCommandLineParser SUBCOMMAND = True cl...
admintools/utils.py
goztrk/django-htk
206
11127968
# Python Standard Library Imports # Third Party (PyPI) Imports import rollbar # HTK Imports from htk.admintools.cachekeys import HtkCompanyEmployeesCache from htk.admintools.cachekeys import HtkCompanyOfficersCache from htk.apps.accounts.utils import get_user_by_email from htk.utils import htk_setting from htk.utils....
unittest/python/bindings.py
thanhndv212/pinocchio
716
11128011
<reponame>thanhndv212/pinocchio import unittest import pinocchio as pin from pinocchio.utils import np, npl, rand, zero from test_case import PinocchioTestCase as TestCase # This whole file seems to be outdated and superseded by more recent tests # Probably it should be removed and its contents moved or split somewhe...
models/layers.py
tjtanaa/ml-gsn
202
11128015
import math import torch from torch import nn import torch.nn.functional as F from .op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d class PixelNorm(nn.Module): """Pixel normalization layer. Normalizes feature maps along the pixel dimension. Used to prevent explosion of pixel magnitude. """ d...
src/python/model/model.py
annihilatethee/seedsync
255
11128020
<gh_stars>100-1000 # Copyright 2017, <NAME>, All rights reserved. import logging from abc import ABC, abstractmethod from typing import Set # my libs from common import AppError from .file import ModelFile class ModelError(AppError): """ Exception indicating a model error """ pass class IModelList...
December-10/python_UjjwalPrahladka_Dec10.py
UjjwalPrahladka/A-December-of-Algorithms-2019
228
11128025
<gh_stars>100-1000 def cookieCount(n,p,c): no_of_cookies = 0 no_of_jars = 0 no_of_cookies = no_of_jars = n // p while no_of_jars >= c: no_of_jars -= c no_of_cookies += 1 return no_of_cookies n,p,c = input('Enter n p c: ').split() print('Total Cookies Eaten: {}'.format(cookie...
libgsync/filter.py
iwonbigbro/gsync
199
11128036
#!/usr/bin/env python # -*- coding: utf8 -*- # Copyright (C) 2013 <NAME>. All rights reserved. """ Defines the filter feature of gsync, as specified by --filter like options. """ import re, fnmatch from libgsync.output import debug RULEMOD_PAIRS = [ ("exclude", "-"), ("include", "+"), ("hide", "H"), ...
tests/test_macros.py
SharpKoi/Kashgari
2,422
11128037
<reponame>SharpKoi/Kashgari # encoding: utf-8 # author: BrikerMan # contact: <EMAIL> # blog: https://eliyar.biz # file: test_macros.py # time: 3:23 下午 import random import logging from kashgari.macros import DATA_PATH from tensorflow.keras.utils import get_file from kashgari.corpus import ChineseDailyNerCorpus, SMP2...
455 Assign Cookies.py
krishna13052001/LeetCode
872
11128048
<gh_stars>100-1000 #!/usr/bin/python3 """ Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimum size of a cookie that the child will be content with; and each cookie j has a size sj. If s...
autocolorize/datasets.py
gustavla/autocolorizer
234
11128059
<filename>autocolorize/datasets.py from __future__ import division, print_function, absolute_import import os import glob import itertools as itr import numpy as np def load_image_list(dataset, offset=0, count=None, seed=None): if dataset == 'legacy': root_dir = "/share/data/vision-greg/larsson/data/legac...
基础教程/A2-神经网络基本原理/src/Data/ch08.py
microsoft/ai-edu
11,094
11128063
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE file in the project root for full license information. import numpy as np from pathlib import Path import matplotlib.pyplot as plt train_data_name = "../../data/ch08.train.npz" test_data_name = "../../data/ch08.test.npz" de...
src/tagStorm/softToTagStorm.py
andypohl/kent
171
11128072
<filename>src/tagStorm/softToTagStorm.py #!/usr/bin/env python2.7 # softToTagStorm # <NAME> 07/14/2015 # <EMAIL>/<EMAIL> """ Convert from soft format to tagStorm format. """ from __future__ import print_function import sys, operator, fileinput, collections, string, os.path import re, argparse, subprocess spec...
cotk/dataloader/dataloader.py
ishine/cotk
117
11128076
<reponame>ishine/cotk<gh_stars>100-1000 '''A module for dataloader''' import random from typing import Optional, Any, Union, Sequence, Dict, Tuple, Iterable, List from collections import Counter, OrderedDict from itertools import chain import logging from hashlib import sha256 import numpy as np from .._utils import ...
plenum/test/exceptions.py
andkononykhin/plenum
148
11128094
class NotFullyConnected(Exception): pass class TestException(Exception): pass
bip/base/bipida.py
paulfariello-syn/bip
145
11128097
import ida_kernwin class BipIda(object): """ Class for regrouping interfaces with IDA in itself. This can include configurations and thing specific to the IDA API. Currently this contain only static methods. """ @staticmethod def exec_sync(func, *args, **kwargs): """ ...
gluoncv/data/recordio/__init__.py
Kh4L/gluon-cv
5,447
11128198
<reponame>Kh4L/gluon-cv """Datasets from RecordIO files."""
unitest/test_memory_cache.py
reyoung/PatrickStar
494
11128229
# BSD 3-Clause License # # Copyright (C) 2021 THL A29 Limited, a Tencent company. 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 must retain the above copyrig...
jsonrpcserver/utils.py
bcb/jsonrpcserver
144
11128250
from functools import reduce from typing import Any, Callable, List identity = lambda x: x def compose(*fs: Callable[..., Any]) -> Callable[..., Any]: def compose2(f: Callable[..., Any], g: Callable[..., Any]) -> Callable[..., Any]: return lambda *a, **kw: f(g(*a, **kw)) return reduce(compose2, fs)...
logistic-regression/mnist_dataset.py
eliben/deep-learning-samples
183
11128340
<filename>logistic-regression/mnist_dataset.py<gh_stars>100-1000 # Helper code for downloading, unpickling and displaying MNIST data. # # <NAME> (http://eli.thegreenplace.net) # This code is in the public domain from __future__ import print_function import cPickle as pickle import gzip import os from shutil import copy...
data_processing/updated_avg_files.py
astraetech/Options_Data_Science
292
11128362
""" Say you Initially This script takes the Options_averages_calls.db & Options_averages_puts.db files created with contracts_avg_volume.py combines it with the """ import sqlite3 import os import pandas as pd import time from sqlalchemy import create_engine from pandas.io.sql import DatabaseError os.system('afplay...
miscellanies/torch/checkpoint.py
zhangzhengde0225/SwinTrack
143
11128363
import torch import os import shutil from miscellanies.torch.distributed import is_main_process def _get_training_state_file_path(model_state_file_path: str): return os.path.join(os.path.dirname(model_state_file_path), os.path.splitext(os.path.basename(model_state_file_path))[0] + '-training.pth') def _safe_ren...
examples/integrations/opfython/supervised_opf_feature_selection.py
anukaal/opytimizer
528
11128386
<filename>examples/integrations/opfython/supervised_opf_feature_selection.py import opfython.math.general as g import opfython.stream.splitter as s from opfython.models.supervised import SupervisedOPF from sklearn.datasets import load_digits import opytimizer.math.random as r from opytimizer import Opytimizer from opy...
modules/templates/locations/PK/config.py
whanderley/eden
205
11128403
# -*- coding: utf-8 -*- from gluon import current def config(settings): """ Template settings for Pakistan - designed to be used in a Cascade with an application template """ #T = current.T # Pre-Populate settings.base.prepopulate.append("locations/PK") # Uncomment to restri...
tests/strategies/test_blshsl.py
Dexius/12test12
103
11128411
<reponame>Dexius/12test12 #!/usr/bin/env python # -*- coding: utf-8 -*- """ test_blshsl.py ---------------------------------- This will test the blshsl strategy. Which means basically buy low, sell high, stop loss. """ def test_monoton_raising(): """Monoton raising chart. State is still in in initial phase. ...
pixelssl/nn/module/gaussian_blur.py
charlesCXK/PixelSSL
223
11128418
<reponame>charlesCXK/PixelSSL import math import numpy as np import scipy.ndimage import torch import torch.nn as nn from pixelssl.utils import logger class GaussianBlurLayer(nn.Module): """ Add Gaussian Blur to a 4D tensor This layer takes a 4D tensor of {N, C, H, W} as input. The Gaussian blur will b...
tests/test_efs/junk_drawer.py
oakbramble/moto
5,460
11128419
def has_status_code(response, code): return response["ResponseMetadata"]["HTTPStatusCode"] == code
sdk/python/kubeflow/pytorchjob/models/v1_py_torch_job_spec.py
happy2048/pytorch-operator
312
11128458
<reponame>happy2048/pytorch-operator # Copyright 2019 kubeflow.org. # # 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...
organize/apps.py
vanessa/djangogirls
446
11128484
<filename>organize/apps.py from django.apps import AppConfig class OrganizeConfig(AppConfig): name = 'organize'
examples/irevnet/models/model_utils.py
xuanyuzhou98/higher
392
11128500
""" Code for "i-RevNet: Deep Invertible Networks" https://openreview.net/pdf?id=HJsjkMb0Z ICLR 2018 """ import torch import torch.nn as nn from torch.nn import Parameter def split(x): n = int(x.size()[1]/2) x1 = x[:, :n, :, :].contiguous() x2 = x[:, n:, :, :].contiguous() return x1, x2 def merge(x...
tools/GraphiteServer.py
miohtama/RedisTimeSeries
643
11128565
<filename>tools/GraphiteServer.py #!/usr/bin/env python from __future__ import print_function import re import argparse import redis from gevent.server import StreamServer REDIS_POOL = None GRAPHITE_PROTO_RE = re.compile(r"(.*?)\s+([\d.]+)\s+(\d+)") def process_connection(socket, _): """ Per-Connection hand...
docs/plots/ex_plot_descent_process.py
guillep/DPPy
176
11128583
from dppy.exotic_dpps import DescentProcess dp = DescentProcess() size = 100 dp.sample(size) dp.plot(vs_bernoullis=True)
src/fitly/layouts.py
ethanopp/fitly
107
11128587
<reponame>ethanopp/fitly<gh_stars>100-1000 """Contains layouts suitable for being the value of the 'layout' attribute of Dash app instances. """ from flask import current_app as server import dash_core_components as dcc import dash_html_components as html import dash_bootstrap_components as dbc from .components impor...
basketball_reference_web_scraper/output/service.py
tttgm/basketball_reference_web_scraper
325
11128617
<filename>basketball_reference_web_scraper/output/service.py from basketball_reference_web_scraper.data import OutputType class OutputService: def __init__(self, json_writer, csv_writer): self.json_writer = json_writer self.csv_writer = csv_writer self.output_type_writers = { O...
YaraGuardian/API/urls.py
gcnoopy/YaraGuardian
178
11128634
from django.conf.urls import include, url from rest_framework.authtoken import views import YaraGuardian.API.account import YaraGuardian.API.groups import YaraGuardian.API.rules urlpatterns = [ # url(r'^', include('rest_framework_docs.urls')), url(r'^token-auth/', views.obtain_auth_token), url(r'^accou...
gnocchi/indexer/alembic/versions/04eba72e4f90_rename_ck_started_before_ended.py
Dmitry-Eremeev/gnocchi
299
11128725
<reponame>Dmitry-Eremeev/gnocchi<gh_stars>100-1000 # Copyright 2019 The Gnocchi Developers # # 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/...
benchmarks/compute/fib.py
Schweinepriester/oil
2,209
11128741
<reponame>Schweinepriester/oil #!/usr/bin/env python2 """ fib.py """ from __future__ import print_function import sys def main(argv): try: iters = int(argv[1]) except IndexError: iters = 5 try: n = int(argv[2]) except IndexError: n = 10 i = 0 while i < iters: j = 0 a = 1 b =...
.ycm_extra_conf.py
meyersbs/vip3r
124
11128811
<reponame>meyersbs/vip3r<gh_stars>100-1000 import os import ycm_core from clang_helpers import PrepareClangFlags compilation_database_folder = '' flags = [ '-Wall', '-Wextra', '-Werror', '-Wno-long-long', '-Wno-variadic-macros', '-fexceptions', '-DNDEBUG', '-DUSE_CLANG_COMPLETER', '-D_HAVE_NOTIFY', '-DPONYMIX_VERSION...
pytorch_wrapper/evaluators.py
skatsaounis/pytorch-wrapper
111
11128864
import numpy as np from abc import ABC, abstractmethod from sklearn import metrics from . import functional as pwF class AbstractEvaluatorResults(ABC): """ Objects of derives classes encapsulate results of an evaluation metric. """ @abstractmethod def is_better_than(self, other_results_object):...
modules/usm.py
tansyab1/LightNetPlus
240
11128921
<gh_stars>100-1000 import math import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from modules.inplace_abn.iabn import ABN def gauss_kernel(kernel_size, sigma): # Create a x, y coordinate grid of shape (kernel_size, kernel_size, 2) x_cord = torch.arange(kernel_size) x_gr...
tests/lamvery/env_test.py
rdtr/lamvery
101
11128991
# -*- coding: utf-8 -*- import os from unittest import TestCase from nose.tools import eq_ import lamvery.env ENV_JSON = ''' { "foo": "bar", "baz": "qux" } ''' class FunctionsTestCase(TestCase): def setUp(self): open(lamvery.env.ENV_FILE_NAME, 'w').write(ENV_JSON) if 'foo' in os.enviro...
src/timeago/locales/ca.py
nmb10/timeago
220
11129019
<reponame>nmb10/timeago<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2017-8-30 @author: generated by @lolobosse script ''' LOCALE = [ ["fa un moment", "d'aquí un moment"], ["fa %s segons", "d'aquí %s segons"], ["fa 1 minut", "d'aquí 1 minut"], ["fa %s minuts", "d'aquí ...
catboost/tools/limited_precision_numpy_diff/main.py
jochenater/catboost
6,989
11129078
<reponame>jochenater/catboost<filename>catboost/tools/limited_precision_numpy_diff/main.py import argparse import numpy as np def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('--rtol', default=1.e-5) parser.add_argument('--atol', default=1.e-8) parser.add_argument('npyArrayPath...
medspacy/common/__init__.py
lusterck/medspacy
197
11129081
<reponame>lusterck/medspacy from .base_rule import BaseRule
package/tests/test_integrations/test_pypi.py
deepyaman/kedro-viz
125
11129109
import pytest from semver import VersionInfo from kedro_viz.integrations.pypi import get_latest_version, is_running_outdated_version def test_get_latest_version(mocker, mock_http_response): mock_version = "1.0.0" requests_get = mocker.patch("requests.get") requests_get.return_value = mock_http_response( ...
depot/fields/interfaces.py
tcmike/depot
128
11129156
<filename>depot/fields/interfaces.py from abc import ABCMeta, abstractmethod from depot._compat import with_metaclass from depot.manager import DepotManager class FileFilter(with_metaclass(ABCMeta, object)): """Interface that must be implemented by file filters. File filters get executed whenever a file is s...
nbtutor/__init__.py
vincentxavier/nbtutor
423
11129229
<gh_stars>100-1000 from .version import __version__ # noqa F401 from .version import __version_info__ # noqa F401 def _jupyter_server_extension_paths(): return [dict(module="nbtutor")] def _jupyter_nbextension_paths(): return [dict( section="notebook", src="static", dest="nbtutor",...
scripts/notebook-history-s3/notebook-history-s3.py
homegate-engineering/amazon-sagemaker-notebook-instance-lifecycle-config-samples
291
11129253
# 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 # # https://aws.amazon.com/apache-2-0/ # # or...
lib/redfin/constants.py
goztrk/django-htk
206
11129267
REDFIN_API_BASE_URL = 'https://www.redfin.com' REDFIN_API_ENDPOINTS = { 'get_property_listing_id' : '/stingray/do/api-get-property-listing-id', 'get_avm' : '/stingray/api/home/details/avm', 'get_property_parcel_info' : '/stingray/api/home/details/propertyParcelInfo', }
src/pretalx/event/migrations/0024_remove_team_review_override_votes.py
lili668668/pretalx
418
11129309
<reponame>lili668668/pretalx # Generated by Django 3.1 on 2020-09-24 21:08 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("event", "0023_update_featured_visibility"), ] operations = [ migrations.RemoveField( model_name="team", ...
workflows/pipe-common/scripts/configure_system_settings_win.py
ZMaratovna/cloud-pipeline
126
11129328
<reponame>ZMaratovna/cloud-pipeline # Copyright 2017-2021 EPAM Systems, Inc. (https://www.epam.com/) # # 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/LICE...
angrmanagement/ui/widgets/qblock_label.py
DennyDai/angr-management
474
11129344
<reponame>DennyDai/angr-management<filename>angrmanagement/ui/widgets/qblock_label.py from PySide2.QtGui import QPainter from PySide2.QtWidgets import QGraphicsSimpleTextItem from PySide2.QtCore import Qt, QRectF from ...config import Conf from .qgraph_object import QCachedGraphicsItem class QBlockLabel(QCachedGrap...
atx/ext/gt.py
jamjven/ATX
1,132
11129399
<reponame>jamjven/ATX #!/usr/bin/env python # -*- coding: utf-8 -*- # # extention for http://gt.qq.com/ # reference doc http://gt.qq.com/docs/a/UseGtWithBroadcast.txt # # Experimental, maybe change in the future # Created by <hzsunshx> 2016-06-12 import functools class GT(object): def __init__(self, d): ...
pytorch_toolbelt/modules/encoders/timm/nfnet_s.py
mohitktanwr/toolkits
1,281
11129410
<gh_stars>1000+ from .common import GenericTimmEncoder, make_n_channel_input_std_conv __all__ = [ "NFNetF0SEncoder", "NFNetF1SEncoder", "NFNetF2SEncoder", "NFNetF3SEncoder", "NFNetF4SEncoder", "NFNetF5SEncoder", "NFNetF6SEncoder", "NFNetF7SEncoder", ] class NFNetF0SEncoder(GenericTimm...
scripts/monitoring/cron-send-ovs-status.py
fahlmant/openshift-tools
164
11129419
#!/usr/bin/env python ''' Command to send status of ovs to Zabbix ''' #This is not a module, but pylint thinks it is. This is a command. #pylint: disable=invalid-name,import-error import subprocess from openshift_tools.monitoring.metric_sender import MetricSender def get_vswitch_ports(): ''' Get list of port...
Machine Learning Projects/Fake_News_Classifier/model.py
TeacherManoj0131/HacktoberFest2020-Contributions
256
11129571
<reponame>TeacherManoj0131/HacktoberFest2020-Contributions # Necessary Libraries import pandas as pd import numpy as np import pickle import matplotlib.pyplot as plt from sklearn.metrics import classification_report, confusion_matrix from sklearn.pipeline import Pipeline from sklearn.model_selection import train_test_s...
cpp2py_test/ind_initialize_test.py
fevorl/BM3D_py
157
11129665
<gh_stars>100-1000 import numpy as np def ind_initialize(max_size, N, step): ind_set = np.empty(shape=[0], dtype=np.int) ind = N while (ind < max_size - N): ind_set = np.append(ind_set, np.array([ind]), axis=0) ind += step if ind_set[-1] < max_size - N - 1: ind_set = np.append(...
qutip/tomography.py
camponogaraviera/qutip
1,205
11129714
<gh_stars>1000+ __all__ = ['qpt_plot', 'qpt_plot_combined', 'qpt'] from qutip.tensor import tensor from qutip.superoperator import spre, spost, mat2vec, vec2mat from numpy import hstack, real, imag import scipy.linalg as la from qutip.visualization import matrix_histogram, matrix_histogram_complex try: import mat...
doc/samples/timeout.py
m4ta1l/doit
1,390
11129720
import datetime from doit.tools import timeout def task_expire(): return { 'actions': ['echo test expire; date'], 'uptodate': [timeout(datetime.timedelta(minutes=5))], 'verbosity': 2, }
tf_encrypted/operations/secure_random/__init__.py
wqruan/tf-encrypted
825
11129732
<gh_stars>100-1000 """Secure random API.""" from .secure_random import random_uniform from .secure_random import secure_seed from .secure_random import seeded_random_uniform from .secure_random import supports_secure_randomness from .secure_random import supports_seeded_randomness __all__ = [ "supports_secure_rand...
corehq/apps/app_manager/migrations/0018_migrate_case_search_labels.py
akashkj/commcare-hq
471
11129738
<gh_stars>100-1000 from django.core.management import call_command from django.db import migrations from corehq.toggles import SYNC_SEARCH_CASE_CLAIM from corehq.util.django_migrations import skip_on_fresh_install @skip_on_fresh_install def _migrate_case_search_labels(apps, schema_editor): for domain in sorted(S...
tests/contrib/pylons/tests.py
ascan-io/raven-python
1,108
11129758
from raven.utils.testutils import TestCase from raven.contrib.pylons import Sentry def example_app(environ, start_response): raise ValueError('hello world') class MiddlewareTest(TestCase): def setUp(self): self.app = example_app def test_init(self): config = { 'sentry.dsn': ...
tests/stg2_network_graph_dump.py
qiaone/GIF
322
11129790
import torch import numpy as np from model.stg2_generator import Generator from model.stg2_discriminator import Discriminator if __name__ == "__main__": from my_utils.graph_writer import graph_writer img_size = 256 generator = Generator(img_size, 512, 8, channel_multiplier=2) # from my_utils.print_m...
sleap/nn/architectures/common.py
preeti98/sleap
156
11129802
"""Common utilities for architecture and model building.""" import attr import tensorflow as tf @attr.s(auto_attribs=True) class IntermediateFeature: """Intermediate feature tensor for use in skip connections. This class is effectively a named tuple to store the stride (resolution) metadata. Attributes...
LeafNATS/data/nli/process_minibatch_v1.py
haophancs/TREQS
149
11129809
<filename>LeafNATS/data/nli/process_minibatch_v1.py ''' @author <NAME> Please contact <EMAIL> ''' import json import re import torch from torch.autograd import Variable def process_minibatch(input_, vocab2id, premise_max_lens, hypothesis_max_lens): ''' Process mi...
Python3/1138.py
rakhi2001/ecom7
854
11129810
__________________________________________________________________________________________________ sample 24 ms submission class Solution: def alphabetBoardPath(self, target: str) -> str: code = [ord(t) - ord('a') for t in target] code = [(c // 5, c % 5) for c in code] res = "" code ...
test/test_management.py
mehrdad-shokri/QT4A
343
11129829
<filename>test/test_management.py # -*- coding: UTF-8 -*- # # Tencent is pleased to support the open source community by making QTA available. # Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved. # Licensed under the BSD 3-Clause License (the "License"); you may not use this # file except in co...
cockpit/cockpit.py
wx-b/cockpit
367
11129870
<gh_stars>100-1000 """Cockpit.""" import os from collections import defaultdict from typing import Set import json_tricks from backpack import disable from backpack.extensions.backprop_extension import BackpropExtension from cockpit import quantities from cockpit.context import BackwardCTX, get_loss from cockpit.qua...
smarts/sstudio/tests/test_generate.py
isgeles/SMARTS
554
11129871
# MIT License # # Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation th...
BitTornado/Types/addresses.py
alahoo/BitTornado
116
11129877
"""Tools for validating, parsing, and comparing network addresses. Address is an abstract class, of which IPv4 and IPv6 are subclasses, which builds on top of the socket parsing of network addresses and represents addresses directly as their integer values. IP is the direct superclass of IPv4 and IPv6, which accepts v...
engine/core/ranges.py
pianomanx/pwndora
112
11129913
<gh_stars>100-1000 from ipaddress import ip_address from loguru import logger import ipaddress import queue import random ''' Some functions to validate ip address ranges received as arguments. Detects the type of range, for example if it is CIDR and generates a queue with all the targets to send to the Threadscan obj...
python/tvm/runtime/vm.py
shreejitverma/tvm
2,084
11129927
<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 ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"...
utils/gyb.py
lwhsu/swift
3,016
11129930
<reponame>lwhsu/swift #!/usr/bin/env python # GYB: Generate Your Boilerplate (improved names welcome; at least # this one's short). See -h output for instructions from __future__ import print_function import os import re import sys try: from cStringIO import StringIO except ImportError: from io import String...
multi_script_editor/jedi/evaluate/compiled/fake.py
paulwinex/pw_multiScriptEditor
142
11129936
""" Loads functions that are mixed in to the standard library. E.g. builtins are written in C (binaries), but my autocompletion only understands Python code. By mixing in Python code, the autocompletion should work much better for builtins. """ import os import inspect from jedi._compatibility import is_py3, builtins...
checkov/terraform/checks/resource/gcp/GoogleCloudSqlDatabaseRequireSsl.py
cclauss/checkov
4,013
11129947
from checkov.common.models.enums import CheckCategories from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck class GoogleCloudSqlDatabaseRequireSsl(BaseResourceValueCheck): def __init__(self): name = "Ensure all Cloud SQL database instance requires all incoming co...
alipay/aop/api/domain/AlipayOverseasTravelGoodsSyncModel.py
antopen/alipay-sdk-python-all
213
11129962
<reponame>antopen/alipay-sdk-python-all<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.GolGoodsExtParam import GolGoodsExtParam from alipay.aop.api.domain.Amount import Amount from alipay.aop.api.domain.Amount ...