max_stars_repo_path
stringlengths
3
269
max_stars_repo_name
stringlengths
4
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.05M
score
float64
0.23
5.13
int_score
int64
0
5
examples/2-tulip-download.py
feihong/tulip-talk
6
38500
<reponame>feihong/tulip-talk import tulip from tulip import http @tulip.coroutine def download(url): response = yield from http.request('GET', url) for k, v in response.items(): print('{}: {}'.format(k, v[:80])) data = yield from response.read() print('\nReceived {} bytes.\n'.format(len(data))...
3.09375
3
python/ts/flint/utils.py
mattomatic/flint
972
38501
<filename>python/ts/flint/utils.py # # Copyright 2017 TWO SIGMA OPEN SOURCE, 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 # # Unl...
1.742188
2
ros2_automatic_fuzzer/ros2_fuzzer/service_fuzzer.py
rosin-project/ros2_fuzz
8
38502
<filename>ros2_automatic_fuzzer/ros2_fuzzer/service_fuzzer.py<gh_stars>1-10 import sys import os sys.path.append("..") from ros2_fuzzer.fuzzing_utils.type_parser import TypeParser from ros2_fuzzer.fuzzing_utils.fuzzing_descriptor import FuzzTargetProcessor from ros2_fuzzer.fuzzing_utils.generate_cpp_file import gener...
2.1875
2
scripts/iconify.py
hallc/labs
0
38503
#!/usr/bin/env python import argparse import os from PIL import Image densities = { 'mdpi': 48, 'hdpi': 72, 'xhdpi': 96, 'xxhdpi': 144, 'xxxhdpi': 192 } class PathAction(argparse.Action): def __call__(self, parser, namespace, value, options_string=None): if not os.path.exists(value): raise argparse.Argume...
3.03125
3
pandaserver/taskbuffer/JobUtils.py
virthead/panda-server
7
38504
import re try: long except NameError: long = int # list of prod source label for pilot tests list_ptest_prod_sources = ['ptest', 'rc_test', 'rc_test2', 'rc_alrb'] # mapping with prodsourcelabels that belong to analysis and production analy_sources = ['user', 'panda'] prod_sources = ['managed', 'prod_test'] n...
2.109375
2
v002/__init__.py
cgarcia-UCO/AgentSurvival
0
38505
try: from IPython import get_ipython if get_ipython().__class__.__name__ not in ['NoneType']: from IPython import display i_am_in_interatcive = True import pylab as pl pl.rcParams['figure.figsize'] = [13, 13] # print("INTERACTIVE") else: import matplotlib.pyp...
2.078125
2
lib/constants.py
PEDIA-Charite/PEDIA-workflow
9
38506
''' Constants --- Constants used in other scripts. These are mostly interpretations of fields provided in the Face2Gene jsons. ''' HGVS_ERRORDICT_VERSION = 0 # Bucket name, from where Face2Gene vcf and json files will be downloaded AWS_BUCKET_NAME = "fdna-pedia-dump" # caching directory CACHE_DIR = ".cache" # tests...
1.921875
2
jetson_nano/serial_monitor.py
hixio-mh/BatBot
32
38507
<filename>jetson_nano/serial_monitor.py #!/usr/bin/python3 import serial # http://pyserial.sf.net import time from datetime import datetime import struct port = '/dev/ttyACM0' # note I'm using Jetson Nano arduino = serial.Serial(port, 9600, timeout=5) time.sleep(2) # wait for Arduino arduino.flush() command = 'X' # ...
2.71875
3
ttbd/ttbl/quartus.py
inakypg/tcf
1
38508
#! /usr/bin/python3 # # Copyright (c) 2021 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 # import copy import os import subprocess import commonl import ttbl import ttbl.images import ttbl.power class pgm_c(ttbl.images.flash_shell_cmd_c): """Flash using Intel's Quartus PGM tool This allows to fl...
2.328125
2
files/carinha.py
joaovpassos/USP-Programs
2
38509
<reponame>joaovpassos/USP-Programs x = float(input("Digite x: ")) y = float(input("Digite y: ")) if 0 <= x <= 8 and 0 <= y <= 8: if (0 <= x < 1 or 7 < x <= 8) and (0 <= y < 2): #pescoço print("branco") elif 3.5 <= x <= 4.5 and 3.5 <= y <= 4.5: #nariz print("branco") elif (1 <= x <= 3 or 5 <...
4.09375
4
delivery/delivery/exts/cli/__init__.py
all0cer/flask
0
38510
<filename>delivery/delivery/exts/cli/__init__.py from enum import Flag import click from delivery.exts.db import db from delivery.exts.db import models def init_app(app): @app.cli.command() def create_db(): db.create_all() @app.cli.command() @click.option("--email", "-e") @click.option("...
2.21875
2
main.py
maxBombrun/lipidDroplets
0
38511
<reponame>maxBombrun/lipidDroplets<gh_stars>0 import os import csv import multiprocessing import settings import segmentNucAndGFP import cellProfilerGetRelation import measureGFPSize import plotFeatures import fusionCSV import clusterDroplets import computeZprime settings.init() CPPath=settings.p...
2.21875
2
test/integration/test_load_shapefile_networkx_native.py
JoachimC/magicbox_distance
0
38512
<reponame>JoachimC/magicbox_distance<filename>test/integration/test_load_shapefile_networkx_native.py import unittest import networkx as nx class TestLoadColumbiaRoadsNetworkXNative(unittest.TestCase): def test_load(self): # https://data.humdata.org/dataset/d8f6feda-6755-4e84-bd14-5c719bc5f37a (hotosm_c...
2.5625
3
model/Teams_data_prep.py
YWang9999/Fantasy-Premier-League
0
38513
import pandas as pd from config import WEBSCRAPE_DATA_PATH, OUTPUT_DATA_PATH import os def get_understat_filepaths(file_path): filepaths = [] team = [] for root, dirs, files in os.walk(file_path): for filename in files: if ('understat' in filename) and ('team' not in filename) and ('pl...
2.734375
3
respy/tests/test_parallelism.py
tobiasraabe/respy_for_ma
0
38514
import numpy as np import pytest from respy import RespyCls from respy.python.shared.shared_constants import IS_PARALLELISM_MPI from respy.python.shared.shared_constants import IS_PARALLELISM_OMP from respy.tests.codes.auxiliary import compare_est_log from respy.tests.codes.auxiliary import simulate_observed from resp...
1.875
2
qgis_plutil/http_server/routes.py
pyqgis/plutil
0
38515
# -*- coding: utf-8 -*- """ """ from __future__ import unicode_literals from __future__ import print_function import logging from json import dumps from flask import request logger = logging.getLogger('plutil.http.s') def define_common_routes(plugin, app, server): """ Some routes are always defined. """ @...
2.328125
2
utils/plackettluce.py
HarrieO/2021-SIGIR-plackett-luce-optimization
21
38516
<gh_stars>10-100 # Copyright (C) <NAME> 2021. # Distributed under the MIT License (see the accompanying README.md and LICENSE files). import numpy as np import utils.ranking as rnk def sample_rankings(log_scores, n_samples, cutoff=None, prob_per_rank=False): n_docs = log_scores.shape[0] ind = np.arange(n_samples)...
1.757813
2
demo_train.py
ryanfwy/image-quality
1
38517
'''Train Siamese NIMA model networks.''' from model.siamese_nima import SiameseNIMA if __name__ == '__main__': # dirs and paths to load data train_image_dir = './assets/demo/train_images' train_data_path = './assets/demo/train_data.csv' # load data and train model siamese = SiameseNIMA(output_di...
2.125
2
quine_examples/quine_list.py
mbrown1413/Arbitrary-Quine
2
38518
lines = ['print "lines =", lines', 'for line in lines:', ' print line'] print "lines =", lines for line in lines: print line
2.671875
3
trojsten/rules/kms.py
MvonK/web
5
38519
# -*- coding: utf-8 -*- import datetime from django.db.models import Count, Q from django.utils import timezone from trojsten.events.models import EventParticipant from trojsten.people.constants import SCHOOL_YEAR_END_MONTH from trojsten.results.constants import COEFFICIENT_COLUMN_KEY from trojsten.results.generator...
1.765625
2
terrascript/consul/__init__.py
hugovk/python-terrascript
0
38520
<reponame>hugovk/python-terrascript<filename>terrascript/consul/__init__.py<gh_stars>0 # Consul provider is not created through makecode.py # because of issues 24.
1.226563
1
dac.py
hurasum/esp32_python
0
38521
""" DAC typing class ESP32 has two 8-bit DAC (digital to analog converter) channels, connected to GPIO25 (Channel 1) and GPIO26 (Channel 2). The DAC driver allows these channels to be set to arbitrary voltages.<br The DAC channels can also be driven with DMA-style written sample data, via the I2S driver when using the...
3.4375
3
vuln/__init__.py
Maskhe/DongTai-engine
16
38522
default_app_config = 'vuln.apps.VulnConfig'
1.125
1
examples/itemrank_quick_query.py
cclauss/predictionio-sdk-python
63
38523
<filename>examples/itemrank_quick_query.py """ itemrank quickstart query """ import predictionio client = predictionio.EngineClient("http://localhost:8000") # Rank item 1 to 5 for each user item_ids = [str(i) for i in range(1, 6)] user_ids = [str(x) for x in range(1, 6)] + ["NOT_EXIST_USER"] for user_id in user_ids:...
2.765625
3
key_server/key_management_system/apps.py
TV-Encryption/key_server
0
38524
from django.apps import AppConfig class KeyManagementSystemConfig(AppConfig): default_auto_field = "django.db.models.BigAutoField" name = "key_server.key_management_system" verbose_name = "Key Management System"
1.304688
1
Interesting Python Questions/solve equation.py
liu-yunfei/Python
1
38525
<reponame>liu-yunfei/Python def f(x): return ((2*(x**4))+(3*(x**3))-(6*(x**2))+(5*x)-8) def reachEnd(previousm,currentm): if abs(previousm - currentm) <= 10**(-6): return True return False def printFormat(a,b,c,m,count): print("Step %s" %count) print("a=%.6f b=%.6f c=%.6f" %(a,b,...
3.390625
3
sensor.py
vorian77/driving_simulator
0
38526
import obj as obj_lib import road_artifact import drive as drive_lib import utilities as u class Sensor(obj_lib.Obj): """ parent object class for car sensors returns instruction driving instruction - (heading, speed) no driving instruction (no new process or process has completed) - None ...
2.671875
3
maza/modules/exploits/misc/wepresent/wipg1000_rce.py
ArturSpirin/maza
2
38527
from maza.core.exploit import * from maza.core.http.http_client import HTTPClient class Exploit(HTTPClient): __info__ = { "name": "WePresent WiPG-1000 RCE", "description": "Module exploits WePresent WiPG-1000 Command Injection vulnerability which allows " "executing commands...
2.4375
2
solidity/install_solc.py
pdos-team/pdos
0
38528
#!/usr/bin/env python3 import os import sys if os.getuid() != 0: print ("Must be run as root, sorry.") sys.exit(-1) from solcx import install_solc_pragma install_solc_pragma('>0.5.0 <0.6.0') print ("Done.")
1.867188
2
Medium/54_spiralOrder.py
a-shah8/LeetCode
1
38529
<reponame>a-shah8/LeetCode<gh_stars>1-10 class Solution: def spiralOrder(self, matrix: List[List[int]]) -> List[int]: result = [] rows, columns = len(matrix), len(matrix[0]) up = left = 0 right = columns-1 down = rows-1 while len(result) < rows*colum...
3.375
3
SmoothAPI/proxy_handlers.py
technerium/SmoothAPI
0
38530
<filename>SmoothAPI/proxy_handlers.py class NoProxy: def get(self, _): return None def ban_proxy(self, proxies): return None class RateLimitProxy: def __init__(self, proxies, paths, default=None): self.proxies = proxies self.proxy_count = len(proxies) self.access_c...
2.671875
3
backend/backend/settings/base.py
rrhg/react-django-docker-boilerplate
0
38531
<gh_stars>0 """ Base settings to build other settings files upon. """ import os """ Django settings for backend project. Generated by 'django-admin startproject' using Django 3.1.4. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their...
1.875
2
scripts/run-and-rename.py
mfs6174/Deep6174
0
38532
<filename>scripts/run-and-rename.py #!/usr/bin/env python2 # -*- coding: UTF-8 -*- # File: run-and-rename.py # Date: Thu Sep 18 15:43:36 2014 -0700 # Author: <NAME> <<EMAIL>> import numpy as np from scipy.misc import imread, imsave from itertools import izip import sys, os import shutil import os.path import glob if ...
2.5
2
Exercises/Exercise 15 - Hard.py
MikelShifrin/Python1
3
38533
#Assignment 12 #create 2 files on Desktop: #input.txt #output.txt #inside input.txt write the following lines: #apple #orange #banana #cucumber #Your program will add an s to each line #and write it to output.txt #Hint: name = 'hello\n' # name.rstrip('\n')
3.671875
4
wk8_hw/ex3_create_2_new_devs.py
philuu12/PYTHON_4_NTWK_ENGRS
1
38534
<reponame>philuu12/PYTHON_4_NTWK_ENGRS #!/usr/bin/env python """ 3. Create two new test NetworkDevices in the database. Use both direct object creation and the .get_or_create() method to create the devices. """ from net_system.models import NetworkDevice import django def main(): django.setup() brocade_rtr1...
2.6875
3
pdfreader/types/objects.py
tmcclintock/pdfreader
0
38535
<gh_stars>0 from ..utils import cached_property from ..pillow import PILImageMixin from .native import Stream, Dictionary, Array, Name class StartXRef(object): """ startxref 123 Pseudo object. Can be between indirect objects if any incremental updates. """ def __init__(self, offset): ...
2.515625
3
portfolio2/tinydepparser/myparserutils.py
leonwetzel/Natural-Language-Processing
0
38536
""" An implementation of a greedy transition-based dependency parser (unlabeled parsing only). Released under BSD license. Code is an adapted version of <NAME>'s parser: https://explosion.ai/blog/parsing-english-in-python -- change: move core logic to separate myparserutils file modified by bplank, 03/2017 """ ###...
2.359375
2
senlin-7.0.0/senlin/tests/unit/api/middleware/test_context.py
scottwedge/OpenStack-Stein
45
38537
<gh_stars>10-100 # 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 #...
1.679688
2
queue_from_track_id.py
codedwrench/sonosopencontroller
1
38538
<reponame>codedwrench/sonosopencontroller # -*- coding: utf-8 -*- from __future__ import unicode_literals from soco import SoCo from soco.data_structures import DidlItem, DidlResource from soco.music_services import MusicService from soco.compat import quote_url device = SoCo("192.168.1.80") # <------- Your IP here...
2.4375
2
applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/methodDefs_momentEstimator/updateCombinedPowerSums.py
HubertBalcerzak/Kratos
0
38539
# Import PyCOMPSs # from exaqute.ExaquteTaskPyCOMPSs import * # to execute with runcompss # from exaqute.ExaquteTaskHyperLoom import * # to execute with the IT4 scheduler from exaqute.ExaquteTaskLocal import * # to execute with python3 def updatePowerSumsOrder1Dimension0(): pass @ExaquteTask(samples={Typ...
2.1875
2
tests-py/chat/client/client.py
moky/WormHole
5
38540
# -*- coding: utf-8 -*- import json import threading import time from abc import abstractmethod from typing import Optional from dmtp.mtp import tlv from dmtp import mtp import dmtp import stun from .manager import ContactManager, FieldValueEncoder, Session def time_string(timestamp: int) -> str: time_array = ...
2.390625
2
srpc/payload.py
fergul/py-SRPC
0
38541
<filename>srpc/payload.py from struct import pack, unpack from srpcDefs import Command class Payload(object): """Basic payload header""" def __init__(self, subport = 0, seqNo = 0, command = 0, fnum = 0, nfrags = 0, buffer = None): super(Payload, self).__init__() self.buffer = b...
2.71875
3
lista02Exec01.py
marcelocmedeiros/PrimeiraAvalaizcaoPython
0
38542
#<NAME> #ADS UNIFIP P1 2020 #LISTA 02 ''' 1- Faça um programa que solicite ao usuário o valor do litro de combustível (ex. 4,75) e quanto em dinheiro ele deseja abastecer (ex. 50,00). Calcule quantos litros de combustível o usuário obterá com esses valores. ''' valor_gas = float(input('Qual o valor do combustível?R$ ...
3.78125
4
py/lvmspec/pipeline/state.py
sdss/lvmspec
0
38543
<reponame>sdss/lvmspec<gh_stars>0 # # See top-level LICENSE.rst file for Copyright information # # -*- coding: utf-8 -*- """ lvmspec.pipeline.state =========================== Functions for manipulating the state of objects in the dependency graph. """ from __future__ import absolute_import, division, print_function ...
1.914063
2
rest_api/projects/serializers.py
joatuapp/joatu-django
10
38544
from rest_framework import serializers from projects.models import ( Project, ProjectVolunteers, ProjectVolunteersRegistration, ProjectAttendees, ProjectAttendeesRegistration, ProjectDiscussion, ProjectAnswerDiscussion, ProjectHub, ) class ProjectVolunteersRegistrationSerializer(seria...
2
2
scripts/de-duplication.py
Jonescy/NewsCrawler
2
38545
""" @Author: <EMAIL> @Created: 2021/3/10 @Application: 作用在mongodb去重 """ import pymongo from NewsCrawler.settings import MONGO_URL client = pymongo.MongoClient(MONGO_URL, maxPoolSize=1024) def find_duplicate(collection): collection.aggregate([ {'$group': { '_id': {'title': "$title", 'publishe...
2.765625
3
app/alembic/versions/a1c5591554f0_create_score_table.py
johndatserakis/find-the-state-api
1
38546
<filename>app/alembic/versions/a1c5591554f0_create_score_table.py """Create score table Revision ID: <KEY> Revises: <KEY> Create Date: 2021-04-23 23:09:22.801565 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects.postgresql import UUID # revision identifiers, used by Alembic. revision = "<K...
1.570313
2
scripts/parse_tools/parse_object.py
SamuelTrahanNOAA/ccpp-framework
0
38547
<gh_stars>0 #!/usr/bin/env python """A module for the base, ParseObject class""" # Python library imports import re # CCPP framework imports from .parse_source import ParseContext, CCPPError ######################################################################## class ParseObject(ParseContext): """ParseObject i...
2.796875
3
spiders/spider.py
gt11799/xueqiu_spider
6
38548
# -*- coding: utf-8 -*- import sys import time import json import pickle import hashlib import requests from urlparse import urljoin from config import * from spiders.common import * from spiders.html_parser import * from logs.log import logger reload(sys) sys.setdefaultencoding('utf8') class Spider(object): d...
2.53125
3
imago/cli.py
opencivicdata/imago
8
38549
<gh_stars>1-10 import requests import sys def debug(): url, *fields = sys.argv[1:] if fields == []: print("") print("Baseline Benchmark:") print("") benchmark(url) field_param = [] for field in fields: field_param.append(field) print("") print("...
2.734375
3
sympy/diffgeom/tests/test_class_structure.py
shilpiprd/sympy
8,323
38550
<reponame>shilpiprd/sympy from sympy.diffgeom import Manifold, Patch, CoordSystem, Point from sympy import symbols, Function from sympy.testing.pytest import warns_deprecated_sympy m = Manifold('m', 2) p = Patch('p', m) a, b = symbols('a b') cs = CoordSystem('cs', p, [a, b]) x, y = symbols('x y') f = Function('f') s1,...
2.21875
2
biconfigs/storages.py
antfu/two-way-configs.py
2
38551
import codecs __memory_storage = {} def file_read(path): with codecs.open(path, 'r', 'utf-8') as f: return f.read() def file_write(path, text): with codecs.open(path, 'w', 'utf-8') as f: return f.write(text) def memory_write(key, data): __memory_storage[key] = data STORAGES = { 'fil...
3.03125
3
tests/test_oauth.py
Dephilia/poaurk
1
38552
<reponame>Dephilia/poaurk<filename>tests/test_oauth.py #! /usr/bin/env python3 # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2021 dephilia <<EMAIL>> # # Distributed under terms of the MIT license. """ """ import unittest from poaurk import (PlurkAPI, PlurkOAuth) class TestOauthMethods(unittest.TestCase):...
2.65625
3
test/functional/bsv-journal-mempool-reorg-ordering.py
AustEcon/bitcoin-sv
2
38553
<gh_stars>1-10 #!/usr/bin/env python3 # Copyright (c) 2019 Bitcoin Association # Distributed under the Open BSV software license, see the accompanying file LICENSE. ''' Check different scenarios on how reorg affects contents of mempool and journal. # chain reorg as a set operation on the chains of blocks containin...
1.921875
2
datacite_rest/__init__.py
gu-eresearch/datacite-rest
0
38554
""" root module with metadata """ __title__ = 'datacite-rest' __version__ = '0.0.1-dev0' __author__ = '<NAME>' __author_email__ = '<EMAIL>' __description__ = 'a package for managing dois' __license__ = 'MIT' try: from .datacite_rest import DataCiteREST # noqa except Exception: # preserve import here but stops...
0.890625
1
audio_utils/common/feature_transforms.py
SarthakYadav/audio-data-utils
0
38555
import torch import torchaudio import numpy as np from torch.nn.functional import normalize from audio_utils.common.utilities import _check_transform_input class BaseAudioParser(object): def __init__(self, mode="after_batch"): super().__init__() assert mode in ['after_batch', "per_instance"] ...
2.5625
3
datrie/run_test.py
nikicc/anaconda-recipes
130
38556
<reponame>nikicc/anaconda-recipes import string import datrie trie = datrie.Trie(string.ascii_lowercase) trie[u'foo'] = 5 assert u'foo' in trie
2.1875
2
projects/models.py
plaf2000/webspec
0
38557
<filename>projects/models.py from django.db import models from django.contrib.auth.models import User class Project(models.Model): hf = models.PositiveIntegerField(default=18000) lf = models.PositiveIntegerField(default=0) nfft_view = models.PositiveIntegerField(...
2.125
2
qiskit/aqua/algorithms/education/__init__.py
hushaohan/aqua
2
38558
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modif...
1.296875
1
tests/vision/metrics/vqa_test.py
shunk031/allennlp-models
402
38559
<reponame>shunk031/allennlp-models<filename>tests/vision/metrics/vqa_test.py from typing import Any, Dict, List, Tuple, Union import pytest import torch from allennlp.common.testing import ( AllenNlpTestCase, multi_device, global_distributed_metric, run_distributed_test, ) from allennlp_models.vision ...
2.171875
2
compare_two_values.py
jenildesai25/Visa_interview
0
38560
<reponame>jenildesai25/Visa_interview<gh_stars>0 VISA full time master's MCQ. def func(a, b): x = a y = b while x != y: if x > y: x = x - y if x < y: y = y - x return x or y print(func(2437, 875))
3.25
3
pzflow/flow.py
jfcrenshaw/pzflow
26
38561
import itertools from typing import Any, Callable, Sequence, Tuple import dill as pickle import jax.numpy as np import numpy as onp import pandas as pd from jax import grad, jit, ops, random from jax.experimental.optimizers import Optimizer, adam from pzflow import distributions from pzflow.bijectors import Bijector_...
2.46875
2
tests/epyccel/test_epyccel_transpose.py
dina-fouad/pyccel
206
38562
<reponame>dina-fouad/pyccel<filename>tests/epyccel/test_epyccel_transpose.py # pylint: disable=missing-function-docstring, missing-module-docstring/ from numpy.random import randint from pyccel.epyccel import epyccel def test_transpose_shape(language): def f1(x : 'int[:,:]'): from numpy import transpose ...
2.5625
3
configs.py
h3xh4wk/yamlguide
0
38563
import yaml import pprint def read_yaml(): """ A function to read YAML file""" with open('configs.yml') as f: config = list(yaml.safe_load_all(f)) return config def write_yaml(data): """ A function to write YAML file""" with open('toyaml.yml', 'a') as f: yaml.dump_all(data, f, d...
3.4375
3
consts.py
honey96dev/python-coinbase-tradingbot
1
38564
months_json = { "1": "January", "2": "February", "3": "March", "4": "April", "5": "May", "6": "June", "7": "July", "8": "August", "9": "September", "01": "January", "02": "February", "03": "March", "04": "April", "05": "May", "06": "June", "07": "July", "08": "August", "09": "Septem...
1.945313
2
splearn/utils/__init__.py
Treers/spark-learn
0
38565
#coding: utf-8 ''' @Time: 2019/4/25 11:15 @Author: fangyoucai '''
1.117188
1
salty/exceptions.py
Markcial/salty
0
38566
__all__ = ['EncryptException', 'DecryptException', 'DefaultKeyNotSet', 'NoValidKeyFound'] class EncryptException(BaseException): pass class DecryptException(BaseException): pass class DefaultKeyNotSet(EncryptException): pass class NoValidKeyFound(DecryptException): pass
1.914063
2
build_gpcr/management/commands/build_text.py
pszgaspar/protwis
21
38567
<reponame>pszgaspar/protwis from build.management.commands.build_text import Command as BuildText class Command(BuildText): pass
1.296875
1
test/unit/builtins/test_packages.py
jmgao/bfg9000
0
38568
<gh_stars>0 import mock import ntpath import os import re import sys import unittest from collections import namedtuple from .common import BuiltinTest from ... import make_env from bfg9000 import file_types, options as opts from bfg9000.builtins import packages from bfg9000.exceptions import PackageResolutionError, ...
2.046875
2
pypyr/steps/nowutc.py
FooBarQuaxx/pypyr
0
38569
"""pypyr step saves the current utc datetime to context.""" from datetime import datetime, timezone import logging # logger means the log level will be set correctly logger = logging.getLogger(__name__) def run_step(context): """Save current utc datetime to context. Args: context: pypyr.context.Cont...
3.265625
3
datumaro/datumaro/util/test_utils.py
godlikejay/cvat
2
38570
<filename>datumaro/datumaro/util/test_utils.py<gh_stars>1-10 # Copyright (C) 2019 Intel Corporation # # SPDX-License-Identifier: MIT import inspect import os import os.path as osp import shutil def current_function_name(depth=1): return inspect.getouterframes(inspect.currentframe())[depth].function class FileR...
2.21875
2
module3-nosql-and-document-oriented-databases/mongo_queries.py
ayarelif/DS-Unit-3-Sprint-2-SQL-and-Databases
0
38571
<filename>module3-nosql-and-document-oriented-databases/mongo_queries.py # BG_URI="mongodb+srv://elifayar:<password>@clusters.lcjcx.mongodb.net/<dbname>?retryWrites=true&w=majority") # client = pymongo.MongoClient(DB_URI) # db = client.test from pymongo import MongoClient import os from dotenv import load_dotenv lo...
2.71875
3
Video_To_ASCII/main.py
cppshizoidS/Python
5
38572
import os import sys from time import sleep as sleep import glob import cv2 from PIL import Image ESC = b'\033' CSI = ESC + b'[' Фuse_ansi_escape_sequences = True if not use_ansi_escape_sequences: import ctypes from ctypes import c_long console_handle = ctypes.windll.kernel32.GetStdHandle(c_long(-11)) ...
2.4375
2
Scripts/simulation/careers/acting/performance_object_data.py
velocist/TS4CheatsInfo
0
38573
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\careers\acting\performance_object_data.py # Compiled at: 2018-09-18 00:30:33 # Size of source mod 2*...
1.914063
2
tests/extractor/test_with_fallback.py
thegangtechnology/excel_comment_orm
2
38574
<gh_stars>1-10 from openpyxl import Workbook from openpyxl.comments import Comment from exco import util, ExcoTemplate, ExcelProcessorFactory def test_with_defaults(): wb = Workbook() sheet = wb.active sheet.cell(1, 1).value = 'not a number' sheet.cell(1, 1).comment = Comment(util.long_string(""" ...
2.625
3
python/miind/connections.py
dekamps/miind
13
38575
<filename>python/miind/connections.py # -*- coding: utf-8 -*- """ Created on Sat Jan 17 16:51:56 2015 @author: scsmdk """ import miind.nodes as nodes import miind.variables as variables TALLY = {} def register(i,o): tup = (i,o) if tup not in TALLY: TALLY[tup] = 1 return 0 else: T...
2.484375
2
PGM_MLRN_supplementary/train_mixed_precision_distributed.py
MaryZolfaghar/AbstractReasoning
0
38576
import numpy as np import torch import os import sys import re import math from torch.utils.data import Dataset, DataLoader from apex import amp from apex.parallel import DistributedDataParallel as DDP from lamb import Lamb #tensorboard for accuracy graphs import tensorflow as tf def getCombinations(inputTensor, N, c...
2.140625
2
python/3D-rrt/pvtrace/Geometry.py
siddhu95/mcclanahoochie
1
38577
# pvtrace is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # pvtrace is distributed in the hope that it will be useful, # but WITHOUT...
2.1875
2
satori/sysinfo/__init__.py
mgeisler/satori
1
38578
<gh_stars>1-10 """Modules for Data Plane Discovery."""
0.960938
1
build/python/tests/fast_copy_mock/fast_copy_mock.py
fabio-d/fuchsia-stardock
5
38579
# Copyright 2022 The Fuchsia Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import functools import os from typing import Any, Callable, List, Tuple, Union from assembly.common import FileEntry __all__ = [ "create_fast_copy_mock...
2.3125
2
zenvlib/environmentsettings.py
zoosk/zenv
14
38580
<gh_stars>10-100 # Copyright 2015 Zoosk, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
1.742188
2
brownbags/urls.py
openkawasaki/brownbag-django
2
38581
<filename>brownbags/urls.py from django.urls import include, path from . import views from django.views.generic.base import RedirectView from rest_framework import routers from . import apis # アプリケーションの名前空間 app_name = 'brownbags' urlpatterns = [ path('', views.index, name='index'), path('edit/', views.edit, ...
2.015625
2
scripts/preprocessing/setup_reads.py
shunhuahan/mcclintock
0
38582
#!/usr/bin/env python3 import os import sys import subprocess import traceback from datetime import datetime try: sys.path.append(snakemake.config['args']['mcc_path']) import scripts.mccutils as mccutils import config.preprocessing.trimgalore as trimgalore from Bio import SeqIO except Exception as e: ...
2
2
exemplo.py
efbrasil/B3LOB
0
38583
<gh_stars>0 from B3LOB import Lob import numpy as np import os from datetime import datetime import matplotlib.pyplot as plt lob = Lob(datadir='/home/eduardo/MarketData/') fnames = ['OFER_CPA_20191127.gz', 'OFER_VDA_20191127.gz'] lob.read_orders_from_files('PETR3', fnames) lob.set_snapshot_freq(60) lob.process_orders(...
1.796875
2
siptrackweb/forms.py
lalusvipi/siptrackweb
38
38584
from django import forms class EmptyForm(forms.Form): pass class LoginForm(forms.Form): username = forms.CharField( max_length=50, label='Username' ) password = forms.CharField( max_length=32, label='Password', widget=forms.PasswordInput(), required=True...
2.25
2
azure_utility_tool/actions/list_all_users.py
alextricity25/azure_utility_tool
5
38585
""" Author(s): <NAME> (<EMAIL>) Date: 02/21/2020 Description: This action will return several lines, with each line being a JSON representation of the user """ from azure_utility_tool.utils import paginate from azure_utility_tool.graph_endpoints import USER_GET_ENDPOINT from azure_utility_tool.test_cases im...
2.953125
3
examples/example.py
jakevdp/Mmani
303
38586
<gh_stars>100-1000 import sys import numpy as np import scipy as sp import scipy.sparse as sparse from megaman.geometry import Geometry from sklearn import datasets from megaman.embedding import (Isomap, LocallyLinearEmbedding, LTSA, SpectralEmbedding) # Generate an example data set N = ...
2.984375
3
oncopolicy/models/deterministic_progression.py
yala/Tempo
6
38587
import torch import torch.nn as nn from oncopolicy.models.factory import RegisterModel import pdb class AbstractDeterministicGuideline(nn.Module): def __init__(self, args): super(AbstractDeterministicGuideline, self).__init__() self.args = args self.max_steps = args.max_steps def get_...
2.328125
2
config/settings/base.py
sul-cidr/histonets-arch
0
38588
""" Base settings to build other settings files upon. """ import environ ROOT_DIR = environ.Path(__file__) - 3 # (histonets/config/settings/base.py - 3 = histonets/) APPS_DIR = ROOT_DIR.path('histonets') env = environ.Env() READ_DOT_ENV_FILE = env.bool('DJANGO_READ_DOT_ENV_FILE', default=False) if READ_DOT_ENV_FIL...
2.015625
2
groupman.py
yteraoka/googleapps-directory-tools
20
38589
<gh_stars>10-100 #!/apps/python-2.7/bin/python # -*- coding: utf-8 -*- import os import os.path import glob import sys from apiclient.discovery import build from apiclient.errors import HttpError import httplib2 from oauth2client.client import flow_from_clientsecrets from oauth2client.file import Storage from oauth2cl...
2.125
2
icekit/utils/search/search_indexes.py
ic-labs/django-icekit
52
38590
<gh_stars>10-100 from django.utils.text import capfirst from easy_thumbnails.exceptions import InvalidImageFormatError from easy_thumbnails.files import get_thumbnailer from haystack import indexes from haystack.utils import get_model_ct # Doesn't extend `indexes.Indexable` to avoid auto-detection for 'Search In' cla...
2.03125
2
CSC-291/Projects/bsearch_timer.py
FrancesCoronel/cs-hu
2
38591
<reponame>FrancesCoronel/cs-hu ''' FVCproductions September 18, 2014 Python CSC291_Project3 ''' # Binary Search: (20 pts) # Implement binary search, submit it to the course website. You must write a # function bsearch that takes and list and an element to search for. This # function should return the index of t...
4.09375
4
src/stages.py
khalidm/vcf_annotation_pipeline
0
38592
<reponame>khalidm/vcf_annotation_pipeline ''' Individual stages of the pipeline implemented as functions from input files to output files. The run_stage function knows everything about submitting jobs and, given the state parameter, has full access to the state of the pipeline, such as config, options, DRMAA and the l...
2.375
2
chrome/test/pyautolib/generate_docs.py
nagineni/chromium-crosswalk
231
38593
#!/usr/bin/env python # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import optparse import os import pydoc import shutil import sys def main(): parser = optparse.OptionParser() parser.add_optio...
2.5625
3
swagger_ui/__init__.py
dirkgomez/voice-skill-sdk
0
38594
# # voice-skill-sdk # # (C) 2020, Deutsche Telekom AG # # Deutsche Telekom AG and all other contributors / # copyright owners license this file to you under the MIT # License (the "License"); you may not use this file # except in compliance with the License. # You may obtain a copy of the License at # # https://opensou...
1.710938
2
courses/migrations/0009_enrollment_statuses.py
mitodl/mit-xpro
10
38595
# Generated by Django 2.1.7 on 2019-05-24 19:17 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("courses", "0008_enrollment_company")] operations = [ migrations.AddField( model_name="courserunenrollment", name="active", ...
1.90625
2
Course 1 - Introduction to Python/Unit4_Good_Programming_Practices/ProblemSet_4/Problem1_WordScores.py
Odzen/MIT_React_DataScience
0
38596
<filename>Course 1 - Introduction to Python/Unit4_Good_Programming_Practices/ProblemSet_4/Problem1_WordScores.py SCRABBLE_LETTER_VALUES = { 'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, 'g': 2, 'h': 4, 'i': 1, 'j': 8, 'k': 5, 'l': 1, 'm': 3, 'n': 1, 'o': 1, 'p': 3, 'q': 10, 'r': 1, 's': 1, 't': 1, 'u': 1, 'v': 4,...
4.15625
4
python/86.partition-list.py
Zhenye-Na/leetcode
10
38597
# # @lc app=leetcode id=86 lang=python3 # # [86] Partition List # # https://leetcode.com/problems/partition-list/description/ # # algorithms # Medium (43.12%) # Likes: 1981 # Dislikes: 384 # Total Accepted: 256.4K # Total Submissions: 585.7K # Testcase Example: '[1,4,3,2,5,2]\n3' # # Given the head of a linked l...
3.75
4
schemas/users.py
Ashishb21/propertyConnect
0
38598
from typing import Optional from pydantic import BaseModel,EmailStr #properties required during user creation class RegisterUser(BaseModel): username: str email : EmailStr password : str phone_no: int class ShowUser(BaseModel): username: str email: EmailStr is_active: bool class Conf...
2.796875
3
server/migrations/versions/b5ae9c8c6118_.py
uptownnickbrown/metaseq
7
38599
<reponame>uptownnickbrown/metaseq """empty message Revision ID: b5ae9c8c6118 Revises: <PASSWORD> Create Date: 2017-06-28 11:39:37.100530 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'b5ae9c8c6118' down_revision = 'aa<PASSWORD>' branch_labels = None depends_o...
1.273438
1