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
tests/conftest.py
timgates42/guv
120
12732799
import pytest from guv.greenio import socket from guv import listen @pytest.fixture(scope='session') def pub_addr(): """A working public address that is considered always available """ return 'gnu.org', 80 @pytest.fixture(scope='session') def fail_addr(): """An address that nothing is listening on ...
QUANTAXIS/QAWebServer/schedulehandler.py
B34nK0/QUANTAXIS
6,322
12732805
<reponame>B34nK0/QUANTAXIS import datetime import threading import pymongo from apscheduler.jobstores.mongodb import MongoDBJobStore from apscheduler.schedulers.tornado import TornadoScheduler from qaenv import mongo_ip, mongo_port from QUANTAXIS.QAWebServer.basehandles import QABaseHandler from tornado.ioloop import ...
sort/merge.py
x899/algorithms
472
12732848
""" Implementation of Merge Sort algorithm """ def merge(data): """ MergeSort is a Divide and Conquer algorithm. It divides input array in two halves, calls itself for the two halves and then merges the two sorted halves. :param array: list of elements that needs to be sorted :type array: list ...
tests/patterns/test_ParallelPattern.py
josiah-wolf-oberholtzer/supriya
191
12732882
<gh_stars>100-1000 import pytest from supriya.patterns import ( CompositeEvent, EventPattern, GroupAllocateEvent, GroupPattern, NodeFreeEvent, NoteEvent, NullEvent, ParallelPattern, SequencePattern, ) from supriya.patterns.testutils import MockUUID as M from supriya.patterns.testuti...
hail/python/hail/expr/expressions/__init__.py
tdeboer-ilmn/hail
789
12732921
<filename>hail/python/hail/expr/expressions/__init__.py from .indices import Indices, Aggregation from .base_expression import ExpressionException, Expression, impute_type, \ to_expr, cast_expr, unify_all, unify_types_limited, unify_types, \ unify_exprs from .typed_expressions import ArrayExpression, ArrayStruc...
abusehelper/bots/tailbot/tailbot.py
AbuseSA/abusehelper
117
12732923
import os import time import errno import idiokit from abusehelper.core import events, bot, utils def read(fd, amount=4096): try: data = os.read(fd, amount) except OSError as ose: if ose.args[0] != errno.EAGAIN: raise data = "" return data def try_seek(fd, offset): ...
dlnlputils/__init__.py
Rojanson/stepik-dl-nlp
120
12732947
<filename>dlnlputils/__init__.py from . import data from . import pipeline from . import visualization from . import base
experiments/training/__init__.py
selflein/manifold-flow
199
12732963
<reponame>selflein/manifold-flow from . import losses from .trainer import ForwardTrainer, ConditionalForwardTrainer, AdversarialTrainer, ConditionalAdversarialTrainer, SCANDALForwardTrainer from .alternate import AlternatingTrainer
src/python/e2e-test-runner/e2e_test_runner/main.py
inickles/grapl
313
12732981
<reponame>inickles/grapl import os import sys from pathlib import Path from grapl_common.debugger.vsc_debugger import wait_for_vsc_debugger from grapl_common.grapl_logger import get_module_grapl_logger LOGGER = get_module_grapl_logger() def main() -> None: wait_for_vsc_debugger("grapl_e2e_tests") LOGGER.in...
moya/command/sub/init.py
moyaproject/moya
129
12732988
from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import from ...command import SubCommand from ...console import Cell from ...wsgi import WSGIApplication from ... import namespaces from ... import db try: import readline except ImportError: pass c...
src/recommendationservice/client.py
gzhao408/stackdriver-sandbox
229
12732990
#!/usr/bin/python # # Copyright 2018 Google 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 ag...
baselines/ppo2_rudder/policies.py
jingweiz/baselines-rudder
281
12732992
<reponame>jingweiz/baselines-rudder<filename>baselines/ppo2_rudder/policies.py # -*- coding: utf-8 -*- """policies.py: Adaption of baselines.ppo2.policies.py for RUDDER for atari games Author -- <NAME> Contact -- <EMAIL> """ import numpy as np import tensorflow as tf from baselines.a2c.utils import conv, fc, conv_to...
recipes/irrxml/all/conanfile.py
rockandsalt/conan-center-index
562
12733009
<filename>recipes/irrxml/all/conanfile.py import os from conans import ConanFile, CMake, tools class IrrXMLConan(ConanFile): name = "irrxml" license = "ZLIB" homepage = "http://www.ambiera.com/irrxml" url = "https://github.com/conan-io/conan-center-index" description = "irrXML is a simple and fast...
posthog/migrations/0122_organization_setup_section_2_completed.py
FarazPatankar/posthog
7,409
12733017
# Generated by Django 3.0.11 on 2021-02-02 15:51 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("posthog", "0121_person_email_index"), ] operations = [ migrations.AddField( model_name="organization", name="setup_section_2_co...
Packs/SOCRadar/Integrations/SOCRadarThreatFusion/SOCRadarThreatFusion_test.py
diCagri/content
799
12733023
<gh_stars>100-1000 import json import io import pytest from CommonServerPython import DemistoException, FeedIndicatorType, CommandResults def util_load_json(path): with io.open(path, mode='r', encoding='utf-8') as f: return json.loads(f.read()) SOCRADAR_API_ENDPOINT = 'https://platform.socradar.com/api...
dino/web.py
thenetcircle/dino
150
12733036
#!/usr/bin/env python # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
release/stubs.min/Autodesk/Revit/DB/__init___parts/FilterIntegerRule.py
htlcnn/ironpython-stubs
182
12733095
<filename>release/stubs.min/Autodesk/Revit/DB/__init___parts/FilterIntegerRule.py class FilterIntegerRule(FilterNumericValueRule,IDisposable): """ A filter rule that operates on integer values in a Revit project. FilterIntegerRule(valueProvider: FilterableValueProvider,evaluator: FilterNumericRuleEvaluator...
chapter5_operations/prediction_log_pattern/src/app/routers/routers.py
sudabon/ml-system-in-actions
133
12733118
<reponame>sudabon/ml-system-in-actions<filename>chapter5_operations/prediction_log_pattern/src/app/routers/routers.py import uuid from logging import getLogger from typing import Any, Dict, List from fastapi import APIRouter, HTTPException from src.ml.data import Data from src.ml.outlier_detection import outlier_detec...
pygears/sim/modules/cosim_base.py
bogdanvuk/pygears
120
12733137
<reponame>bogdanvuk/pygears from dataclasses import dataclass from pygears.sim.sim_gear import SimGear from pygears.sim import delta, timestep, log, clk from pygears.sim.sim import SimPlugin from pygears.conf import Inject, inject from pygears import GearDone, reg from .cosim_port import CosimNoData, InCosimPort, OutCo...
shared-data/python/opentrons_shared_data/module/__init__.py
faliester/opentrons
235
12733205
<filename>shared-data/python/opentrons_shared_data/module/__init__.py """ opentrons_shared_data.module: functions and types for module defs """ import json from pathlib import Path from typing import overload, TYPE_CHECKING from ..load import load_shared_data if TYPE_CHECKING: from .dev_types import ( Sc...
pocketsphinx-5prealpha/swig/python/test/continuous_test.py
sowmyavasudeva/SmartBookmark
139
12733220
<reponame>sowmyavasudeva/SmartBookmark<gh_stars>100-1000 #!/usr/bin/python from os import environ, path from pocketsphinx.pocketsphinx import * from sphinxbase.sphinxbase import * MODELDIR = "../../../model" DATADIR = "../../../test/data" config = Decoder.default_config() config.set_string('-hmm', path.join(MODELDI...
scripts/ci/list-test-executables.py
Luthaf/lumol
147
12733223
#!/usr/bin/env python3 # -*- encoding: utf8 -*- import json import subprocess def list_executables(*command): command = list(command) command.append("--no-run") command.append("--message-format=json") result = subprocess.run(command, check=True, stdout=subprocess.PIPE) # convert successive JSON d...
examples/reflection/server.py
artificial-aidan/grpclib
754
12733241
<filename>examples/reflection/server.py<gh_stars>100-1000 import asyncio from grpclib.utils import graceful_exit from grpclib.server import Server from grpclib.reflection.service import ServerReflection from helloworld.server import Greeter async def main(*, host: str = '127.0.0.1', port: int = 50051) -> None: ...
plaso/analyzers/__init__.py
nflexfo/plaso
1,253
12733275
# -*- coding: utf-8 -*- """This file imports Python modules that register analyzers.""" from plaso.analyzers import hashing_analyzer from plaso.analyzers import yara_analyzer
tests/unit/test_app.py
paulmassen/kibitzr
478
12733297
from ..compat import mock def test_loop_aborts_without_checks(app, settings): assert app.run() == 1 def test_main_executes_all_checks_before_loop(app, settings): with mock.patch.object(app, "check_forever", side_effect=app.on_interrupt) as the_loop: settings.checks.append({ 'name': 'A', ...
aw_nas/btcs/layer2/controller.py
Harald-R/aw_nas
195
12733364
""" 2-layer controller. """ from aw_nas import utils, assert_rollout_type from aw_nas.utils import DistributedDataParallel from aw_nas.controller.base import BaseController from aw_nas.btcs.layer2.search_space import ( Layer2Rollout, Layer2DiffRollout, DenseMicroRollout, DenseMicroDiffRollout, Stag...
tg/configuration/mongo/auth.py
sergiobrr/tg2
812
12733392
<gh_stars>100-1000 # -*- coding: utf-8 -*- from tgming.auth import MingAuthenticatorPlugin def create_default_authenticator(user_class, translations=None, **unused): mingauth = MingAuthenticatorPlugin(user_class) return unused, mingauth
tools/polly/bin/detail/timer.py
Kondr11/LABA7
861
12733414
<reponame>Kondr11/LABA7 # Copyright (c) 2015, <NAME> # All rights reserved. import datetime import sys import time perf_counter_available = (sys.version_info.minor >= 3) class Job: def __init__(self, job_name): if perf_counter_available: self.start = time.perf_counter() else: self.start = 0 ...
h2o-py/tests/testdir_algos/glm/pyunit_PUBDEV_8077_binomial_alpha.py
MikolajBak/h2o-3
6,098
12733417
<reponame>MikolajBak/h2o-3 #!/usr/bin/env python # -*- encoding: utf-8 -*- import h2o from h2o.estimators.glm import H2OGeneralizedLinearEstimator from tests import pyunit_utils # test binomial family with generate_scoring_history on, alpha arrays, lambda search on and off def test_binomial_alpha(): training_data ...
hiddeneye_reborn/core/config.py
Devil4333/HiddenEye
582
12733446
import yaml # TODO u know, work in it...
quspin/basis/_reshape_subsys.py
anton-buyskikh/QuSpin
195
12733449
import numpy as _np import scipy.sparse as _sp from ._basis_utils import _shuffle_sites #################################################### # set of helper functions to implement the partial # # trace of lattice density matrices. They do not # # have any checks and states are assumed to be # # in the non-sym...
src/peering/azext_peering/generated/custom.py
Mannan2812/azure-cli-extensions
207
12733459
<gh_stars>100-1000 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Chan...
pydantic_factories/constraints/constrained_float_handler.py
lyz-code/pydantic-factories
163
12733547
from pydantic import ConstrainedFloat from pydantic_factories.value_generators.constrained_number import ( generate_constrained_number, get_constrained_number_range, ) from pydantic_factories.value_generators.primitives import create_random_float def handle_constrained_float(field: ConstrainedFloat) -> float...
plenum/test/plugin/conftest.py
andkononykhin/plenum
148
12733588
OPERATION_VALIDATION_PLUGIN_PATH_VALUE = "operation_verification" AUCTION_REQ_VALIDATION_PLUGIN_PATH_VALUE = "auction_req_validation" AUCTION_REQ_PROCESSOR_PLUGIN_PATH_VALUE = "auction_req_processor" BANK_REQ_VALIDATION_PLUGIN_PATH_VALUE = "bank_req_validation" BANK_REQ_PROCESSOR_PLUGIN_PATH_VALUE = "bank_req_processor...
String/1417. Reformat The String.py
beckswu/Leetcode
138
12733612
class Solution: def reformat(self, s: str) -> str: str_list = [] digit_list = [] for i in s: if i.isdigit(): digit_list += i, elif i.isalpha(): str_list += i, if abs( len(str_list) - len(digit_list)) > 1: return "" ...
tests/unit/compiler/__init__.py
gamechanger/dusty
421
12733618
import os from pkg_resources import resource_isdir, resource_listdir, resource_string import yaml from nose.tools import nottest from dusty.compiler.spec_assembler import get_specs_from_path @nottest def get_all_test_configs(): return resource_listdir(__name__, 'test_configs') @nottest def resources_for_test_co...
plydata/tidy/__init__.py
has2k1/plydata
247
12733630
from .tidy_verbs import * # noqa from .. import _get_all_imports __all__ = _get_all_imports(globals())
src/collector/wechat/feddd_start.py
showthesunli/liuli
139
12733679
""" Created by leeorz. Description: 采集器: - 基于 src/collector/wechat_sougou/items/wechat_item.py的公众号采集 - 基于 feedparser,从feeddd解析rss Changelog: all notable changes to this file will be documented """ import asyncio import feedparser from ruia import Response, Spider from ruia_ua import mi...
ai/models/detectron2/_functional/checkpointer.py
MattSkiff/aerial_wildlife_detection
166
12733699
<filename>ai/models/detectron2/_functional/checkpointer.py ''' Subclass of Detectron2's Checkpointer, able to load model states from an in-memory Python dict according to states as saved in AIDE. 2020-21 <NAME> ''' from detectron2.checkpoint import DetectionCheckpointer from typing import List, Option...
util/security/crypto.py
giuseppe/quay
2,027
12733755
<filename>util/security/crypto.py import base64 from cryptography.fernet import Fernet, InvalidToken def encrypt_string(string, key): """ Encrypts a string with the specified key. The key must be 32 raw bytes. """ f = Fernet(key) # Fernet() works only on byte objects. Convert the string to ...
tools/traffic_annotation/scripts/traffic_annotation_auditor_tests.py
zipated/src
2,151
12733763
<reponame>zipated/src<filename>tools/traffic_annotation/scripts/traffic_annotation_auditor_tests.py #!/usr/bin/env python # 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. """Runs tests to ensure annotation ...
setup.py
bcicen/docker-replay
191
12733775
from setuptools import setup exec(open('docker_replay/version.py').read()) setup(name='docker-replay', version=version, packages=['docker_replay'], description='Generate docker run commands from running containers', author='<NAME>', author_email='<EMAIL>', url='https://github.com/b...
menpo_functions.py
konatasick/face-of-art
220
12733777
<gh_stars>100-1000 import os from scipy.io import loadmat from menpo.shape.pointcloud import PointCloud from menpo.transform import ThinPlateSplines import menpo.transform as mt import menpo.io as mio from glob import glob from deformation_functions import * # landmark indices by facial feature jaw_indices = np.arang...
heraspy/events.py
new-coast-ventures/hc-ai-hera
368
12733802
<reponame>new-coast-ventures/hc-ai-hera<gh_stars>100-1000 TRAIN_BEGIN = 'TRAIN_BEGIN' TRAIN_END = 'TRAIN_END' EPOCH_BEGIN = 'EPOCH_BEGIN' EPOCH_END = 'EPOCH_END' BATCH_BEGIN = 'BATCH_BEGIN' BATCH_END = 'BATCH_END'
tests/test_context.py
Hirni-Meshram5/moderngl
916
12733819
from unittest import TestCase import moderngl import numpy import platform class ContextTests(TestCase): def test_create_destroy(self): """Create and destroy a context""" for _ in range(25): ctx = moderngl.create_context(standalone=True) ctx.release() def test_context...
scripts/artifacts/appGrouplisting.py
xperylabhub/iLEAPP
325
12733834
<filename>scripts/artifacts/appGrouplisting.py import biplist import pathlib import plistlib import sys from scripts.artifact_report import ArtifactHtmlReport from scripts.ilapfuncs import logfunc, tsv, is_platform_windows def get_appGrouplisting(files_found, report_folder, seeker): data_list = [] for...
src/python/loadGraph.py
neoremind/luceneutil
164
12733837
#!/usr/bin/env python # 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 "Lice...
x2paddle/project_convertor/pytorch/torch2paddle/__init__.py
usertianqin/X2Paddle
559
12733853
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
amazon-ml-hyperparameter-optimization/fold.py
meghanaravikumar/sigopt-examples
213
12733871
#!/usr/bin/env python # Amazon Machine Learning Samples # Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Amazon Software License (the "License"). You may not use # this file except in compliance with the License. A copy of the License is # located at # # http://aws.am...
Home Automation/Part 5/homeSecPi.py
NAzT/ESP8266
101
12733905
<reponame>NAzT/ESP8266 #!/usr/bin/python import sys import os import paho.mqtt.client as mqtt import smtplib import string #var to track the current status of the system (armed or disarmed) securityEnStatus = None #enable/disable email notifications - disable when testing/enable when in normal use sendEmail = False ...
functions/setting/artificial_generation_setting.py
hsokooti/RegNet
187
12733945
<filename>functions/setting/artificial_generation_setting.py<gh_stars>100-1000 import copy def load_deform_exp_setting(selected_deform_exp): def_setting = dict() if selected_deform_exp == '3D_max20_D14': def_setting = dict() def_setting['MaxDeform'] = 20 # The maximum amplitude of deformation...
codigo/Live54/exemplo_1.py
cassiasamp/live-de-python
572
12733952
<gh_stars>100-1000 from concurrent.futures import ThreadPoolExecutor from concurrent.futures import ProcessPoolExecutor from requests import get from functools import partial from os import getpid l_urls = ['https://google.com'] * 6 # executor = ThreadPoolExecutor(max_workers=3) # result = executor.map(get, l_urls) #...
mmflow/models/flow_estimators/liteflownet.py
hologerry/mmflow
481
12733957
# Copyright (c) OpenMMLab. All rights reserved. from typing import Dict, Optional, Sequence, Tuple from numpy import ndarray from torch import Tensor from ..builder import FLOW_ESTIMATORS from .pwcnet import PWCNet @FLOW_ESTIMATORS.register_module() class LiteFlowNet(PWCNet): """LiteFlowNet model.""" def _...
zoo/policies/cross-rl-agent/cross_rl_agent/train/utils.py
idsc-frazzoli/SMARTS
554
12734045
# Copyright (C) 2020. 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 the rights # to us...
recipes/Python/473881_splitandjoinpy/recipe-473881.py
tdiprima/code
2,023
12734048
<gh_stars>1000+ import os # give access to os.path & os.remove import md5 # allows md5.md5(arg).digest() for file signature import time # gives access to time.sleep import random # gives access to random.randrange import thread # to start new threads import cPi...
tests/integration_tests/colors.py
trailofbits/mcsema
1,301
12734053
# Copyright (c) 2020 Trail of Bits, Inc. # # 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 Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is di...
typed_python/compiler/type_wrappers/compiler_introspection_wrappers.py
APrioriInvestments/typed_python
105
12734097
# Copyright 2017-2019 typed_python 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...
glazier/lib/terminator.py
ItsMattL/glazier
1,233
12734110
<reponame>ItsMattL/glazier # Lint as: python3 # Copyright 2021 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...
setup.py
cbalfour/python-qrcode
2,651
12734133
<filename>setup.py #!/usr/bin/env python from setuptools import setup # See setup.cfg for configuration. setup( data_files=[('share/man/man1', ['doc/qr.1'])], )
tests/functional/test_cisco_iosxe.py
verbosemode/scrapli
404
12734140
<reponame>verbosemode/scrapli<gh_stars>100-1000 def test_non_standard_default_desired_privilege_level(iosxe_conn): # purpose of this test is to ensure that when a user sets a non-standard default desired priv # level, that there is nothing in genericdriver/networkdriver that will prevent that from # actuall...
mozi/cost.py
hycis/Mozi
122
12734156
import theano.tensor as T import theano from mozi.utils.utils import theano_unique from mozi.utils.theano_utils import asfloatX floatX = theano.config.floatX if floatX == 'float64': epsilon = 1.0e-8 else: epsilon = 1.0e-6 def accuracy(y, y_pred): L = T.eq(y_pred.argmax(axis=1), y.argmax(axis=1)) ret...
phasing/utils/plotPhaseCount.py
ArthurDondi/cDNA_Cupcake
205
12734157
# -*- coding: utf-8 -*- """ Created on Thu Dec 17 13:14:28 2020 @author: derek.bickhart-adm """ import matplotlib from matplotlib import pyplot as plt matplotlib.use('Agg') from matplotlib.collections import BrokenBarHCollection from matplotlib import cm from itertools import cycle from collections import defaultdict...
octodns/processor/awsacm.py
h3rj4n/octodns
369
12734167
<filename>octodns/processor/awsacm.py<gh_stars>100-1000 # # Ignores AWS ACM validation CNAME records. # from __future__ import absolute_import, division, print_function, \ unicode_literals from logging import getLogger from .base import BaseProcessor class AwsAcmMangingProcessor(BaseProcessor): ''' pro...
test_pyspin.py
crunchex/py-spin
196
12734187
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- import time from pyspin import spin def test_spinner(): spinner = spin.Spinner(spin.Spin9) assert spinner.length == 4 assert spinner.frames == spin.Spin9 assert spinner.current() == u'←' assert spinner.next() == u'←' assert s...
semseg/__init__.py
Genevievekim/semantic-segmentation-1
196
12734204
<gh_stars>100-1000 from tabulate import tabulate from semseg import models from semseg import datasets from semseg.models import backbones, heads def show_models(): model_names = models.__all__ numbers = list(range(1, len(model_names)+1)) print(tabulate({'No.': numbers, 'Model Names': model_names}, header...
scripts/elasticsearch/search-reindex.py
ZMaratovna/cloud-pipeline
126
12734214
<gh_stars>100-1000 # Copyright 2017-2020 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/LICENSE-2.0 # # Unles...
skmultilearn/ext/__init__.py
emrecncelik/scikit-multilearn
763
12734255
""" The :mod:`skmultilearn.ext` provides wrappers for other multi-label classification libraries. Currently it provides a wrapper for: Currently the available classes include: +--------------------------------------------+------------------------------------------------------------------+ | Name ...
alipay/aop/api/domain/CloudbusStop.py
antopen/alipay-sdk-python-all
213
12734267
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class CloudbusStop(object): def __init__(self): self._latitude = None self._longitude = None self._station_id = None self._station_name = None self._station_num ...
reid/trainers.py
nuannuanhcc/DomainAdaptiveReID
200
12734273
<filename>reid/trainers.py from __future__ import print_function, absolute_import import time import torch from torch.autograd import Variable from .evaluation_metrics import accuracy from .loss import OIMLoss, TripletLoss from .utils.meters import AverageMeter class BaseTrainer(object): def __init__(self, mode...
saleor/order/migrations/0043_auto_20180322_0655.py
elwoodxblues/saleor
15,337
12734324
<gh_stars>1000+ # Generated by Django 2.0.3 on 2018-03-22 11:55 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("order", "0042_auto_20180227_0436")] operations = [ migrations.AlterModelOptions( name="order", options={ ...
moonlight/training/clustering/staffline_patches_dofn.py
lithomas1/moonlight
288
12734348
# Copyright 2018 Google 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Lib/parallel/test/thread_scratch.py
pyparallel/pyparallel
652
12734396
<filename>Lib/parallel/test/thread_scratch.py import ujson import parallel import datetime from parallel import ( timer, thread, gmtime, sys_stats, socket_stats, memory_stats, context_stats, thread_seq_id, ) from parallel.http.server import ( quote_html, text_response, h...
examples/grating_two_level/grating_coupler_2D_apodized.py
jbellevi/lumopt
101
12734421
<reponame>jbellevi/lumopt """ Copyright (c) 2019 Lumerical Inc. """ ######## IMPORTS ######## # General purpose imports import os import numpy as np import scipy as sp # Optimization specific imports from lumopt.utilities.load_lumerical_scripts import load_from_lsf from lumopt.utilities.wavelengths import Wavelen...
shopyo/shopyoapi/assets.py
Bnseamster/shopyo
235
12734425
<reponame>Bnseamster/shopyo from flask import url_for from flask import current_app def get_static(boxormodule, filename): if current_app.config["DEBUG"] == True: return url_for("devstatic", boxormodule=boxormodule, filename=filename) else: return url_for( "static", filename="modul...
Code/KafkaProducer.py
dong-yf/100-Days-Of-ML-Code
17,496
12734462
#!/usr/bin/python from kafka import KafkaProducer kafkaHosts=["kafka01.paas.longfor.sit:9092" ,"kafka02.paas.longfor.sit:9092" ,"kafka03.paas.longfor.sit:9092"] producer = KafkaProducer(bootstrap_servers=kafkaHosts); for _ in range(20): producer.send("testapplog_plm-prototype",b"Hello......
pretrain/pri3d/main.py
kudo1026/Pri3D
103
12734476
<reponame>kudo1026/Pri3D #!/usr/bin/env python3 import hydra import os from common.distributed import multi_proc_run def single_proc_run(config): from common.pretrain import Pretrain #dir_path = os.path.dirname(os.path.realpath(__file__)) trainer = Pretrain(config) trainer.train() @hydra.main(config_path='co...
backend/apps/marquees/admin.py
FroggyTaipei/froggy-service
174
12734486
from django.contrib import admin from django.forms import TextInput, ModelForm from suit.admin import SortableModelAdmin from .models import MarqueeMessage class MarqueeMessageForm(ModelForm): class Meta: widgets = { 'message': TextInput(attrs={'class': 'input-xxlarge'}), } class Mar...
config/base_station/gs_gps.py
leozz37/makani
1,178
12734514
# Copyright 2020 Makani Technologies 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 to...
options/test_options.py
Yijunmaverick/Im2Pencil
176
12734532
<filename>options/test_options.py<gh_stars>100-1000 from .base_options import BaseOptions class TestOptions(BaseOptions): def initialize(self): BaseOptions.initialize(self) self.parser.add_argument('--results_dir', type=str, default='./results/', help='saves results here.') self.parser.add...
fewshot/configs/cnn_config_pb2.py
renmengye/inc-few-shot-attractor-public
122
12734545
<reponame>renmengye/inc-few-shot-attractor-public # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: fewshot/configs/cnn_config.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor fro...
xknx/telegram/__init__.py
iligiddi/xknx
179
12734565
<gh_stars>100-1000 """ Module for handling KNX primitves. * KNX Addresses * KNX Telegrams """ # flake8: noqa from .address import GroupAddress, GroupAddressType, IndividualAddress from .address_filter import AddressFilter from .telegram import Telegram, TelegramDirection __all__ = [ "AddressFilter", "GroupAd...
resources/lib/ambilight_controller.py
metbosch/script.kodi.http.ambilight
172
12734571
import lights from tools import xbmclog class AmbilightController(lights.Controller): def __init__(self, *args, **kwargs): super(AmbilightController, self).__init__(*args, **kwargs) def on_playback_start(self): if self.settings.ambilight_start_dim_enable: self.save_state_as_initia...
gobigger/agents/__init__.py
luanshaotong/GoBigger
189
12734649
from .base_agent import BaseAgent from .bot_agent import BotAgent
integration_test/test_m_flag.py
robintw/recipy
451
12734659
""" Tests of 'python -m recipy' usage. This script uses a Python script (run_numpy_no_recipy.py) about which the following assumptions are made: * Co-located with this test script, in the same directory. * Expects two arguments via the command-line: an input file name and an output file name. * Reads the input file...
source/test_proxe_s2.py
jiyeonkim127/PSI
138
12734681
<gh_stars>100-1000 from __future__ import absolute_import from __future__ import print_function from __future__ import division import sys, os, glob import json import argparse import numpy as np import open3d as o3d import pickle import torch import torch.nn as nn import torch.nn.functional as F from torch.nn impor...
NAS-Models/lib/models/nas_net.py
zhangting2020/AutoDL
155
12734691
import paddle import paddle.fluid as fluid from .operations import OPS def AuxiliaryHeadCIFAR(inputs, C, class_num): print('AuxiliaryHeadCIFAR : inputs-shape : {:}'.format(inputs.shape)) temp = fluid.layers.relu(inputs) temp = fluid.layers.pool2d( temp, pool_size=5, pool_stride=3, pool_padding=0, ...
tests/test_statistics.py
MORE-EU/matrixprofile
262
12734720
<reponame>MORE-EU/matrixprofile<filename>tests/test_statistics.py #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals range = getattr(__builtins__, 'xrange', range) # end of py...
combinations/solution.py
mahimadubey/leetcode-python
528
12734723
""" Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example, If n = 4 and k = 2, a solution is: [ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4], ] """ class Solution(object): def combine(self, n, k): """ :type n: int :type k: int ...
tests/syntax/unmatched_closing_bracket_2.py
matan-h/friendly
287
12734771
<filename>tests/syntax/unmatched_closing_bracket_2.py """Should raise SyntaxError: invalid syntax""" x = (1, 2, 3]
bumpversion/__main__.py
jaap3/bump2version
1,289
12734803
<filename>bumpversion/__main__.py<gh_stars>1000+ __import__('bumpversion').main()
release/scripts/presets/framerate/50.py
rbabari/blender
365
12734815
import bpy bpy.context.scene.render.fps = 50 bpy.context.scene.render.fps_base = 1
ci/bootstrap_dockerignore.py
decentral1se/purerpc
143
12734843
#! /usr/bin/env python import os def main(): if os.path.exists(".dockerignore"): print(".dockerignore already exists, remove it to proceed") exit(-1) with open(".gitignore", "r") as fin, open(".dockerignore", "w") as fout: fout.write("# This file was automatically generated by ./ci/boot...
src/python/e2e-test-runner/e2e_test_runner/test_web_auth.py
inickles/grapl
313
12734863
""" TODO (wimax July 2020): I don't see anything in here that indicates that screams "e2e test", this certainly seems like more of an integration test. There's nothing here that does anything cross-service. Perhaps it's just "does it work in AWS?" """ from grapl_tests_common.clients.grapl_web_client import GraplWebCli...
scripts/data/kitti_extract_ground_plane.py
wuzzh/master_thesis_code
206
12734928
""" Script for extracting the ground plane from the KITTI dataset. We need to determine the ground plane position and orientation in order to be able to reconstruct points on it, which we are trying to detect. We will collect all the points on the ground plane from the dataset and then fit a plane to them with RANSAC...
corehq/ex-submodules/fluff/exceptions.py
dimagilg/commcare-hq
471
12734932
<reponame>dimagilg/commcare-hq class EmitterTypeError(Exception): pass class EmitterValidationError(Exception): pass
.modules/.CMSeeK/cmseekdb/header.py
termux-one/EasY_HaCk
1,103
12734975
<gh_stars>1000+ #!/usr/bin/python3 # -*- coding: utf-8 -*- # This is a part of CMSeeK, check the LICENSE file for more information # Copyright (c) 2018 Tuhinshubhra # This file contains all the methods of detecting cms via http Headers # Version: 1.0.0 # Return a list with ['1'/'0','ID of CMS'/'na'] 1 = detected 0 = no...
src/encoded/tests/test_upgrade_atac_alignment_enrichment_quality_metric.py
procha2/encoded
102
12735006
def test_upgrade_atac_alignment_enrichment_quality_metric_1_2( upgrader, atac_alignment_enrichment_quality_metric_1 ): value = upgrader.upgrade( 'atac_alignment_enrichment_quality_metric', atac_alignment_enrichment_quality_metric_1, current_version='1', target_version='2', ) ...
examples/i18nurls/__init__.py
adityavs/werkzeug
4,200
12735014
from .application import Application as make_app
2020/06/24/How to Create a Celery Task Progress Bar in Django/djangoprogressbar/progress/example/tasks.py
kenjitagawa/youtube_video_code
492
12735028
from celery import shared_task from celery_progress.backend import ProgressRecorder from time import sleep @shared_task(bind=True) def go_to_sleep(self, duration): progress_recorder = ProgressRecorder(self) for i in range(100): sleep(duration) progress_recorder.set_progress(i + 1, 100, f'On it...
tests/test_day_periods.py
PLSV/babel
5,079
12735031
# -- encoding: UTF-8 -- from datetime import time import babel.dates as dates import pytest @pytest.mark.parametrize("locale, time, expected_period_id", [ ("de", time(7, 42), "morning1"), # (from, before) ("de", time(3, 11), "night1"), # (after, before) ("fi", time(0), "midnight"), # (at) ("en_US"...