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
DQM/EcalMonitorClient/python/TimingClient_cfi.py
ckamtsikis/cmssw
852
12758949
<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms from DQM.EcalMonitorTasks.TimingTask_cfi import ecalTimingTask from DQM.EcalMonitorClient.IntegrityClient_cfi import ecalIntegrityClient minChannelEntries = 1 minTowerEntries = 3 toleranceMean = 2. toleranceRMS = 6. minChannelEntriesFwd = 8 minTowerEntriesFw...
test/gallery/auction/testAuction.py
jeanqasaur/jeeves
253
12758983
import macropy.activate import JeevesLib from smt.Z3 import * import unittest from Auction import AuctionContext, Bid, User import JeevesLib class TestAuction(unittest.TestCase): def setUp(self): JeevesLib.init() self.aliceUser = User(0) self.bobUser = User(1) self.claireUser = User(2) def testOwn...
client/verta/verta/integrations/__init__.py
fool-sec-review/modeldb
835
12758985
<filename>client/verta/verta/integrations/__init__.py """Automated logging support for common scientific libraries."""
leo/external/leoftsindex.py
ATikhonov2/leo-editor
1,550
12759022
""" Stand alone GUI free index builder for Leo's full text search system:: python leoftsindex.py <file1> <file2> <file3>... If the file name starts with @ it's a assumed to be a simple text file listing files to be indexed. If <file> does not contain '#' it's assumed to be a .leo file to index, and is indexed. If...
bsuite/bsuite/utils/wrappers_test.py
hbutsuak95/iv_rl
1,337
12759058
<reponame>hbutsuak95/iv_rl # python3 # pylint: disable=g-bad-file-header # Copyright 2019 DeepMind Technologies Limited. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at #...
Security/02 - Terminology and Concepts/02 - Security Key Spaces.py
srgeyK87/Hacker-Rank-30-days-challlenge
275
12759122
<filename>Security/02 - Terminology and Concepts/02 - Security Key Spaces.py<gh_stars>100-1000 # ======================== # Information # ======================== # Direct Link: https://www.hackerrank.com/challenges/security-key-spaces/problem # Difficulty: Easy # Max Score: 10 # Language: Python # ============...
src/other/ext/stepcode/misc/wiki-scripts/update-matrix.py
dservin/brlcad
262
12759128
<gh_stars>100-1000 #!/usr/bin/env python #you probably want to run the ctest script that calls this instead: # ctest -S ctest_matrix.cmake #must be ran from scl/build_matrix from __future__ import print_function from xml.etree import ElementTree as ET import os from datetime import date import subprocess import code...
gluon/gluoncv2/models/shakedropresnet_cifar.py
naviocean/imgclsmob
2,649
12759165
""" ShakeDrop-ResNet for CIFAR/SVHN, implemented in Gluon. Original paper: 'ShakeDrop Regularization for Deep Residual Learning,' https://arxiv.org/abs/1802.02375. """ __all__ = ['CIFARShakeDropResNet', 'shakedropresnet20_cifar10', 'shakedropresnet20_cifar100', 'shakedropresnet20_svhn'] import os import numpy...
x509_pki/migrations/0010_auto_20211017_0936.py
repleo/bounca
142
12759171
# Generated by Django 3.2.7 on 2021-10-17 07:36 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('x509_pki', '0009_auto_20211017_0921'), ] operations = [ migrations.RemoveField( model_name='key...
src/oci/log_analytics/models/log_analytics_em_bridge_summary_report.py
Manny27nyc/oci-python-sdk
249
12759182
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
nextgen/bcbio/distributed/lsf.py
bgruening/bcbb
339
12759199
<gh_stars>100-1000 """Commandline interaction with LSF schedulers. """ import re import subprocess _jobid_pat = re.compile("Job <(?P<jobid>\d+)> is") def submit_job(scheduler_args, command): """Submit a job to the scheduler, returning the supplied job ID. """ cl = ["bsub"] + scheduler_args + command s...
pronto/xref.py
flying-sheep/pronto
182
12759205
"""Cross-reference object definition. """ import typing import fastobo from .utils.meta import roundrepr, typechecked __all__ = ["Xref"] @roundrepr class Xref(object): """A cross-reference to another document or resource. Cross-references (xrefs for short) can be used to back-up definitions of entit...
blesuite/connection_manager.py
decidedlygray/BLESuite
198
12759208
from blesuite.pybt.roles import LECentral, LEPeripheral from blesuite.pybt.core import Connection from blesuite.pybt.gatt import UUID, AttributeDatabase, Server from blesuite.pybt.gap import GAP from blesuite.gatt_procedures import gatt_procedure_write_handle, gatt_procedure_write_handle_async, \ ...
indy_node/test/upgrade/test_forced_upgrade_if_request_received_after_propagate.py
Rob-S/indy-node
627
12759228
from indy_node.server.upgrade_log import UpgradeLog from indy_node.test import waits from indy_node.test.upgrade.helper import checkUpgradeScheduled, sdk_ensure_upgrade_sent from plenum.common.constants import VERSION from plenum.common.messages.node_messages import Propagate from plenum.common.request import Request f...
src/python/nimbusml/examples/WordTokenizer.py
montehoover/NimbusML
134
12759240
############################################################################### # WordTokenizer from nimbusml import Pipeline, FileDataStream from nimbusml.datasets import get_dataset from nimbusml.preprocessing.text import WordTokenizer # data input (as a FileDataStream) path = get_dataset("wiki_detox_train").as_fi...
redbot/webui/captcha.py
gusdleon/redbot
167
12759294
import hmac from http import cookies import json from typing import Callable, TYPE_CHECKING from urllib.parse import urlencode import thor from thor.http import HttpClient, get_header from thor.http.error import HttpError from redbot.resource import HttpResource from redbot.type import RawHeaderListType token_client...
service-workers/service-worker/resources/update-fetch-worker.py
meyerweb/wpt
14,668
12759308
<reponame>meyerweb/wpt import random import time def main(request, response): # no-cache itself to ensure the user agent finds a new version for each update. headers = [(b'Cache-Control', b'no-cache, must-revalidate'), (b'Pragma', b'no-cache')] content_type = b'' extra_body = u'' c...
notebooks/thunderdome/eth2spec/test/phase0/epoch_processing/test_process_historical_roots_update.py
casparschwa/beaconrunner
2,161
12759310
from eth2spec.test.context import spec_state_test, with_all_phases from eth2spec.test.helpers.epoch_processing import ( run_epoch_processing_with ) def run_process_historical_roots_update(spec, state): yield from run_epoch_processing_with(spec, state, 'process_historical_roots_update') @with_all_phases @spe...
src/python/nimbusml/internal/entrypoints/transforms_columnselector.py
michaelgsharp/NimbusML
134
12759320
<reponame>michaelgsharp/NimbusML<gh_stars>100-1000 # - Generated by tools/entrypoint_compiler.py: do not edit by hand """ Transforms.ColumnSelector """ from ..utils.entrypoints import EntryPoint from ..utils.utils import try_set, unlist def transforms_columnselector( data, output_data=None, ...
var/spack/repos/builtin/packages/orfm/package.py
kkauder/spack
2,360
12759322
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Orfm(AutotoolsPackage): """A simple and not slow open reading frame (ORF) caller. No bells...
pypeln/task/api/concat_task_test.py
quarckster/pypeln
1,281
12759335
<gh_stars>1000+ import sys import time import typing as tp from unittest import TestCase import hypothesis as hp from hypothesis import strategies as st import pypeln as pl MAX_EXAMPLES = 10 T = tp.TypeVar("T") @hp.given(nums=st.lists(st.integers())) @hp.settings(max_examples=MAX_EXAMPLES) def test_concat_basic(nu...
tests/import/gen_context.py
learnforpractice/micropython-cpp
692
12759349
<gh_stars>100-1000 import gen_context2 GLOBAL = "GLOBAL" def gen(): print(GLOBAL) yield 1 gen_context2.call(gen())
preprocess/snips_preprocess.py
OlegJakushkin/s3prl
856
12759406
from random import shuffle import os from glob import glob import shutil import re import tqdm from multiprocessing import Pool from normalise import normalise months = {'jan.': 'January', 'feb.': 'February', 'mar.': 'March', 'apr.': 'April', 'may': 'May', 'jun.': 'June', 'jul.': 'July', 'aug.': 'August', 'sep.': 'S...
intake/cli/client/subcommands/drivers.py
mattkram/intake
149
12759416
<reponame>mattkram/intake #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2018, Anaconda, Inc. and Intake contributors # All rights reserved. # # The full license is in the LICENSE file, distributed with this software. #----------------------------------------------...
crestify/archivers/__init__.py
punto1/crestify
214
12759438
<reponame>punto1/crestify<gh_stars>100-1000 from archive_service import ArchiveService, ArchiveException from archiveorg import ArchiveOrgService from archivetoday import ArchiveTodayService
omaha_server/crash/tests/test_serializers.py
makar21/omaha-server
142
12759459
<reponame>makar21/omaha-server # coding: utf8 """ This software is licensed under the Apache 2 license, quoted below. Copyright 2014 Crystalnix Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License...
Hackerearth/The_minionGame.py
Shaswat-2203/HacktoberfestForBeginners
115
12759462
def minion_game(string): length = len(string) the_vowel = "AEIOU" kevin = 0 stuart = 0 for i in range(length): if string[i] in the_vowel: kevin = kevin + length - i else: stuart = stuart + length - i if kevin > stuart: print ("Kevin %d" % kevi...
Chapter03/Arista/eapi_1.py
stavsta/Mastering-Python-Networking-Second-Edition
107
12759476
<filename>Chapter03/Arista/eapi_1.py #!/usr/bin/python2 from __future__ import print_function from jsonrpclib import Server import ssl ssl._create_default_https_context = ssl._create_unverified_context switch = Server("https://admin:arista@192.168.199.158/command-api") response = switch.runCmds( 1, [ "show versio...
nn/clipping.py
awesome-archive/sentence-space
211
12759489
<gh_stars>100-1000 import theano.tensor as T class MaxNorm(object): def __init__(self, max_norm=5): self.max_norm = max_norm def __call__(self, grads): norm = T.sqrt(sum([T.sum(g ** 2) for g in grads])) return [self.clip_norm(g, self.max_norm, norm) for g in grads] def clip_norm...
onegram/exceptions.py
pauloromeira/onegram
150
12759491
<filename>onegram/exceptions.py class OnegramException(Exception): pass # TODO [romeira]: Login exceptions {06/03/18 23:07} class AuthException(OnegramException): pass class AuthFailed(AuthException): pass class AuthUserError(AuthException): pass class NotSupportedError(OnegramException): pass ...
unicode/servers/test_ucd.py
fluentpython/concurrency
102
12759500
import itertools import ucd ABC_LINES = ''' 0040;COMMERCIAL AT;Po;0;ON;;;;;N;;;;; 0041;LATIN CAPITAL LETTER A;Lu;0;L;;;;;N;;;;0061; 0042;LATIN CAPITAL LETTER B;Lu;0;L;;;;;N;;;;0062; 0043;LATIN CAPITAL LETTER C;Lu;0;L;;;;;N;;;;0063; '''.strip() def test_parse_line(): line_A = '0041;LATIN CAPITAL LETTER A;Lu;0;L;...
clickhouse_driver/dbapi/cursor.py
1024inc/clickhouse-driver
823
12759504
from collections import namedtuple from itertools import islice from ..errors import Error as DriverError from .errors import InterfaceError, OperationalError, ProgrammingError Column = namedtuple( 'Column', 'name type_code display_size internal_size precision scale null_ok' ) class Cursor(object): cl...
pythonFiles/tests/testing_tools/adapter/.data/complex/mod.py
AlbertDeFusco/vscode-python
2,461
12759570
<reponame>AlbertDeFusco/vscode-python """ Examples: >>> square(1) 1 >>> square(2) 4 >>> square(3) 9 >>> spam = Spam() >>> spam.eggs() 42 """ def square(x): """ Examples: >>> square(1) 1 >>> square(2) 4 >>> square(3) 9 """ return x * x class Spam(object): """ Exam...
python/ray/tune/integration/docker.py
mkucijan/ray
21,382
12759574
<filename>python/ray/tune/integration/docker.py<gh_stars>1000+ import logging import os from typing import Optional, Tuple, List from ray.autoscaler.sdk import rsync, configure_logging from ray.util import get_node_ip_address from ray.util.debug import log_once from ray.tune.syncer import NodeSyncer from ray.tune.sync...
objectModel/Python/tests/cdm/projection/test_projection_object_model.py
jocubeit/CDM
265
12759635
<filename>objectModel/Python/tests/cdm/projection/test_projection_object_model.py # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. import os import unittest from cdm.enums import CdmObjectType from cdm.enums.cdm_...
kafka_utils/kafka_rolling_restart/task.py
dbgrigsby/kafka-utils
302
12759637
<gh_stars>100-1000 # -*- 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 # # Unless required by...
tests/unit/core/metrics/test_regression_metrics.py
cswarth/whylogs
603
12759681
import os import pandas as pd import pytest from whylogs.core.metrics.regression_metrics import RegressionMetrics from whylogs.proto import RegressionMetricsMessage TEST_DATA_PATH = os.path.abspath( os.path.join( os.path.realpath(os.path.dirname(__file__)), os.pardir, os.pardir, o...
html_parsing/get_population_from_wikidata.py
DazEB2/SimplePyScripts
117
12759719
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' import requests from bs4 import BeautifulSoup def get_populations(url: str) -> dict: rs = requests.get(url) root = BeautifulSoup(rs.content, 'html.parser') # P1082 -- идентификатор для population population_node = root.select_o...
Algorithms/Searching & Sorting/Fibonacii Search/fibinacci_search.py
strangestroad/interview-techdev-guide
320
12759748
<reponame>strangestroad/interview-techdev-guide def FibonacciSearch(arr, key): fib2 = 0 fib1 = 1 fib = fib1 + fib2 while (fib < len(arr)): fib2 = fib1 fib1 = fib fib = fib1 + fib2 index = -1 while (fib > 1): i = min(index + fib2, (len(arr)-1)) if (arr[i] <...
materials/make_induced_graph.py
lavig17/Knowledge-Graph-Image
189
12759759
<reponame>lavig17/Knowledge-Graph-Image import argparse import json from nltk.corpus import wordnet as wn import torch from glove import GloVe def getnode(x): return wn.synset_from_pos_and_offset('n', int(x[1:])) def getwnid(u): s = str(u.offset()) return 'n' + (8 - len(s)) * '0' + s def getedges(s)...
applications/tensorflow/dynamic_sparsity/ipu_sparse_ops/fp_slot_opt.py
payoto/graphcore_examples
260
12759771
# Copyright (c) 2020 Graphcore Ltd. All rights reserved. """ This module exposes an Optimizer wrapper to get regular tf.train.Optimizers to allow for selecting the slots FP precision independently of the variable type. Currently only supports Adam """ import os import tensorflow.compat.v1 as tf from tensorflow.python....
NAS/single-path-one-shot/src/MNIST/utils.py
naviocean/SimpleCVReproduction
923
12759773
<gh_stars>100-1000 import os import re import torch import torch.nn as nn import random import json import numpy as np def get_num_correct(preds, labels): return preds.argmax(dim=1).eq(labels).sum().item() class ArchLoader(): ''' load arch from json file ''' def __init__(self, path): su...
internetdefense/settings/dev.py
gnubrasil/idl-members
175
12759788
""" Settings specific to development environments """ from os import path from settings.base import PROJECT_DIR, MIDDLEWARE_CLASSES, INSTALLED_APPS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': path.join(PROJECT_DIR, 'data', 'data.db'), } } DEBUG = True TEMPLATE_...
openvim/dhcp_thread.py
acasana/openmano_movilnet
204
12759794
# -*- coding: utf-8 -*- ## # Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U. # This file is part of openmano # 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 ...
panaroo/post_run_alignment_gen.py
AMARTELKE/Pangenome-with-Panaroo
116
12759839
import shutil import tempfile import os import networkx as nx from .generate_output import * from .isvalid import * from .__init__ import __version__ def get_options(): import argparse description = 'Generate multiple sequence alignments after running Panaroo' parser = argparse.ArgumentParser(descriptio...
tools/bin/pythonSrc/pychecker-0.8.18/test_input/test84.py
YangHao666666/hawq
450
12759842
<filename>tools/bin/pythonSrc/pychecker-0.8.18/test_input/test84.py 'this crashed pychecker from calendar.py in Python 2.2' class X: 'd' def test(self, item): return [e for e in item].__getslice__() # this crashed in 2.2, but not 2.3 def f(a): a.a = [x for x in range(2) if x > 1]
tests/mem.py
caplena/django-hashid-field
310
12759861
#!/usr/bin/env python import os import sys import django from memory_profiler import profile @profile(precision=8) def no_cache(): from hashid_field.hashid import Hashid instances = [Hashid(i, salt="asdf", min_length=7) for i in range(1, 10_000)] return instances @profile(precision=8) def with_cache():...
DQMOffline/CalibCalo/python/MonitorAlCaEcalPi0_cfi.py
ckamtsikis/cmssw
852
12759862
import FWCore.ParameterSet.Config as cms from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer EcalPi0MonDQM = DQMEDAnalyzer('DQMSourcePi0', prescaleFactor = cms.untracked.int32(1), FolderName = cms.untracked.string('AlCaReco/EcalPi0'), AlCaStreamEBpi0Tag = cms.untracked.InputTag("hltAlCaPi0RegRecHits"...
python codes/rock-paper-scissor.py
mflilian/Hacktoberfest2020-1
266
12759921
<gh_stars>100-1000 import random def rps(str): if (str==1): return "Rock" elif (str==2): return "Paper" else: return "Scissor" print("1. Rock 2.Paper 3.Scissor \n") choice=int(input()) print("You "+rps(choice)) computer = random.randint(1,3) print("Computer "+rps(comp...
pytorchvideo/transforms/augmentations.py
kevinmtian/pytorchvideo
2,391
12759928
<gh_stars>1000+ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. """Video transforms that are used for advanced augmentation methods.""" from typing import Any, Callable, Dict, Optional, Tuple import torch import torchvision import torchvision.transforms.functional_tensor as F_t from torchvisi...
applications/GeoMechanicsApplication/python_scripts/gap_closure_interface_activation_process.py
lkusch/Kratos
778
12759960
import KratosMultiphysics import KratosMultiphysics.GeoMechanicsApplication as KratosGeo def Factory(settings, Model): if(type(settings) != KratosMultiphysics.Parameters): raise Exception("expected input shall be a Parameters object, encapsulating a json string") return GapClosureInterfaceActivationPro...
tests/integration/s2n_handshake_test_old_s_client.py
bryce-shang/s2n-tls
4,256
12759968
# # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://aws.amazon.com/apache2.0 # # or in the "license" file accompanyi...
examples/rest-api-python/src/list.py
drewfish/serverless-stack
5,922
12759982
<reponame>drewfish/serverless-stack<gh_stars>1000+ import json from db.notes import getNotes def main(event, context): return { "statusCode": 200, "body": json.dumps(getNotes(), indent=2) }
research/delf/delf/python/datasets/generic_dataset.py
NasTul/models
82,518
12759993
# Lint as: python3 # Copyright 2021 The TensorFlow Authors All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
f5/bigip/tm/sys/test/functional/test_sshd.py
nghia-tran/f5-common-python
272
12760002
<reponame>nghia-tran/f5-common-python<filename>f5/bigip/tm/sys/test/functional/test_sshd.py<gh_stars>100-1000 # Copyright 2016 F5 Networks 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...
rigl/experimental/jax/prune_test.py
vishalbelsare/rigl
276
12760015
# coding=utf-8 # Copyright 2021 RigL Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
course/admin.py
khanhduy8/relate
284
12760024
<filename>course/admin.py __copyright__ = "Copyright (C) 2014 <NAME>" __license__ = """ 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...
pg_view/models/consumers.py
bocytko/pg_view
402
12760078
<filename>pg_view/models/consumers.py import sys if sys.hexversion >= 0x03000000: from queue import Empty else: from Queue import Empty class DiskCollectorConsumer(object): """ consumes information from the disk collector and provides it for the local collector classes running in the same subproc...
jsonpath_ng/bin/jsonpath.py
transfluxus/jsonpath-ng
339
12760099
<gh_stars>100-1000 #!/usr/bin/python # encoding: utf-8 # Copyright © 2012 <NAME> <<EMAIL>> # This work is free. You can redistribute it and/or modify it under the # terms of the Do What The Fuck You Want To Public License, Version 2, # as published by Sam Hocevar. See the COPYING file for more details. # Use modern Py...
CondTools/BeamSpot/test/BeamSpotOnlineRecordsWriter_cfg.py
malbouis/cmssw
852
12760102
<reponame>malbouis/cmssw import FWCore.ParameterSet.Config as cms import FWCore.ParameterSet.VarParsing as VarParsing process = cms.Process("write2DB") options = VarParsing.VarParsing() options.register('unitTest', False, # default value VarParsing.VarParsing.multiplicity.singleton, ...
jmilkfansblog/tests/test_urls.py
xiaoyh121/program
176
12760117
import unittest from jmilkfansblog.controllers import admin from jmilkfansblog.controllers import rest_api from jmilkfansblog import create_app from jmilkfansblog.models import db class TestURLs(unittest.TestCase): """Unit test for route functions.""" def setUp(self): # Destroy the Flask-Admin and F...
integration_tests/samples/issues/issue_522.py
priya1puresoftware/python-slack-sdk
2,486
12760129
# export SLACK_SDK_TEST_CLASSIC_APP_BOT_TOKEN=<KEY> # python3 integration_tests/samples/issues/issue_522.py import asyncio import logging import os from slack_sdk.rtm import RTMClient logging.basicConfig(level=logging.DEBUG) LOGGER = logging.getLogger(__name__) token = os.environ["SLACK_SDK_TEST_CLASSIC_APP_BOT_TOK...
src/mcedit2/panels/pending_imports.py
elcarrion06/mcedit2
673
12760143
<reponame>elcarrion06/mcedit2<filename>src/mcedit2/panels/pending_imports.py<gh_stars>100-1000 """ pending_imports """ from __future__ import absolute_import, division, print_function, unicode_literals from PySide import QtGui import logging log = logging.getLogger(__name__) class PendingImportsWidget(QtGui.QWidg...
questionary/prompts/autocomplete.py
qualichat/questionary
851
12760194
<filename>questionary/prompts/autocomplete.py<gh_stars>100-1000 from typing import ( Any, Callable, Dict, List, Optional, Tuple, Union, Iterable, ) from prompt_toolkit.completion import CompleteEvent, Completer, Completion from prompt_toolkit.document import Document from prompt_toolkit...
tests/integrational/native_sync/test_fetch_messages.py
natekspencer/pubnub-python
146
12760200
import time from pubnub.models.consumer.history import PNFetchMessagesResult from pubnub.models.consumer.pubsub import PNPublishResult from pubnub.pubnub import PubNub from tests.helper import pnconf_copy from tests.integrational.vcr_helper import use_cassette_and_stub_time_sleep_native COUNT = 120 class TestFetchM...
examples/ocaml_rockstar.py
hoojaoh/rockstar
4,603
12760214
from rockstar import RockStar ocaml_code = 'print_string "Hello world!\n";;' rock_it_bro = RockStar(days=400, file_name='hello.ml', code=ocaml_code) rock_it_bro.make_me_a_rockstar()
POSITIONMANAGE/api_position.py
CJuanvip/quant-trading-system
281
12760243
import json def api_position(db,cursor,temp,principal5,principal30,principal60,principal300,principal900,principal1800,coin_number5,coin_number30,coin_number60,coin_number300,coin_number900,coin_number1800,judge_position,sell_amount,buy_amount,current_price): all_buyamount = 0 all_sellamount = 0 trade_amon...
cookies/run_test.py
nikicc/anaconda-recipes
130
12760260
# new cookies.py from cookies import Cookies, Cookie cookies = Cookies(rocky='road') # Can also write explicitly: cookies['rocky'] = Cookie['road'] cookies['rocky'].path = "/cookie" assert cookies.render_request() == 'rocky=road'
venv/Lib/site-packages/dask_ml/cluster/__init__.py
ZhangQingsen/CISC849Proj
803
12760291
<gh_stars>100-1000 """Unsupervised Clustering Algorithms""" from .k_means import KMeans # noqa from .spectral import SpectralClustering # noqa
lib/metrics/F1_running_score.py
shampooma/openseg.pytorch
1,069
12760335
<gh_stars>1000+ ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ## Created by: JingyiXie, RainbowSecret ## Microsoft Research ## <EMAIL> ## Copyright (c) 2019 ## ## Code adapted from: ## https://github.com/nv-tlabs/GSCNN/blob/master/utils/f_boundary.py ## ## This source code is lice...
krop/build_rop.py
tszentendrei/henkaku
534
12760371
#!/usr/bin/env python3 from sys import argv, exit import tempfile import os.path import subprocess tpl = """ .equ ENC_PAYLOAD_ADDR, {payload_addr} .equ ENC_PAYLOAD_SIZE, {payload_size} .equ BASE, {sysmem_base} .equ SECOND_PAYLOAD, {second_payload} """ prefix = "arm-vita-eabi-" def build(tmp, code): src_file = o...
FeatureProject/cut_td_idf.py
liruifeng-01/nlp_xiaojiang
1,379
12760393
# -*- coding: UTF-8 -*- # !/usr/bin/python # @time :2019/4/1 10:35 # @author :Mo # @function :cut sentences from conf.path_config import chicken_and_gossip_path, td_idf_cut_path, td_idf_cut_pinyin from utils.text_tools import txtWrite, txtRead, get_syboml, strQ2B from conf.path_config import projectdir...
mocodo/dynamic.py
JeanHenri79/mocodo
158
12760394
#!/usr/bin/env python # encoding: utf-8 class Dynamic(str): """Wrapper for the strings that need to be dynamically interpreted by the generated Python files.""" pass
tests/test_repr.py
dolfinus/pexpect
2,132
12760402
""" Test __str__ methods. """ import pexpect from . import PexpectTestCase class TestCaseMisc(PexpectTestCase.PexpectTestCase): def test_str_spawnu(self): """ Exercise spawnu.__str__() """ # given, p = pexpect.spawnu('cat') # exercise, value = str(p) # verify ...
controlcenter/__init__.py
EnriqueSoria/django-controlcenter
980
12760428
from .dashboards import Dashboard # NOQA
workshop_material/029_find_paper2.py
nrupatunga/pyimageconf2018
106
12760496
<gh_stars>100-1000 from dlib import * import numpy as np import sys sys.path = ['./superfast/build'] + sys.path import superfast # NEW!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! def discard_all_but_largest_blob(img): labels, num_blobs = label_connected_blobs(img, connected_if_both_not_zero=True) h = get_histogram(lab...
runway/cfngin/actions/init.py
onicagroup/runway
134
12760497
"""CFNgin init action.""" from __future__ import annotations import logging from typing import TYPE_CHECKING, Any, Optional, Union, cast from ...compat import cached_property from ...config.models.cfngin import CfnginStackDefinitionModel from ...core.providers.aws.s3 import Bucket from ..exceptions import CfnginBucke...
octavia/image/image_base.py
zhangi/octavia
129
12760534
<reponame>zhangi/octavia # Copyright 2020 Red Hat, 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 required...
hwt/serializer/verilog/context.py
ufo2011/hwt
134
12760550
<reponame>ufo2011/hwt from hdlConvertorAst.to.verilog.constants import SIGNAL_TYPE class SignalTypeSwap(): """ An object which is used as a context manager for signalType inside of :class:`hwt.serializer.verilog.serializer.ToHdlAstVerilog` """ def __init__(self, ctx, signalType: SIGNAL_TYPE): ...
haiku/_src/batch_norm_test.py
pierricklee/dm-haiku
1,647
12760569
# Copyright 2019 DeepMind Technologies Limited. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
test/hlt/pytest/python/com/huawei/iotplatform/client/dto/NorthInDTO.py
yuanyi-thu/AIOT-
128
12760588
class NorthInDTO(object): def __init__(self): self.platformIp = None self.platformPort = None def getPlatformIp(self): return self.platformIp def setPlatformIp(self, platformIp): self.platformIp = platformIp def getPlatformPort(self): return self.platformPort ...
app/api/__init__.py
TestAuto2018/TestAuto
249
12760615
<filename>app/api/__init__.py # -*- coding: utf-8 -*- __author__ = "苦叶子" """ 公众号: 开源优测 Email: <EMAIL> """ from flask import Blueprint from flask_restful import Api api_bp = Blueprint('api', __name__) api = Api(api_bp) from .auth import Auth api.add_resource(Auth, "/auth/") from .product import Product api.ad...
mrgeo-services/mrgeo-services-core/src/main/scripts/wps-shell-example.py
ngageoint/mrgeo
198
12760623
#!/usr/bin/python import sys import time # read all the input values into a dictionary for easy access. args = {} for v in sys.argv[1:]: s = v.split("=") args[s[0]] = s[1] # put an artificial pause to simulate an expensive operation for i in range(1, 10): print "progress:" + str(i * 10) time.sleep(1)...
ch12-ann/classification_example.py
GaoX2015/intro_ds
314
12760633
# -*- coding: UTF-8 -*- """ 此脚本用于展示如何利用神经网络解决分类问题 """ import os from mlp import ANN import numpy as np import matplotlib.pyplot as plt from sklearn.datasets import make_blobs, make_circles, make_moons from sklearn.linear_model import LogisticRegression from sklearn.preprocessing import StandardScaler, OneHotEncod...
lib/pystatsml/plot_utils.py
gautard/pystatsml
123
12760674
# -*- coding: utf-8 -*- """ Created on Mon Aug 29 10:58:31 2016 @author: <EMAIL> """ import numpy as np import scipy import matplotlib.pyplot as plt import seaborn as sns from matplotlib.patches import Ellipse def plot_cov_ellipse(cov, pos, nstd=2, ax=None, **kwargs): """ Plots an `nstd` sigma error ellips...
ubpf/asm_parser.py
dongxingshui/ubpf
466
12760688
#!/usr/bin/env python from __future__ import print_function from parcon import * from collections import namedtuple hexchars = '0123456789abcdefABCDEF' Reg = namedtuple("Reg", ["num"]) Imm = namedtuple("Imm", ["value"]) MemRef = namedtuple("MemRef", ["reg", "offset"]) def keywords(vs): return First(*[Keyword(Sig...
acme/agents/jax/bc/agent_test.py
ostap-viniavskyi/acme
2,650
12760689
# Copyright 2018 DeepMind Technologies Limited. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
woid/apps/services/migrations/0006_auto_20150902_1522.py
emognato/project
229
12760694
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('services', '0005_auto_20150901_1253'), ] operations = [ migrations.AlterField( model_name='story', n...
tools/dia_dll.py
xumoyan/engine
5,823
12760698
<reponame>xumoyan/engine<filename>tools/dia_dll.py #!/usr/bin/env python3 # # Copyright (c) 2012 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. """ This script is based on chromium/chromium/main/tools/clang/scripts/update...
src/visitpy/examples/matexprs.py
visit-dav/vis
226
12760709
############################################################################### # # Purpose: Use VisIt CLI to iterate over Curves in a material database and # compute and plot some common difference curves and output the results # to either a curve or image file format. # # Programmer: <NAME> # Date: Wed ...
tests/test_version.py
grdorin/mopidy
6,700
12760721
import unittest from distutils.version import StrictVersion from mopidy import __version__ class VersionTest(unittest.TestCase): def test_current_version_is_parsable_as_a_strict_version_number(self): StrictVersion(__version__)
scripts/JustFaceNet.py
nfsergiu/PyOpenPose
300
12760723
<filename>scripts/JustFaceNet.py """ Example script using only the Face detector of Openpose. """ import PyOpenPose as OP import time import cv2 import numpy as np import os OPENPOSE_ROOT = os.environ["OPENPOSE_ROOT"] def ComputeBB(face, padding=0.4): minX = np.min(face[:, 0]) minY = np.min(face[:, 1]) ...
model-optimizer/unit_tests/extensions/front/kaldi/tdnn_component_replacer_test.py
monroid/openvino
2,406
12760762
<filename>model-optimizer/unit_tests/extensions/front/kaldi/tdnn_component_replacer_test.py # Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import unittest import numpy as np from generator import generator, generate from extensions.front.kaldi.tdnn_component_replacer import TdnnCom...
tests/test_topn_precision.py
keener101/lkpy
210
12760787
import numpy as np import pandas as pd from pytest import approx from lenskit.topn import precision from lenskit.util.test import demo_recs from lenskit import topn def _test_prec(items, rel, **k): recs = pd.DataFrame({'item': items}) truth = pd.DataFrame({'item': rel}).set_index('item') return precisio...
tools/moduletests/unit/test_selinuxpermissive.py
stivesso/aws-ec2rescue-linux
178
12760799
<filename>tools/moduletests/unit/test_selinuxpermissive.py # Copyright 2016-2020 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 # # h...
tencentcloud/facefusion/v20181201/facefusion_client.py
PlasticMem/tencentcloud-sdk-python
465
12760862
<filename>tencentcloud/facefusion/v20181201/facefusion_client.py # -*- coding: utf8 -*- # Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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 obta...
src/robotide/lib/robot/running/randomizer.py
ludovicurbain/SWIFT-RIDE
775
12760886
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # 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 ...
face_alignment/detection/dlib/dlib_detector.py
NovemberJoy/VTuber_Unity
669
12760928
<filename>face_alignment/detection/dlib/dlib_detector.py import os import cv2 import dlib try: import urllib.request as request_file except BaseException: import urllib as request_file from ..core import FaceDetector from ...utils import appdata_dir class DlibDetector(FaceDetector): def __init__(self, d...
L1Trigger/GlobalTriggerAnalyzer/python/l1GtPatternGenerator_cfi.py
ckamtsikis/cmssw
852
12760976
<filename>L1Trigger/GlobalTriggerAnalyzer/python/l1GtPatternGenerator_cfi.py import FWCore.ParameterSet.Config as cms l1GtPatternGenerator = cms.EDAnalyzer("L1GtPatternGenerator", # input tags for various records GtInputTag = cms.InputTag("gtDigis"), GmtInputTag = cms.InputTag("gmtDigis"), GctInputTag...
scripts/plain_models/cifar_resnet/train_pytorch.py
microsoft/archai
344
12760982
<reponame>microsoft/archai import argparse import math from typing import List, Mapping, Optional, Tuple, Any import os import logging import numpy as np import time import torch from torch import nn from torch.optim.optimizer import Optimizer from torch.optim.lr_scheduler import _LRScheduler from torch.nn...