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.py
ramazanpolat/bittrex
1
53800
<filename>examples.py from bittrex import Bittrex b = Bittrex(apikey='<YOUR_APIKEY>', secret='<YOUR_SECRET', understood='understood') err, balances = b.get_balances_dict() if not err: for coin, balance_info in balances.items(): print(f'Coin:{coin} - {balance_info}')
2.53125
3
src/libs/suit/templatetags/suit_forms.py
ivanjo39191/ivankao-erp
1
53801
<reponame>ivanjo39191/ivankao-erp import django from django import template from django.utils.safestring import mark_safe from suit import config from suit.config import get_config register = template.Library() if django.VERSION < (1, 9): simple_tag = register.assignment_tag else: simple_tag = register.simple...
2.015625
2
create_oracular_traces.py
csangani/ReproducingSprout
5
53802
## Creates oracular traces from network traces, used for calculating self-inflicted delay import glob import os import re import sys INPUT_PATH = 'cleaned_traces' OUTPUT_PATH = 'oracular_traces' def create_oracular_trace(filePath, targetFilePath, mode): with open(filePath) as f: with open(targetFilePath,...
2.625
3
lab0/lab.py
Machinesaac/6.009
0
53803
<reponame>Machinesaac/6.009 #!/usr/bin/env python3 import math from PIL import Image as Image # NO ADDITIONAL IMPORTS ALLOWED! def get_pixel(image, x, y): a = x b = y if x < 0: a = 0 elif x > image['width'] - 1: a = image['width'] - 1 if y < 0: b = 0 elif y > imag...
3.71875
4
universal.py
threatspec/pythreatspec
10
53804
#!/usr/bin/env python import sys import json import re import logging from cli.log import LoggingApp from pythreatspec import pythreatspec as ts class UniversalParserApp(LoggingApp): def parse_file(self, filename): with open(filename) as fh: line_no = 1 for line in fh.readlines(): ...
2.484375
2
03_python/countup.py
nachrisman/PHY494
0
53805
<gh_stars>0 # countup.py # http://asu-compmethodsphysics-phy494.github.io/ASU-PHY494//2017/01/19/03_Introduction_to_Python_2/#the-while-loop tmax = 10. t, dt = 0, 2. while t <= tmax: print("time " + str(t)) t += dt print("Finished")
3.375
3
src/gradelib/run_notebooks.py
phaustin/gradelib
0
53806
""" execute a notebook file hierarchy run_notebooks orig_notebook_dir file_re run_notebooks autograded "lab_wk9*ipynb" """ from pathlib import Path import click from .utils import working_directory import shutil import nbformat from nbconvert.preprocessors import ExecutePreprocessor def run_file(notebook_file, resu...
2.5625
3
main.py
wpd-cs/Compliancy-Counter
0
53807
<gh_stars>0 # -*- coding: utf-8 -*- """ <NAME> Project started: July 12, 2021 <EMAIL> Last Updated: 11/15/2021 """ from sys import exit import datetime import csv import os class Patient: def __init__ (self, cwid, status, acadStatus = '', patientType = ''): """Initialize class data members""" self.cwid = cwid...
3
3
bot.py
Hifoz/TwitchBot
0
53808
""" Twitch bot TODO ( Soon™ ): * Check if user has mod/sub priviliges when using commands * Fetch moderator-list for channels from Twitch * Check that the bot actually connects to twitch and the channels on startup * Move commands.py and blacklist.py to json or something for easier ...
2.6875
3
osme/views.py
infolabs/django-osme
0
53809
<reponame>infolabs/django-osme # -*- coding: utf-8 -*- import json import requests import osm2geojson from django.core.cache import cache from django.http import HttpResponse from osme.models import Region REGIONS_DATA_URL = "https://www.openstreetmap.org/api/0.6/relation/" def regions_data_view(request, osm_id)...
2.265625
2
demo1.py
frica/blink1
0
53810
<reponame>frica/blink1 #!/usr/bin/env python """ blink1_tst -- simple demo of blink1 library You can also just run blink1_pyusb.py as a blink1-tool replacement """ import time from blink1.blink1 import Blink1 if __name__ == '__main__': blink1 = Blink1() if blink1.dev is None: print("no blink1 found...
2.8125
3
src/processing/__init__.py
13375P34Ker/speech_analytics
17
53811
from src.processing.audio_processor import AudioProcessor __all__ = ['AudioProcessor']
1.101563
1
y2020/d07.py
Square789/AoC
3
53812
<gh_stars>1-10 from aoc_input import get_input import aoc_helpers as ah import re from time import time DAY = 7 YEAR = 2020 SEARCHED_BAG = "shiny gold" BAG_EXP = re.compile(r"^(.*?) bags contain (.*)\.$") CAN_CONTAIN_EXP = re.compile("(\d+) (.*?) bag[s]?") class Bag: def __init__(self, color, holdable): self.co...
2.75
3
procstream/process/process_template.py
nipunbalan/procstream-kafka-python
0
53813
from abc import ABC, abstractmethod from kafka import KafkaProducer from kafka import KafkaConsumer import logging as logger import json import os logger.basicConfig(format='%(asctime)s|[%(levelname)s]|File:%(filename)s|' 'Function:%(funcName)s|Line:%(lineno)s|%(message)s') default_config = ...
2.578125
3
detect.py
clydedacruz/tf-object-detection
0
53814
<filename>detect.py import base64 import numpy as np from PIL import Image from PIL import ImageDraw import tensorflow as tf import sys try: from StringIO import StringIO except ImportError: from io import StringIO PATH_TO_CKPT = 'inference_graph\frozen_inference_graph.pb' PATH_TO_LABELS = 'inference_graph\la...
2.234375
2
game.py
Laterus/Onzozo
0
53815
#!/usr/local/bin/python3 import discord import asyncio import core.battle_lobby as battle_lobby from core.common import SERVSET CLIENT = discord.Client() @CLIENT.event async def on_ready(): print ('Logged in as '+CLIENT.user.name) await setup_battle_lobby() @CLIENT.event async def on_reaction_add(reaction, ...
2.375
2
tools/QueryAnalysis.py
Wikidata/QueryAnalysis
11
53816
import argparse import calendar from datetime import datetime import glob import os import shutil import subprocess import sys import gzip import unifyQueryTypes from utility import utility import config os.nice(19) months = {'january': [1, 31], 'february': [2, 28], 'march': [3, 31], 'ap...
2.390625
2
Advent2016_02b.py
MLCarey321/AdventOfCode2016
1
53817
#!/usr/bin/python3 import sys keyMap = {(0, 0): " ", (1, 0): " ", (2, 0): "1", (3, 0): " ", (4, 0): " ", (0, 1): " ", (1, 1): "2", (2, 1): "3", (3, 1): "4", (4, 1): " ", (0, 2): "5", (1, 2): "6", (2, 2): "7", (3, 2): "8", (4, 2): "9", (0, 3): " ", (1, 3): "A", (2, 3): "B", (3, 3): "C", (...
3.21875
3
app/main/routes.py
NickPTaylor/imbtools
0
53818
""" Blueprint for hello world. """ from flask import Blueprint from flask_login import login_required BP = Blueprint('main', __name__) @BP.route('/') @BP.route('/index') @login_required def index(): """ Say hello. :return: A greeting. :rtype: str """ return "Hello, world"
2.734375
3
app/local/collectors/mongodb.py
darkframemaster/learngit
1
53819
<gh_stars>1-10 #!/usr/bin/env python3 #-*- coding:utf-8 -*- import pymongo class Db(): def __init__(self, reponame, **kw): self.__connection = pymongo.MongoClient(**kw) self.__db = self.__connection[str(reponame)] def drop_commit(self): self.__db.drop_collection('commit') def drop_user(self): self.__d...
2.84375
3
Demo/mesh_npy3Dviewer.py
peiyan1234/PA_radiomics_research
0
53820
<reponame>peiyan1234/PA_radiomics_research try: import tkinter as tk except ImportError: import Tkinter as tk import tkinter.ttk as ttk import tkinter.font as tkfont from tkinter.filedialog import askopenfilename import matplotlib matplotlib.use("TkAgg") from matplotlib.backends.backend_tkagg import ...
1.882813
2
skip/migrations/0012_auto_20210430_1827.py
LCOGT/skip
0
53821
# Generated by Django 3.1 on 2021-04-30 18:27 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('skip', '0011_auto_20210430_1746'), ] operations = [ migrations.RemoveIndex( model_name='alert', name='alert_timestamp_...
1.625
2
adclassifier/clean_text.py
BoudhayanBanerjee/political-ad-classifier
2
53822
<filename>adclassifier/clean_text.py import os import re import time import requests def is_word(word): """ check from wikipedia if the input is a valid dictionary word """ resp = requests.get("http://en.wikipedia.org/w/api.php?action=query&prop=info&format=json&titles=" + word) if resp.statu...
3.234375
3
deadunits/data.py
google-research/deadunits
3
53823
<reponame>google-research/deadunits # coding=utf-8 # Copyright 2021 The Deadunits 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 #...
2.1875
2
XSModelManager/BatchIterCANTM.py
GateNLP/NN_Framework
0
53824
import math import random class BatchIterCANTM: def __init__(self, dataIter, batch_size=32, filling_last_batch=False, postProcessor=None): self.dataIter = dataIter self.batch_size = batch_size self.num_batches = self._get_num_batches() self.filling_last_batch = filling_last_batch ...
2.8125
3
setup.py
mindis/timeseries2redis
2
53825
<reponame>mindis/timeseries2redis #!/usr/bin/env python # -*- coding: utf-8 -*- VERSION = '0.1' # import sys import os from setuptools import setup, find_packages from setuptools.extension import Extension setup(name='timeseries2redis', version=VERSION, description='timeseries2redis', author='trbck...
1.164063
1
MyVisualizations/MyPrediction.py
ClownMonster/Covid-19_Visualization_ML
0
53826
<reponame>ClownMonster/Covid-19_Visualization_ML ''' The forecasting and prediction is done using Prophet, an aditive models with non-linear trends ''' # imports to get the Data of Confirmed, Death, Recovered Cases accross the globe from DataSupply import Supply import pandas as pd import matplotlib matplotlib.u...
2.84375
3
MIT/600.1x - Introduction to Computer Science and Programming Using Python/Unit 4/Problem Set 4/is_valid_word.py
henriqueumeda/-Python-study
0
53827
<gh_stars>0 wordList = ['quail'] def isValidWord(word, hand, wordList): """ Returns True if word is in the wordList and is entirely composed of letters in the hand. Otherwise, returns False. Does not mutate hand or wordList. word: string hand: dictionary (string -> int) wordList: list of l...
4.09375
4
piptui/app.py
MrNaif2018/PipTUI
0
53828
from .actionForms import InstallForm, UninstallForm, UpdateForm from .custom.apNPSApplicationEvents import PipTuiApp from .mainForm import MainForm class App(PipTuiApp): def onStart(self): self.MainForm = self.addForm("MAIN", MainForm) self.InstallForm = self.addForm( "INSTALL", Instal...
2.375
2
exercises/city_temperature_prediction.py
OmriBenbenisty/IML.HUJI
0
53829
<reponame>OmriBenbenisty/IML.HUJI from IMLearn.learners.regressors import PolynomialFitting from IMLearn.utils import split_train_test import numpy as np import pandas as pd import plotly.express as px import plotly.io as pio import plotly.graph_objects as go pio.templates.default = "simple_white" pio.renderers.defau...
3.296875
3
src/mealspot/urls.py
OrenBen-Meir/Meal-Spot
0
53830
<filename>src/mealspot/urls.py """mealspot URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', view...
2.6875
3
ncdjango/urls.py
consbio/ncdjango
6
53831
from importlib import import_module from django.conf import settings from django.conf.urls import include, url from django.core.exceptions import ImproperlyConfigured from tastypie.api import Api from .api import TemporaryFileResource, ServiceResource, VariableResource from .views import TemporaryFileUploadFormView, ...
2.046875
2
utils/misc.py
haofeixu/gmflow
58
53832
<gh_stars>10-100 import os import numpy as np import sys import json def read_text_lines(filepath): with open(filepath, 'r') as f: lines = f.readlines() lines = [l.rstrip() for l in lines] return lines def check_path(path): if not os.path.exists(path): os.makedirs(path...
2.46875
2
fastNLP/modules/encoder/embedding.py
JerrikEph/fastNLP
1
53833
__all__ = [ "Embedding" ] import torch.nn as nn from ..utils import get_embeddings class Embedding(nn.Embedding): """ 别名::class:`fastNLP.modules.Embedding` :class:`fastNLP.modules.encoder.embedding.Embedding` Embedding组件. 可以通过self.num_embeddings获取词表大小; self.embedding_dim获取embedding的维度""" d...
2.5625
3
webapp/parse_vod_info.py
sesic/stockstream.live
6
53834
import sys import json import datetime import stockstream import os records = [] i = 0 files = os.listdir("rechat") for f in files: """if i < 3: i += 1 continue""" records += json.loads(open("rechat/" + f).read()) print "Loaded {} now have {} records.".format(f, len(records)) i += 1 ...
2.546875
3
src/map_viewer.py
europe-gis/br-map-viewer
0
53835
import base64 import io from matplotlib import pyplot import numpy as np import rasterio def read_raster_file(input_fn, band = 1): with rasterio.open(input_fn) as src: return src.read(band) def plot_raster_layer(input_fn, band = 1, from_logits = True): pyplot.figure(figsize = (10,10)) data ...
2.796875
3
server/localfinance/mapnik_render.py
regardscitoyens/nosfinanceslocales
1
53836
<reponame>regardscitoyens/nosfinanceslocales #!/usr/bin/env python from math import pi,sin,log,exp,atan import os from Queue import Queue import threading import json import mapnik DEG_TO_RAD = pi/180 RAD_TO_DEG = 180/pi # Default number of rendering threads to spawn, should be roughly equal to number of CPU cores ...
2.3125
2
build/lib/topsis/__main__.py
sanyam9/TOPSIS-pypi-package
1
53837
def main(): import pandas as pd import sys if len(sys.argv) != 5: sys.exit("Error: Incorrect Number of arguments\nDesired Syntax: topsis <inputDataFile> <weights> <impacts> <outputFileName>") try: df = pd.read_csv(sys.argv[1]) except: sys.exit("Error: File not Found...
3.109375
3
day 01/Martijn - Python/solution_pandas.py
AE-nv/aedvent-code-2021
1
53838
import pandas as pd data = pd.read_csv(r'./input.txt', sep=',', header=None) data.columns = ['depth'] diff_single = data.diff() count = diff_single.loc[diff_single['depth'] > 0] nb_increased = count.shape[0] print(nb_increased) # Calculate sum of window quick and dirty data['depth_1'] = data['depth'].shift(-1) data...
2.9375
3
setup.py
Yooootsuba/bahamut-exporter
2
53839
<reponame>Yooootsuba/bahamut-exporter from setuptools import setup, find_packages from bahamutexporter.core.version import get_version VERSION = get_version() f = open('README.md', 'r') LONG_DESCRIPTION = f.read() f.close() setup( name='bahamutexporter', version=VERSION, description='Exports floors and ...
1.507813
2
src/reddit_controller.py
YrrepNoj/RedditSummarizer
0
53840
#!/usr/bin/env python """Utility made using the PRAW library to get saved Reddit Submissions from a users account.""" import logging.config import praw import smmry_wrapper from account_info import * logging.basicConfig(filename="app.log", filemode="a", format="%(asctime)s - %(filename)s - %(leve...
2.765625
3
powerfit/powerfit.py
WangXinyan940/powerfit
16
53841
<gh_stars>10-100 #! ../env/bin/python from __future__ import absolute_import, division from os.path import splitext, join, abspath from os import makedirs from sys import stdout, argv from time import time from argparse import ArgumentParser, FileType import logging from powerfit import ( Volume, Structure, str...
1.898438
2
docs_build/tutorials_templates/task_workflows/qa/create_a_new_qa_task/mds.py
dataloop-ai/sdk_examples
3
53842
def func1(): """ ## Create a QA Task To reach the tasks and assignments repositories go to <a href="https://sdk-docs.dataloop.ai/en/latest/repositories.html#module-dtlpy.repositories.tasks" target="_blank">tasks</a> and <a href="https://sdk-docs.dataloop.ai/en/latest/repositories.html#module-dtlpy.reposito...
2.6875
3
utils.py
ibuki2003/oj_judger
0
53843
<filename>utils.py import sys import configparser import subprocess def kill_child_processes(process): if sys.platform.startswith('win'): # p.kill() doesn't seem to kill the child processes on Windows subprocess.run(['TASKKILL', '/F', '/T', '/PID', str(process.pid)], stdout=subprocess.DEVNULL) ...
2.203125
2
pardal/api/__init__.py
anapaulagomes/pardal-python
2
53844
<reponame>anapaulagomes/pardal-python import os from pardal import get_logger __all__ = ('api',) logger = get_logger(__name__) def get_twitter_api(): is_testing = os.getenv('FAKE_TWITTER_API', 'True') consumer_key = os.getenv('CONSUMER_KEY', 'xxx') consumer_secret = os.getenv('CONSUMER_SECRET', 'yyy') ...
2.546875
3
ProofOfConcepts/Vision/OpenMvStereoVision/src/target_code/get_calibration_images_remote_side.py
WoodData/EndpointAI
190
53845
import image, network, rpc, sensor, struct import time import micropython from pyb import Pin from pyb import LED red_led = LED(1) green_led = LED(2) blue_led = LED(3) ir_led = LED(4) def led_control(x): if (x&1)==0: red_led.off() elif (x&1)==1: red_led.on() if (x&2)==0: green_led.off() eli...
2.84375
3
launcher.py
fe-amazu/amazusystem
2
53846
<gh_stars>1-10 import asyncio import pathlib import traceback from discord import Intents from discord.ext import commands import constant from database import Database class MyBot(commands.Bot): def __init__(self, loop): super().__init__( command_prefix=commands.when_mentioned_or("!"), ...
2.28125
2
numpyro/callbacks/history.py
ahmadsalim/numpyro
3
53847
<gh_stars>1-10 from numpyro.callbacks import Callback class History(Callback): def __init__(self): super().__init__() self.training_history = [] self.validation_history = [] def on_train_begin(self, train_info): self.training_history.append(train_info['loss']) def on_trai...
2.296875
2
src/web/migrations/0003_movie_mean_rate.py
ncthanhcs/backend
0
53848
<filename>src/web/migrations/0003_movie_mean_rate.py # Generated by Django 2.0.12 on 2020-06-30 08:31 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('web', '0002_auto_20200630_1111'), ] operations = [ migra...
1.710938
2
UGI/LayerPositions.py
protimient/Glyphs-Scripts
2
53849
import math import re from collections import defaultdict from GlyphsApp import Glyphs, OFFCURVE, GSLayer from Foundation import NSPoint class layerPositions: def __init__(self, l, all_indic_headlines=None): self.layer = l self.layer_flat = l.copyDecomposedLayer() self.layer_flat.removeOv...
2.109375
2
bpar.py
kimvais/kiehinen
1
53850
# # http://www.angelfire.com/ego2/idleloop/archives/mbp_file_format.txt # # FMT = '>4sIiIIIiIiBBBBiiiiII' FMT = '>4sIiH2BIIiI8B4i2I' TYPES = ('DATA', 'BKMK', 'PUBL', 'COVE', 'CATE', 'ABST', 'GENR', 'TITL', 'AUTH') TAGS = ('EBAR', 'EBVS', 'ADQM') import glob import struct from . import palm for f in (glob.gl...
2.375
2
textclf/tester/__init__.py
lswjkllc/textclf
146
53851
<gh_stars>100-1000 from .ml_tester import MLTester from .dl_tester import DLTester
1.007813
1
cvm/commands/command.py
composer-version-manager/cvm
1
53852
<gh_stars>1-10 from abc import ABC, abstractmethod from argparse import Action, Namespace class Command(ABC): @abstractmethod def exec(self, args: Namespace) -> None: pass @staticmethod @abstractmethod def define_signature(parser: Action): pass
2.671875
3
testapps/PY/test_partial.py
naver/pinpoint-c-agent
178
53853
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: UTF-8 -*- from pinpointPy.CommonPlugin import PinpointCommonPlugin @PinpointCommonPlugin( __name__+".func1") def func1(a, b="Wool"): return a + b
2
2
CursoEmVideo/ex049.py
ElivanLimaJunior/Python
0
53854
n1 = int(input('Digite um número para exibir sua tabuada: ')) for c in range(1, 10+1): print('{} x {} = {}'.format(n1, c, n1*c))
3.796875
4
Q2/Q2d.py
sharique1006/Neural-Network
0
53855
<filename>Q2/Q2d.py<gh_stars>0 import numpy as np import sys from Q2a import * x_train = np.load('../kannada_digits/neural_network_kannada/X_train.npy') y_train = np.load('../kannada_digits/neural_network_kannada/y_train.npy') x_test = np.load('../kannada_digits/neural_network_kannada/X_test.npy') y_test = np.load('.....
2.734375
3
rest_tools/client/session.py
dsschult/rest-tools
1
53856
<filename>rest_tools/client/session.py<gh_stars>1-10 """Get a `requests`_ Session that fully retries errors. .. _requests: http://docs.python-requests.org """ # fmt:off # pylint: skip-file from typing import Iterable import requests from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry...
2.625
3
emr/simple_test.py
kgskgs/stars-spark3d
0
53857
<reponame>kgskgs/stars-spark3d<filename>emr/simple_test.py<gh_stars>0 import numpy as np from pyspark.context import SparkContext from pyspark.sql.session import SparkSession from pyspark.sql.types import * from pyspark.sql.functions import udf import pyspark.sql.functions as f from math import sqrt from scipy.cons...
2.375
2
team1/sca_test.py
NCBI-Codeathons/RAPID-EVALUATION-OF-STATISTICAL-STRATEGIES-FOR-PREDICTING-INTERACTIONS-AND-INFORMATION-TRANSFER-BETW
0
53858
#!/bin/python #sca_test.py import matplotlib.pyplot as plt import coevo2 as ce import itertools as it import numpy as np import copy import time reload(ce) names = ['glgA', 'glgC', 'cydA', 'cydB'] algPath = 'TestSet/eggNOG_aligns/slice_0.9/' prots = ce.prots_from_scratch(names,path2alg=algPath) ps = ce.ProtSet(prots...
1.929688
2
loader.py
jisantuc/HPDMinorityReport
0
53859
<reponame>jisantuc/HPDMinorityReport<gh_stars>0 import pandas as pd class DataLoader(object): def __init__(self, complaint_fname, weather_fname): self.fname = fname self.cols = map( lambda x: x.proper(), ['unique key', 'created date', 'closed date', 'agency', 'agency ...
2.78125
3
src/py_docker_k8s_tasks/docker_tasks.py
gnarvaja/inv-py-docker-k8s-tasks
2
53860
import os import re import requests from invoke import task def _get_aws_token(c): token = os.getenv("AWS_TOKEN") if not token: token = c.run("aws ecr get-authorization-token --output text " "--query 'authorizationData[].authorizationToken'", hide=True).stdout.strip() return ...
2.484375
2
mail_to/tests/test_default.py
aaltinisik/mail-addons
0
53861
<filename>mail_to/tests/test_default.py<gh_stars>0 # Copyright 2018 <NAME> <https://it-projects.info/team/yelizariev> # Copyright 2018 <NAME> <https://it-projects.info/team/ArtyomLosev> # Copyright 2019 <NAME> <https://it-projects.info/team/KolushovAlexandr> # License LGPL-3.0 (https://www.gnu.org/licenses/lgpl.html). ...
2.03125
2
1020.Partition-Array-Into-Three-Parts-With-Equal-Sum.py
mickey0524/leetcode
18
53862
# https://leetcode.com/problems/partition-array-into-three-parts-with-equal-sum/ # Easy (47.22%) # Total Accepted: 2,951 # Total Submissions: 6,250 # beats 100.0% of python submissions class Solution(object): def canThreePartsEqualSum(self, A): """ :type A: List[int] :rtype: bool ...
3.5
4
actions/collection_create.py
nzlosh/stackstorm_mongodb
1
53863
from lib.base import MongoClientAction class CollectionCreate(MongoClientAction): """ Create a new collection in a database. """ def run(self, db_name, name, profile_name=None): super().run(profile_name) res = self.collection_create(db_name, name) return (res.success, res.re...
2.71875
3
sudssigner/plugin.py
martingalloar/SudsSigner
0
53864
#!/usr/bin/env python from __future__ import with_statement from suds.plugin import MessagePlugin from lxml import etree from suds.bindings.binding import envns from suds.wsse import wsuns, dsns, wssens from libxml2_wrapper import LibXML2ParsedDocument from xmlsec_wrapper import XmlSecSignatureContext, init_xmlsec, de...
2.09375
2
2015/day_05/5_1.py
sunjerry019/adventOfCode18
0
53865
#!/usr/bin/env python3 import re inputFile = open("5.in",'r') inputContents = inputFile.readlines() def isNice(_str): v = [ord(c) for c in _str if c in "aeiou"] repeated = re.search(r'([a-z])\1{1,}', _str) forbidden = re.search(r'(ab|cd|pq|xy)', _str) return (len(v) >= 3) and (repeated is not None) a...
3.359375
3
xnat_dashboards/tests/test_graph_generator.py
XNAT-Dashboards/XNAT-Dashboards
0
53866
from xnat_dashboards.data_cleaning import graph_generator from xnat_dashboards import config config.DASHBOARD_CONFIG_PATH = 'xnat_dashboards/config/dashboard_config.json' config.PICKLE_PATH = 'xnat_dashboards/config/general.pickle' def create_mocker( mocker, username, data, role, graph_visibility, return_get_pr...
2.28125
2
app/handlers/auth.py
esert/rabbitlol
2
53867
<filename>app/handlers/auth.py from app.oauth import ( oauth_services, set_oauth_state, verify_oauth_state, ) from app.commands import Commands from app.routes import ( COMMANDS, HOME, OAUTH_CALLBACK, OAUTH_INITIATE, PICK_COMMANDS, SIGN_IN, SIGN_OUT, ) from app.user import User f...
2.390625
2
network-client/src/gmu/chord/MessageCache.py
danfleck/Class-Chord
1
53868
''' Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Created on Apr 9, 2014 @author: dfleck ''' class MessageCache(list): ''' Holds a list of tuples (envelope, message) ''' def __contains__(self, otherEnvelope): #print("\...
2.65625
3
web_api/yonyou/apis/sale_invoice_items.py
zhanghe06/flask_restful
1
53869
<gh_stars>1-10 #!/usr/bin/env python # encoding: utf-8 """ @author: zhanghe @software: PyCharm @file: sale_invoice_items.py @time: 2018-07-24 16:47 """ from libs.mysql_orm_op import DbInstance from web_api.databases.yonyou import db from web_api.models.yonyou import SASaleInvoiceB db_instance = DbInstance(db) def...
2.25
2
util/logging.py
PJunhyuk/exercise-pose-guide
161
53870
<reponame>PJunhyuk/exercise-pose-guide import logging def setup_logging(): FORMAT = '%(asctime)-15s %(message)s' logging.basicConfig(filename='log.txt', filemode='w', datefmt='%Y-%m-%d %H:%M:%S', level=logging.INFO, format=FORMAT) console = logging.StreamHan...
2.234375
2
programming raspberrypi using dweet/my_dweet.py
Hesham87/python_iot
0
53871
import pigpio import signal import requests import logging import json import os import sys import threading from time import sleep from uuid import uuid1 # Global variables BUTTON_GPIO = 23 LED_GPIO = 21 is_blinking = False pi = pigpio.pi() dweetFile = 'dweet_name.txt' dweetURL = 'https://dweet.io' # States stateON ...
2.96875
3
presamples/packaging.py
tngTUDOR/presamples
9
53872
<reponame>tngTUDOR/presamples from copy import deepcopy from pathlib import Path import json import numpy as np import os import shutil import uuid import copy import warnings from .errors import InconsistentSampleNumber, ShapeMismatch, NameConflicts from .utils import validate_presamples_dirpath, md5 try: from b...
2.40625
2
pygui/widget/editor/tabbed_textpad.py
clark3493/pygui
0
53873
import os import tkinter as tk from .textpad import TextPad from ..tab_view import AbstractTabView class TabbedTextpad(AbstractTabView): NEW_TAB_BASENAME = "new%d" def __init__(self, parent, *args, **kwargs): super().__init__(parent, *args, **kwargs) self.set_options() self.ad...
3.078125
3
graphics/input/initial_data_set_picker_f.py
iliesidaniel/image-classification
0
53874
from utils.data_set.classes_correlation_between_data_sets import ClassesCorrelationBetweenDataSets from utils.data_set.initial_data_set import InitialDataSet from graphics.input.class_identifiers_input_f import ClassIdentifiersInputF from graphics.widgets.qna_f import QnAF from tkinter import filedialog from tkinter ...
2.734375
3
build/lib/npd_wraper/npd_fields.py
miroine/npd_data
6
53875
from .npd_wraper import npd from datetime import datetime import pandas as pd class field(npd): def get_field_production_monthly(self): ''' get monthly production ''' url_dataset=self.npd_path+"field/production-monthly-by-field" df = self._get_dataframe_data(url_dataset) ...
2.71875
3
tests/test_strblackout.py
jojoee/strblackout
2
53876
import unittest from strblackout import blackout class TestBlackout(unittest.TestCase): def test_blackout_default(self): self.assertEqual(blackout("123456789"), "123456789") def test_blackout_left(self): self.assertEqual(blackout("123456789", left=5), "*****6789") def test_blackout_right...
3.25
3
dpscalc.py
LucasMolander/WoW-DPS-Calculator
0
53877
<reponame>LucasMolander/WoW-DPS-Calculator # # Contains the classes that calculate the DPS for each spec. :) # from stats import Stats from abc import ABC, abstractmethod class DPSCalc(ABC): def __init__(self): pass @abstractmethod def calculate(self, stats): """ ...
2.859375
3
examples/gee_example.py
lforesta/openeo-python-client
0
53878
<filename>examples/gee_example.py<gh_stars>0 import openeo import logging import time import json from openeo.auth.auth_bearer import BearerAuth logging.basicConfig(level=logging.INFO) GEE_DRIVER_URL = "https://earthengine.openeo.org/v0.4" OUTPUT_FILE = "/tmp/openeo_gee_output.png" user = "group1" password = "<PAS...
2.15625
2
src/PythonUnitTests/ArrayCreationTests.py
Quansight-Labs/numpy.net
59
53879
<gh_stars>10-100 import unittest import numpy as np import time as tm import matplotlib.pyplot as plt from nptest import nptest import operator class ArrayCreationTests(unittest.TestCase): def test_PrintVersionString(self): print(np.__version__) def test_simpleShape_1(self): a=np.array([1,2,3...
2.625
3
DataScience/python/td_query/test/test_data_manipulate.py
Ernestyj/PyStudy
1
53880
# -*- coding: utf-8 -*- import unittest import os import pickle import pandas as pd import numpy as np from td_query import ROOT_PATH from td_query.data_manipulate import data_manipulate_instance as instance from teradata import UdaExec class TestDataManipulate(unittest.TestCase): @classmethod def setUpClass...
2.46875
2
relaax/server/common/bridge/metrics_bridge_server.py
deeplearninc/relaax
71
53881
<filename>relaax/server/common/bridge/metrics_bridge_server.py<gh_stars>10-100 from __future__ import absolute_import from builtins import object import concurrent import grpc from . import bridge_pb2 from . import bridge_message class MetricsBridgeServer(object): def __init__(self, bind, metrics_server): ...
2.390625
2
api/management/commands/runapi.py
ishmam-hossain/django-rest-telenor
0
53882
<reponame>ishmam-hossain/django-rest-telenor<filename>api/management/commands/runapi.py from django.core.management.base import BaseCommand from subprocess import Popen from sys import stdout, stdin, stderr import time class Command(BaseCommand): help = 'Single command app start' commands = [ 'pip in...
2.015625
2
WIMLib/Resources/Result.py
jknewson/WiMLib
0
53883
<reponame>jknewson/WiMLib #------------------------------------------------------------------------------ #----- Result.py -------------------------------------------------------------- #------------------------------------------------------------------------------ # # copyright: 2016 WiM - USGS # # authors: <NAM...
1.976563
2
mep/common/migrations/0007_add_data_viewer_group.py
making-books-ren-today/test_eval_3_shxco
3
53884
<filename>mep/common/migrations/0007_add_data_viewer_group.py # Generated by Django 2.2.11 on 2020-03-11 18:30 from django.contrib.auth.management import create_permissions from django.db import migrations data_viewer_perms = { 'accounts': [ 'view_account', "view_address", 'view_accountadd...
1.960938
2
add_adex.py
amyli127/thesis
0
53885
import csv adex_info = {} # map from ticker to line of adex info url_to_ticker = {} # dict from url to ticker HEADER = "Url,Date,PageviewsPerMillion,PageviewsPerUser,Rank,ReachPerMillion,gvkey,datadate,fyear,tic,conm,curcd,revt,sale,xad,exch\n" # populate adex info with open("data/ad-ex/batch2.csv", ...
2.9375
3
zaqar-8.0.0/zaqar/tests/unit/transport/websocket/base.py
scottwedge/OpenStack-Stein
97
53886
# Copyright (c) 2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy # of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
1.65625
2
listings/chapter04/month_calendar.py
SaschaKersken/Daten-Prozessanalyse
2
53887
<filename>listings/chapter04/month_calendar.py from datetime import date from sys import argv if len(argv) > 2: year = int(argv[1]) month = int(argv[2]) if len(argv) > 3: day = int(argv[3]) else: day = 1 else: today = date.today() day = today.day month = today.month year...
3.90625
4
udkanbun/__init__.py
xlr10/UD-Kanbun
42
53888
from .udkanbun import UDPipeEntry,UDKanbunEntry,UDKanbun,load,PACKAGE_DIR
1.039063
1
token_server.py
shangyexin/wechat-token-server
10
53889
<filename>token_server.py #!/usr/bin/env python # -*- coding: utf-8 -*- # @author : yasin # @time : 11/20/18 7:30 PM # @File : token_server.py import tornado.ioloop import tornado.web import tornado.httpclient import tornado.httputil import tornado.gen import redis import traceback import json import config from ...
2.171875
2
python/ql/test/3/library-tests/PointsTo/regressions/subprocess-assert/mwe_failure.py
vadi2/codeql
4,036
53890
<reponame>vadi2/codeql<filename>python/ql/test/3/library-tests/PointsTo/regressions/subprocess-assert/mwe_failure.py import subprocess assert subprocess.call(['run-backup']) == 0 class TestCase: pass class MyTest(TestCase): pass # found by /home/rasmus/code/ql/python/ql/test/query-tests/Statements/asserts/As...
2.078125
2
backend/Backendapi/douban/serializers.py
f0rdream/SkyRead
0
53891
<reponame>f0rdream/SkyRead<filename>backend/Backendapi/douban/serializers.py<gh_stars>0 from rest_framework.response import Response from rest_framework.serializers import ( SerializerMethodField, ModelSerializer, ValidationError, DateTimeField, CharField, IntegerField, ) from .mo...
2.25
2
Utilities/calculate_embeddings.py
noah-hoffmann/CGAT
0
53892
<gh_stars>0 import pickle import gzip as gz from argparse import ArgumentParser from CGAT.lightning_module import LightningModel, collate_fn from CGAT.data import CompositionData from torch.utils.data import DataLoader import os from glob import glob import torch from tqdm import tqdm def load(file): return pickl...
2.28125
2
messaging/messaging_app/urls.py
kmvicky/messaging
0
53893
<gh_stars>0 import messaging_app.views as views from django.urls import include, path, re_path app_name = 'messaging_app' urlpatterns = [ path('login/', views.Login.as_view(), name='login'), path('logout/', views.Logout.as_view(), name='logout'), path('register-user/', views.RegisterUser.as_view...
1.96875
2
vjudge_interface/requests/request.py
Quinas/vjudge-interface
0
53894
class Request: def __init__(self): self.timeout = 5000 def get_params(self): return {} def get_body(self): return {}
2.296875
2
loan_calculator_v02.py
SeanRavenhill/Loan-Calculator
0
53895
import math import sys import argparse parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, description=("""This loan calculator can compute the following. \ \n----------------------------------------------- - Your loans annuity monthly payment amount. - Your number of mo...
3.6875
4
others/sumColumnPerDay.py
mvarona/CoViDCyL
0
53896
<filename>others/sumColumnPerDay.py import csv # Constants and global variables: # Functions: def getColumnNumAndColumnDate(): column = "" columnDate = "" print("Bienvenido a un sumador de columnas por día para un archivo CSV") column = int(input("Introduce el número de columna que quieres sumar (empezando a co...
3.734375
4
pyboleto/bank/banese.py
thiagosm/pyboleto
14
53897
# -*- coding: utf-8 -*- from ..data import BoletoData, CustomProperty from decimal import Decimal class BoletoBanese(BoletoData): agencia_cedente = CustomProperty('agencia_cedente',2) conta_cedente = CustomProperty('conta_cedente', 9) nosso_numero = CustomProperty('nosso_numero', 9) def __init__(self...
2.90625
3
Prediction/test/main_0.py
Rukaume/LRCN
1
53898
<reponame>Rukaume/LRCN #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Oct 10 21:21:05 2020 @author: miyazakishinichi 設計 連続するビデオデータを入力とする numpyバイナリへの変換, モデルによる予測, 結果の出力 ジャンプの時間帯の抽出とビデオ化 →ハードネガティブマイニング?? """ import tkinter as tk import tkinter.ttk as ttk from tkinter import filedialog from tkinter...
2.375
2
v2x_solution/event/urls.py
Michaelwwgo/V2X_Project
1
53899
<filename>v2x_solution/event/urls.py from django.urls import path from . import views app_name = 'events' urlpatterns = [ path('', views.Events.as_view(), name='events'), path('<int:event_id>', views.ModerateEvent.as_view(), name='moderate_events'), path('search/', views.Search.as_view(), name='Search'), ...
1.796875
2