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 |
|---|---|---|---|---|---|---|
python/ABC/167/b.py | KATO-Hiro/atcoder-1 | 0 | 12791951 | <filename>python/ABC/167/b.py
import sys
input = sys.stdin.readline
def main():
A, B, C, K = map(int, input().split())
if K <= A:
ans = K
elif K <= A + B:
ans = A
else:
ans = A - (K - (A + B))
print(ans)
if __name__ == "__main__":
main()
| 3.09375 | 3 |
tuttle/process.py | lexman/tuttle | 26 | 12791952 | <reponame>lexman/tuttle
# -*- coding: utf8 -*-
from time import time
class Process:
""" Class wrapping a process. A process has some input resources, some output resources,
some code that produces outputs from inputs, a processor that handle the language specificities
"""
def __init__(self, process... | 2.96875 | 3 |
data/scrape/link_extractors/__init__.py | jamesrharwood/journal-guidelines | 0 | 12791953 | from .extractors import extract_links, extract_links_by_strategy
| 1.09375 | 1 |
monitor_and_notify.py | System-Exit/IoT-Climate | 0 | 12791954 | #!/usr/bin/env python3
import requests
import json
import sqlite3
import sense_hat
import time
from pushbullet_api import PushbulletAPI
from climate_util import ClimateUtil
# Monitor and notification class
class MonitorNotifier:
def __init__(self, databaseName):
# Get sense hat access
self.__sense... | 2.9375 | 3 |
core/models/ipagnn.py | google-research/runtime-error-prediction | 10 | 12791955 | <reponame>google-research/runtime-error-prediction
# Copyright (C) 2021 Google 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 r... | 1.570313 | 2 |
rock/text.py | rockstack/rock | 1 | 12791956 | from __future__ import unicode_literals
def _(text):
return text.strip('\n')
USAGE = _("""
Usage: rock [--help] [--env=ENV] [--path=PATH] [--runtime=RUNTIME] command
""")
HELP = _("""
--help show help message
--verbose show script while running
--dry-run show script without r... | 2.515625 | 3 |
modules/2.79/bpy/types/TextureNodeCurveRGB.py | cmbasnett/fake-bpy-module | 0 | 12791957 | <reponame>cmbasnett/fake-bpy-module
TextureNodeCurveRGB.mapping = None
| 0.949219 | 1 |
gui/status_bar.py | myrmarachne/minesweeper | 0 | 12791958 | import Tkinter as tk
class StatusBar:
def __init__(self, root, label):
self.label = tk.StringVar()
self.label.set(label)
self.root = root
self.initialize()
def initialize(self):
frame = tk.Frame(self.root, relief=tk.SUNKEN)
label = tk.Label(frame, font=('arial'... | 3.359375 | 3 |
variant-calling/gatk/gatk.py | gis-rpd/pipelines | 25 | 12791959 | #!/usr/bin/env python3
"""{PIPELINE_NAME} pipeline (version: {PIPELINE_VERSION}): creates
pipeline-specific config files to given output directory and runs the
pipeline (unless otherwise requested).
"""
# generic usage {PIPELINE_NAME} and {PIPELINE_VERSION} replaced while
# printing usage
#--- standard library imports... | 1.953125 | 2 |
backend/app/seeds/palettes.py | saadjs/Color.ly | 3 | 12791960 | <filename>backend/app/seeds/palettes.py
from app.models import db, User, Palette
def seed_palettes():
canadian = Palette(title='Metalics',
colors=[
{"name": "Jigglypuff", "color": "#ff9ff3"},
{"name": "Casandora Yellow", "col... | 2.3125 | 2 |
Station.py | kriete/AutomaticSocibQcRecheck | 0 | 12791961 | <filename>Station.py
from utils import *
from netCDF4 import Dataset
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
formatter = logging.Formatter('[%(asctime)s] p%(process)s %(lineno)d - %(name)s - %(levelname)s - %(message)s', '%m-%d %H:%M:%S')
handler.setFormatter(formatte... | 2.453125 | 2 |
packages/functional/extract_vol.py | justi/m2g | 12 | 12791962 | #!/usr/bin/env python
# Copyright 2015 Open Connectome Project (http://openconnecto.me)
#
# 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.4375 | 2 |
galileo/WildSnakePy/WildSnake.py | garoa/dojo-shield | 8 | 12791963 | <filename>galileo/WildSnakePy/WildSnake.py
"""
WildSnakePy - WildSnakeUNO ported to Galileo (mraa native API)
A two-segment snake slithers aimlessly over the display. On intersections,
the next step is chosen at random.
Most of the logic is encoded in the `moves` array which lists possible next
steps for each cu... | 3.4375 | 3 |
test/testGraphGrid.py | KodeWorker/CircuitRouter | 0 | 12791964 | # -*- coding: utf-8 -*-
""" Unit Test On Grid
description:
This is the unit test for basic grid.
content:
- TestGrid
- TestGrid8D
author: Shin-Fu (<NAME>
latest update:
- 2019/05/10
- 2019/05/14 add TestGridDB
- 2019/05/15 add test_case for DynamicBoundGridWithShortcuts
"""
import ... | 3.109375 | 3 |
check_hbase_regionservers_requests_balance.py | adolci/nagios-plugins | 0 | 12791965 | #!/usr/bin/env python
# vim:ts=4:sts=4:sw=4:et
#
# Author: <NAME>
# Date: 2018-07-13 22:46:34 +0100 (Fri, 13 Jul 2018)
#
# https://github.com/harisekhon/nagios-plugins
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn
# and optionally... | 1.640625 | 2 |
main.py | standbit/Comics-publisher | 0 | 12791966 | import os
import random
from os.path import splitext
from urllib.parse import urlparse
import requests
from dotenv import load_dotenv
def get_file_extension(link):
link_path = urlparse(link).path
extension = splitext(link_path)[-1]
return extension
def get_last_comic_num():
url = "https://xkcd.com/... | 3.09375 | 3 |
fitbox/consultas/admin.py | ravellys/fitbox | 0 | 12791967 | # Register your models here.
from django.contrib.admin import register, ModelAdmin
from fitbox.consultas.models import Consulta
@register(Consulta)
class ConsultaAdmin(ModelAdmin):
list_filter = ('paciente',)
prepopulated_fields = {'slug': ('descricao', )}
| 1.765625 | 2 |
naughty_string_validator/__init__.py | sachinpali146/naughty_string_validator_python | 0 | 12791968 | __author__ = '<NAME>'
__email__ = '<EMAIL>'
__version__ = '0.1.0'
from .naughty_string_validator import NaughtyStringValidator, SRC_DIRECTORY
| 1.210938 | 1 |
src/model/config.py | aphostrophy/simplexity-AI | 0 | 12791969 | <filename>src/model/config.py<gh_stars>0
from src.constant import ShapeConstant
class Config:
"""
Class representation for configuration needed in game
[ATTRIBUTES]
row: int -> boards configuration row shape
col: int -> boards configuration column shape
game_type: int (Look at Gam... | 2.921875 | 3 |
api/listings.py | derKiez/kiezBackend | 0 | 12791970 | <filename>api/listings.py
import datetime
from bson import ObjectId
from flask import Response, request
from utils import json_encode
from flask.views import MethodView
from models.listings import Listing, ListingComment
from auth import authorize
class ListingsView(MethodView):
@authorize
def get(self):
... | 2.53125 | 3 |
leetcode/e_374.py | mmore21/competitive | 0 | 12791971 | <reponame>mmore21/competitive<filename>leetcode/e_374.py
"""
Problem: 374 - Guess Number Higher or Lower
Difficulty: Easy
URL: https://leetcode.com/problems/guess-number-higher-or-lower/
"""
class Solution:
def guessNumber(self, n: int) -> int:
lo = 0
hi = n
while lo <= hi:
... | 3.28125 | 3 |
lexer.py | billyeatcookies/Avocado | 1 | 12791972 | from tokens import Token, TokenType
whitespace = " \n\t"
digits = "0123456789"
class Lexer:
def __init__(self, code):
self.source = code + '\n'
self.cur_char = None
self.cur_pos = -1
self.advance()
def advance(self, pos=1):
self.cur_pos += pos
try:
... | 3.5 | 4 |
clear.py | tanaka-yoshi10/desk-calendar | 0 | 12791973 | #!/usr/bin/python3
import sys
import os
libdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'epd')
if os.path.exists(libdir):
sys.path.append(libdir)
import epd7in5_V2
epd = epd7in5_V2.EPD()
epd.init()
epd.Clear()
epd.sleep()
print("e-Paper clear & sleep done.") | 1.953125 | 2 |
modules/SIGA/formats/compressed/fm_gzip.py | naaya17/carpe | 56 | 12791974 | <reponame>naaya17/carpe
# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
from pkg_resources import parse_version
from modules.SIGA.kaitaistruct import __version__ as ks_version, KaitaiStruct, KaitaiStream, BytesIO
from enum import Enum
if parse_version(ks_version) < ... | 1.992188 | 2 |
src/CIL.py | Tigre-Buti/cool-compiler-2020 | 0 | 12791975 | class CILObject:
pass
class CILInstructionNode:
def __init__(self,destination=None, params=[]):
self.destination=destination
self.params=params
def instructionPrint(self):
print(str(type(self))+" "+str(self.destination)+"<-"+str(self.params))
class CILTypeCheck(CILInstruct... | 2.6875 | 3 |
input.py | aidan-clyens/Simple_Digit_Recognition | 0 | 12791976 | from trainer import Trainer
import os
import sys
if __name__ == '__main__':
# Create a Trainer object
contour_area_threshhold = 60
crop_width = 50
crop_height = 50
crop_margin = 5
trainer = Trainer(contour_area_threshhold, crop_width, crop_height, crop_margin)
# User must enter at least on... | 3.40625 | 3 |
ioc_scanner_test.py | BlackSquirrelz/ioc_detektor | 0 | 12791977 | <reponame>BlackSquirrelz/ioc_detektor
#!/usr/bin/venv python3
# -*- coding: utf-8 -*-
# ioc_scanner_test.py
# Author: BlackSquirrelz
# Date: 2021-03-10
# Description: Script to get IP Addresses from Files, and compares them to known IOCs.
# Unit Testing for IOC Scanner.
# Import Statements
from unittest import TestC... | 2.796875 | 3 |
loginpass/azure.py | kairichard/loginpass | 0 | 12791978 | <filename>loginpass/azure.py<gh_stars>0
"""
loginpass.azure
~~~~~~~~~~~~~~~
Loginpass Backend of Azure AD.
:copyright: (c) 2018 by <NAME>
:license: BSD, see LICENSE for more details.
"""
from ._core import UserInfo, OAuthBackend, parse_id_token
_BASE_URL = 'https://login.microsoftonline.com/'
... | 2.015625 | 2 |
pythonfile/theoretic_graphs.py | penguinoneshaw/MPhysProject | 0 | 12791979 | <gh_stars>0
#!/usr/bin/env python3
from ctypes import cdll, c_double, CFUNCTYPE
import numpy as np
import seaborn
from pathlib import Path
import matplotlib
matplotlib.use("pgf")
pgf_with_pdflatex = {
"pgf.texsystem": "pdflatex",
"font.family": "serif", # use serif/main font for text elements
"text.usetex"... | 1.992188 | 2 |
helpers/alphanumeric.py | danielhenrymantilla/shellcode-factory | 34 | 12791980 | <filename>helpers/alphanumeric.py<gh_stars>10-100
from assembly import Assembly
# String of forbidden chars
forbidden_chars = ""
class Utils:
verbose = False # Is debug printing activated?
@staticmethod
def none(*args): return None
@staticmethod
def debug(*ss):
... | 2.8125 | 3 |
home/migrations/0012_auto_20220329_0825.py | SeanCodeMedia/codeMedia-django | 0 | 12791981 | <filename>home/migrations/0012_auto_20220329_0825.py
# Generated by Django 3.1.2 on 2022-03-29 12:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0011_home_degree_3_description'),
]
operations = [
migrations.AddField(
... | 1.515625 | 2 |
app/article/views.py | mapan1984/blog | 0 | 12791982 | <gh_stars>0
from flask import flash, render_template, redirect, url_for, request, abort
from flask_login import current_user, login_required
from app import db, redis
from app.models import Article, Comment, Permission, Rating
from app.decorators import permission_required, author_required
from app.article import art... | 2.203125 | 2 |
catstuff/core_plugins/tasks/filelist/main.py | modora/catstuff | 0 | 12791983 | from catstuff import core, tools
from .config import mod_name, build
class Filelist(core.plugins.CSTask):
def __init__(self):
super().__init__(mod_name, build)
def main(self, path, max_depth=0, followlinks=False,
include=None, exclude=None, mode='whitelist',
safe_walk=True,... | 1.835938 | 2 |
yesno.py | wdymm/pymysql | 0 | 12791984 | <filename>yesno.py
print('yesno') | 1.03125 | 1 |
notebooks/_solutions/visualization_02_seaborn3.py | jonasvdd/DS-python-data-analysis | 65 | 12791985 | # Axes based
sns.violinplot(data=titanic, x="Pclass", y="Age",
hue="Sex", split=True,
palette="Set2")
sns.despine(left=True) | 2.234375 | 2 |
anthill/exec/model/api.py | anthill-services/anthill-exec | 0 | 12791986 |
import tornado.gen
from tornado.gen import sleep, Future
from tornado.httpclient import HTTPRequest, HTTPError
from tornado.simple_httpclient import SimpleAsyncHTTPClient
from .. import options as _opts
from anthill.common.internal import Internal, InternalError
from anthill.common.validate import validate_value
fro... | 2.203125 | 2 |
extract.py | lpmi-13/python-code-corpus | 0 | 12791987 | <gh_stars>0
from pymongo import MongoClient
import json
import sys
try:
client = MongoClient(host= ['localhost:27017'], serverSelectionTimeoutMS = 2000)
client.server_info()
db = client.ast
except:
print('mongo isn\'t currently running...please start it first')
sys.exit()
result_dict = {
"fors":... | 2.5 | 2 |
SwitchTracer/cores/contrib/couriermiddlewares/status.py | IzayoiRin/VirtualVeyonST | 0 | 12791988 | <filename>SwitchTracer/cores/contrib/couriermiddlewares/status.py<gh_stars>0
# pack is on the passing way
ON_WAY = -1
# pack is passed successfully
SUCCEEDED = 0
# pack is going to start
PREPARED = 1
# pack passing timeout
TIMEOUT = 2
# pack passing refused
REFUSED = 3
# pack is destroyed
DESTROYED = 4
# unknown error ... | 1.226563 | 1 |
move_xmls_p33.py | mcjczapiewski/work | 0 | 12791989 | <filename>move_xmls_p33.py<gh_stars>0
# -*- coding: utf-8 -*-
# import bibliotek
import os
import datetime
import shutil
from natsort import natsorted
from natsort import natsort_keygen
nkey = natsort_keygen()
byly = set()
stare_xml = set()
nowe_xml = set()
count = 1
# aktualna data i godzina
czasstart = datetime.da... | 2.546875 | 3 |
src/simcore_service_deployment_agent/app_state.py | mrnicegyu11/osparc-deployment-agent | 1 | 12791990 | from enum import IntEnum
class State(IntEnum):
STARTING = 0
RUNNING = 1
FAILED = 2
STOPPED = 3
PAUSED = 4
| 2.59375 | 3 |
users/urls.py | LeonardoCruzx/Projeto_rede_social | 0 | 12791991 | <filename>users/urls.py<gh_stars>0
from django.urls import path
from .views import *
app_name = 'users'
urlpatterns = [
path('pagina-inicial',pagina_inicial_usuario,name='pagina-inicial-usuario')
] | 1.671875 | 2 |
CodingBat/Warmup-1/makes10.py | arthxvr/coding--python | 0 | 12791992 | <reponame>arthxvr/coding--python
def makes10(a, b):
return (a == 10 or b == 10 or a + b == 10)
| 3.78125 | 4 |
sl_cutscenes/scenarios/scenario.py | AIS-Bonn/sl-cutscenes | 2 | 12791993 | """
Abstract class for defining scenarios
"""
import random
from typing import Tuple
import numpy as np
from copy import deepcopy
import torch
import stillleben as sl
import nimblephysics as nimble
from sl_cutscenes.room_models import RoomAssembler
from sl_cutscenes.objects.mesh_loader import MeshLoader
from sl_cutsce... | 2.265625 | 2 |
asgard/users/test/userstest.py | nicolas-van/asgard | 0 | 12791994 | <gh_stars>0
# -*- coding: utf-8 -*-
# Copyright (c) 2014, <NAME>
#
# Released under the MIT 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... | 1.867188 | 2 |
examples/job-examples/TwitterSampledStreamerToKafka/TwitterSampledStreamerToKafka.py | prernaagarwal/cs6235Project | 3 | 12791995 | from edna.ingest.streaming import TwitterStreamingIngest
from edna.process import BaseProcess
from edna.emit import KafkaEmit
from edna.serializers.EmptySerializer import EmptyStringSerializer
from edna.core.execution.context import SimpleStreamingContext
def main():
context = SimpleStreamingContext()
ing... | 2.40625 | 2 |
WebMirror/management/rss_parser_funcs/feed_parse_extractKendalblackBlogspotCom.py | fake-name/ReadableWebProxy | 193 | 12791996 | def extractKendalblackBlogspotCom(item):
'''
DISABLED
Parser for 'kendalblack.blogspot.com'
'''
return None | 1.46875 | 1 |
src/pyobo/sources/mirbase_constants.py | ddomingof/pyobo | 0 | 12791997 | <filename>src/pyobo/sources/mirbase_constants.py
# -*- coding: utf-8 -*-
"""Constants for miRBase."""
import pandas as pd
from ..path_utils import ensure_df
PREFIX = 'mirbase'
VERSION = '22.1'
PREFAM_URL = f'ftp://mirbase.org/pub/mirbase/{VERSION}/database_files/mirna_prefam.txt.gz'
PREMATURE_TO_PREFAMILY_URL = f'... | 2.46875 | 2 |
cursoemvideo/python3_mundo2/aula_15/ex069.py | Tiago-Baptista/CursoEmVideo_Python3 | 0 | 12791998 | sexo = ''
maior = macho = menor = 0
while True:
idade = int(input('Qual a sua idade? '))
sexo = str(input('Qual o seu sexo [M/F]? ')).strip().lower()[0]
if idade >= 18:
maior += 1
if sexo == 'm':
macho += 1
if sexo == 'f' and idade < 20:
menor += 1
while sexo not in 'mf':... | 3.765625 | 4 |
time/baseProgram.py | hy57in/git-auto-commit | 0 | 12791999 | import schedule
import threading
import datetime as dt
import subprocess
import time
import os
# auto commit 실행
def auto_commit():
print("auto commit을 시행합니다")
subprocess.call(['sh', './continue.sh'])
subprocess.call(['sh', './TimeAutoCommitProcess.sh'])
# n분마다 auto_commit 실행
def time_based_autocommit(num)... | 2.703125 | 3 |
ScrapedData/CosineScore.py | Robo-Sapien/Search-Engine-for-arXiv.org | 0 | 12792000 | <reponame>Robo-Sapien/Search-Engine-for-arXiv.org
from scipy import spatial
import numpy
class CosineScore:
"""Calculate cosine similarity score for each document and rank them
:param query: query vector
:param matrix: tf-idf numpy matrix
"""
rank = None
docIndex = None
score = None
... | 2.671875 | 3 |
script/get_weather.py | alaurie/Python-for-PowerShell-Users-Talk | 0 | 12792001 | #! /usr/bin/env python
import argparse
import requests
arg_parser = argparse.ArgumentParser(
prog="get-weather", description="Get weather for entered city."
)
arg_parser.add_argument(
"city", metavar="my_city", type=str, help="City for which you want to get weather."
)
def get_city_weather(search_city):
... | 3.8125 | 4 |
main/migrations/0004_auto_20200614_1547.py | pcp11/link-lizard | 0 | 12792002 | # Generated by Django 3.0.7 on 2020-06-14 15:47
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0003_auto_20200614_1506'),
]
operations = [
migrations.AlterField(
model_name='urlmapping'... | 1.648438 | 2 |
dqn/environment.py | Alexanderli0816/DQN | 1 | 12792003 | <filename>dqn/environment.py<gh_stars>1-10
import gym
from .utils import rgb2gray, imresize
class Environment(object):
def __init__(self, config):
self.env = gym.make(config.env_name)
screen_width, screen_height = config.screen_width, config.screen_height
self.display = config.display
... | 2.765625 | 3 |
generate_secretkey.py | Saknowman/django_setting_sample_project | 0 | 12792004 | from django.core.management.utils import get_random_secret_key
secret_key = get_random_secret_key()
text = 'SECRET_KEY = \'{0}\''.format(secret_key)
print(text) | 2 | 2 |
strongr/core/exception/__init__.py | bigr-erasmusmc/StrongR | 0 | 12792005 | <reponame>bigr-erasmusmc/StrongR
from .isnotcallableexception import IsNotCallableException
from .invalidparameterexception import InvalidParameterException
| 1.078125 | 1 |
nlp/nlp.py | stevencdang/data_proc_lib | 0 | 12792006 | <reponame>stevencdang/data_proc_lib<filename>nlp/nlp.py
#!/usr/bin/env python
# Author: <NAME> <EMAIL>
import nltk
from nltk.corpus import wordnet as wn
import numpy as np
from file_manager import read_data
def cosine(doc1, doc2, doc_topic_weights):
weights1 = doc_topic_weights[doc1]
weights2 = doc_topic_we... | 2.765625 | 3 |
vnpy/app/algo_trading/__init__.py | Billy-Meng/vnpy_origin | 1 | 12792007 | <filename>vnpy/app/algo_trading/__init__.py
# -*- coding:utf-8 -*-
import sys
import vnpy_algotrading
sys.modules[__name__] = vnpy_algotrading
| 1.351563 | 1 |
language/python/python/inner_functions/print_demo.py | bigfoolliu/liu_aistuff | 1 | 12792008 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# author: bigfoolliu
"""
print函数展示
"""
import time
def end_demo():
"""print结尾控制,加flush强制刷新"""
for _ in range(100):
print("#", end="", flush=True)
time.sleep(0.01)
print()
def progress_demo():
"""使用\r展示进度"""
days = 365
for i in ... | 3.234375 | 3 |
dj_prosftpd/views.py | devopsmakers/dj-prosftpd | 0 | 12792009 | <gh_stars>0
# -*- coding: utf-8 -*-
from django.views.generic import (
CreateView,
DeleteView,
DetailView,
UpdateView,
ListView
)
from .models import (
SFTPUser,
SFTPUserKey,
FileHistory,
FileValidator,
)
class SFTPUserCreateView(CreateView):
model = SFTPUser
class SFTPUserDeleteView(D... | 2.0625 | 2 |
sympycore/heads/term_coeff_dict.py | radovankavicky/pymaclab | 96 | 12792010 | <filename>sympycore/heads/term_coeff_dict.py<gh_stars>10-100
__all__ = ['TERM_COEFF_DICT']
from .base import heads, heads_precedence, ArithmeticHead, Pair
from ..core import init_module, Expr
init_module.import_heads()
init_module.import_numbers()
init_module.import_lowlevel_operations()
@init_module
def _init(modu... | 2.328125 | 2 |
API/utils/more_utils/fortnite_utils.py | OreoDivision/Stat-Tracker | 1 | 12792011 | <gh_stars>1-10
import requests
from cache import AsyncTTL
'''
----- Get fortnite players stats -----
name: the name of the user
platform: the platform they are on (epic / psn / xbl)
'''
@AsyncTTL(time_to_live=120, maxsize=1024)
async def get_player_stats(name, platform):
# Sends a request for the data
data = re... | 2.46875 | 2 |
sgh_PiGlow.py | davidramirezm30/scratch-orangepi | 0 | 12792012 | <reponame>davidramirezm30/scratch-orangepi
#!/usr/bin/env python
# sgh_PiGlow - control PiGlow LEDS via ScratchGPIO.
#Copyright (C) 2013 by <NAME> based on code from Pimoroni
#This program is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License
#as published by the... | 2.8125 | 3 |
web/src/auth.py | computer-geek64/guardian | 0 | 12792013 | <filename>web/src/auth.py
# auth.py
import os
import json
import hashlib
authentication_credentials = json.loads(os.environ['AUTHENTICATION_CREDENTIALS'])
def authenticate(username, password):
if username is None or password is None:
return False
password_hash = hashlib.sha512(password.encode()).h... | 2.84375 | 3 |
src/Node.py | stevenwalton/Retro-Learner | 0 | 12792014 | import numpy as np
class Node:
def __init__(self, value=-np.inf, children=None):
self.value = value
self.visits = 0
self.children = {} if children is None else children
def __repr__(self):
return "<Node value=%f visits=%d len(children)=%d>" % (
self.value,
... | 2.90625 | 3 |
tests/test_meme.py | Sung-Huan/ANNOgesic | 26 | 12792015 | <filename>tests/test_meme.py
import sys
import os
import unittest
import shutil
from io import StringIO
sys.path.append(".")
import annogesiclib.meme as me
from mock_helper import gen_file
from mock_args_container import MockClass
from annogesiclib.meme import MEME
class Mock_func(object):
def mock_del_repeat_f... | 2.515625 | 3 |
dispatcher/models.py | stakewise/bls-horcrux | 16 | 12792016 | <reponame>stakewise/bls-horcrux<filename>dispatcher/models.py
from sqlalchemy import Column, Integer, String
from .database import Base
class Share(Base):
__tablename__ = "shares"
id = Column(Integer, primary_key=True, index=True)
recipient_rsa_public_key = Column(String)
sender_rsa_public_key = Col... | 2.125 | 2 |
src/state/board_state.py | PKU-GeekGame/gs-backend | 7 | 12792017 | from __future__ import annotations
import time
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Optional, List, Tuple, Dict, Any
if TYPE_CHECKING:
from . import *
ScoreBoardItemType = Tuple[User, int]
from . import WithGameLifecycle
def minmax(x: int, a: int, b: int) -> int:
if x<a: r... | 3.015625 | 3 |
python/dblock.py | cpausmit/FiBS | 0 | 12792018 | <gh_stars>0
# dblock.py
import os
import socket
import MySQLdb
MY_CNF = "%s/.mysql/my.cnf"%(os.getenv('HOME'))
if not os.path.exists(MY_CNF):
MY_CNF = "/etc//my.cnf"
print(" OPEN DB.")
Db = MySQLdb.connect(read_default_file="%s"%(MY_CNF),read_default_group="mysql",db="Fibs")
Cursor = Db.cursor()
class dblock(obj... | 2.34375 | 2 |
__init__.py | rowanc1/Seismogram | 3 | 12792019 | import Layers
import Wavelets
| 0.964844 | 1 |
plugins/filter/version_filters.py | nrser/qb | 1 | 12792020 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import subprocess
import os
import json
import sys
from ansible.errors import AnsibleError
import qb
from qb.ipc.rpc import client as rpc_client
def get_semver_path():
bin_path = os.path.join(qb.ROOT, 'node_modules', 'semve... | 1.96875 | 2 |
test/files/crawl_settings.py | mawentao007/reading_grab | 0 | 12792021 | GRAB_SPIDER_CONFIG = {
'global': {
'spider_modules': ['test.script_crawl'],
},
}
| 1.179688 | 1 |
ContractorApp/migrations/0011_remove_profile_is_a_company.py | Paul-W-0/FindContractors | 0 | 12792022 | <reponame>Paul-W-0/FindContractors
# Generated by Django 3.2.9 on 2021-12-01 22:00
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('ContractorApp', '0010_rename_user_type_profile_is_a_company'),
]
operations = [
migrations.RemoveField(
... | 1.578125 | 2 |
sim/__main__.py | Tjorriemorrie/ufc | 1 | 12792023 | from datetime import datetime
from collections import Counter, defaultdict, OrderedDict
from itertools import chain
from random import random
import numpy as np
from cma import CMAEvolutionStrategy, CMAOptions
from loguru import logger
from math import sqrt
from sklearn.preprocessing import MinMaxScaler
from sortedcon... | 2.09375 | 2 |
kron.py | seangilleran/kron | 0 | 12792024 | from flask_script import Manager
from kron import Kron, db, restore_from_file
from kron import Tag, Post, Archive, Box, Document, Person, Topic
app = Kron(__name__)
manager = Manager(app)
@manager.command
def restore(file):
restore_from_file(file)
@manager.shell
def _make_shell_context():
return dict(
... | 2.140625 | 2 |
Corpus_Olusturma/gezi_web_siteleri.py | Halil-ibrahim-GUNBULAK/IMAGEPROCESSORS | 4 | 12792025 | import requests
from bs4 import BeautifulSoup
linklertoplam=[]
# öncelikle haber sitesinin page şeklinde olması önemli
# burda linkleri alıp link listesi oluşturuyoruz
#html bilenler bilir a href kısmında bizim linklerimiz bulunmakta fakat sitedeki her link işimize yaramıyor
# bu yüzden öncelikle göslem yapmanız geriyo... | 2.203125 | 2 |
src/library/utils/transforms/param_copy.py | inessus/ai-skills | 5 | 12792026 | import copy
def transfer_weights(model_from, model_to):
"""
实现了从model_from到model to的相同网络参数的拷贝。
复制一个目标参数,把没有的都填上,就可以使用了,
:param model_from:
:param model_to:
:return:
"""
wf = copy.deepcopy(model_from.state_dict())
wt = model_to.state_dict()
for k in wt.keys() :
i... | 2.78125 | 3 |
code/crawler/src/get_raw_arxiv.py | vipulraheja/IteraTeR | 11 | 12792027 | import os
import time
import json
import arxiv
def get_paper_list(query="cat:cs.CL", domain='cscl',
latest_year=2021, end_year=2010, max_results=1000):
outs = {}
year = latest_year
i = 0
while year > end_year:
print(f"Results {i} - {i+max_results}:")
result = arxiv.... | 2.6875 | 3 |
examples/casvlm1_avl_plane_SAND.py | KikeM/AeroSandbox | 0 | 12792028 | import copy
from aerosandbox import *
opti = cas.Opti() # Initialize an optimization environment
def variable(init_val, lb=None, ub=None):
"""
Initialize attrib_name scalar design variable.
:param init_val: Initial guess
:param lb: Optional lower bound
:param ub: Optional upper bound
:retur... | 2.34375 | 2 |
exercicios/aula08-ex-a.py | anildoferreira/CursoPython-PyCharm | 0 | 12792029 | import math
num = int(input('Digite um número para encontrar a raíz: '))
raiz = math.sqrt(num)
print('A raíz quadrada de {}, é {}.'.format(num, raiz))
| 4.0625 | 4 |
apps/decision/templatetags/calculation.py | bahattincinic/cheers | 3 | 12792030 | from __future__ import division
import json
from django.template import Library
register = Library()
def global_weight(criterion, report):
"""
Formula:
Global Weight = Criterion W value / Criterion Count
For example:
W Value = 1
Criterion Count = 5
Global Weight = 1 / 5 = 0.2
"""
... | 2.125 | 2 |
src/triggers/recommendation_trigger.py | jherrerotardon/spies | 0 | 12792031 | <filename>src/triggers/recommendation_trigger.py
from pyframework.triggers.abstract_trigger import AbstractTrigger
from src.commands.fire.base_fire import Event
class RecommendationTrigger(AbstractTrigger):
ACTION_KEY_PREFIX = AbstractTrigger.ACTION_KEY_PREFIX + ':' + 'download'
EVENT_TASK = Event.RECOMMENDA... | 1.695313 | 2 |
tests/test_show.py | SickChill/libtvdb | 1 | 12792032 | """Test searching for shows."""
import datetime
from tests.context import BaseTVDBTest
from libtvdb.model.enums import AirDay, ShowStatus
class ShowTestSuite(BaseTVDBTest):
"""Show test cases."""
def test_show_parse(self):
"""Test that a show is parsed as we'd expect."""
show = self.clien... | 2.703125 | 3 |
dffml/source/memory.py | Patil2099/dffml | 0 | 12792033 | <filename>dffml/source/memory.py<gh_stars>0
# SPDX-License-Identifier: MIT
# Copyright (c) 2019 Intel Corporation
"""
Fake data sources used for testing
"""
import asyncio
from typing import Any, Dict, List, NamedTuple, AsyncIterator
from ..base import BaseConfig
from ..repo import Repo
from .source import BaseSourceC... | 2.078125 | 2 |
gp_dev/core.py | matjesg/gp_dev | 0 | 12792034 | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/00_core.ipynb (unless otherwise specified).
__all__ = ['ExactGPModel', 'MultitaskGPModel', 'nv_cost', 'week_of_month']
# Cell
import gpytorch
from math import ceil
import datetime
# Cell
class ExactGPModel(gpytorch.models.ExactGP):
def __init__(self, train_x, train... | 2.09375 | 2 |
dephell/__main__.py | OliverHofkens/dephell | 1,880 | 12792035 | # app
from .cli import entrypoint
entrypoint()
| 1.0625 | 1 |
s06_classes_intro/exercises/book.py | silverfield/pythonsessions | 0 | 12792036 | <gh_stars>0
__author__ = 'ferrard'
# ---------------------------------------------------------------
# Imports
# ---------------------------------------------------------------
import pickle
import math
# ---------------------------------------------------------------
# Class - Book
# -------------------------------... | 2.921875 | 3 |
ocs_sample_library_preview/Security/AccessControlEntry.py | osisoft/sample-ocs-sample_libraries-python | 4 | 12792037 | <gh_stars>1-10
from enum import IntEnum
import json
from .AccessType import AccessType
from .CommonAccessRightsEnum import CommonAccessRightsEnum
from .Trustee import Trustee
class AccessControlEntry(object):
"""OCS access control entry definition"""
def __init__(self, trustee: 'Trustee' = None, access_type... | 2.578125 | 3 |
tests/odometry.py | oknuutti/visnav-py | 4 | 12792038 | import unittest
import pickle
import tempfile
import os
import math
from datetime import datetime
import numpy as np
import quaternion
import cv2
from visnav.algo.model import Camera
from visnav.algo.odometry import VisualOdometry, Pose
from visnav.algo import tools
class TestOdometry(unittest.TestC... | 2.5625 | 3 |
bot/main.py | curtonius/HitchhikerBot | 0 | 12792039 | <filename>bot/main.py
import discord
import os
#import pynacl
#import dnspython
import server
from discord.ext import commands
from discord.utils import get
import re
bot = commands.Bot(command_prefix="!")
TOKEN = os.getenv("DISCORD_TOKEN")
replace = {
"\\|3": "b",
"/\\\\": "a",
"ph": "f",
"ck": "k",
"zz": "s",
... | 2.46875 | 2 |
shepard.py | randbrown/PyWaveTools | 1 | 12792040 | <reponame>randbrown/PyWaveTools<gh_stars>1-10
""" Generate shepard tone """
import wavelib
#import plotlib
FREQ_A4 = 440.0
STEPS = 12.0
DURATION_PER_STEP = 1.0 # seconds
TOTAL_DURATION = DURATION_PER_STEP * STEPS
def shepard_glissando(times, freq_start, freq_end):
# the exponential glissando sounds goo... | 2.703125 | 3 |
retinal-fundus/src/bsmu/retinal_fundus/app/main.py | IvanKosik/vision | 2 | 12792041 | <filename>retinal-fundus/src/bsmu/retinal_fundus/app/main.py<gh_stars>1-10
from bsmu.vision.app.base import App
class RetinalFundusApp(App):
pass
def run_app():
print('Run, Retinal Fundus! Run!')
app = RetinalFundusApp()
app.run()
if __name__ == '__main__':
run_app()
| 1.382813 | 1 |
plugins/content/content_birthday.py | almazboot/sketal | 43 | 12792042 | <filename>plugins/content/content_birthday.py
import datetime
from handler.base_plugin import CommandPlugin
from utils import plural_form, age
class BirthdayPlugin(CommandPlugin):
__slots__ = ("max_users_in_group", )
def __init__(self, *commands, prefixes=None, strict=False, max_users_in_group=1000):
... | 2.65625 | 3 |
src/powerbidedicated/azext_powerbidedicated/vendored_sdks/powerbidedicated/models/_power_bi_dedicated_management_client_enums.py | Mannan2812/azure-cli-extensions | 8 | 12792043 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 2.0625 | 2 |
scripts/opengitdiff.py | jmettraux/dotvim | 2 | 12792044 | <gh_stars>1-10
# -*- coding: UTF-8 -*-
# opengitdiff.py
import sys, re, subprocess
lines = subprocess\
.Popen(
'git diff -U9999999 --no-color ' + sys.argv[1],
shell=True,
stdout=subprocess.PIPE)\
.stdout\
.readlines()
digits = str(len(str(len(lines))))
lnum = -1
for line in lines:
line = line... | 2.59375 | 3 |
web_scanner/whois.py | ntnshrm87/4hathacker | 0 | 12792045 | <reponame>ntnshrm87/4hathacker<filename>web_scanner/whois.py
#!/usr/bin/python
import os
def get_whois(url):
command = "whois" + " " + url
process = os.popen(command)
results = str(process.read())
#print results
return results
| 2.640625 | 3 |
setup.py | bsodhi/books_scraper | 0 | 12792046 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="books_info-bsodhi",
version="0.0.2",
author="<NAME>",
author_email="<EMAIL>",
description="Books data scraper.",
long_description="Scrapes books and articles informatio from Goodreads ... | 1.695313 | 2 |
triangulos.py | userddssilva/Exemplos-python-introducao-a-programacao | 0 | 12792047 | <filename>triangulos.py
def lado_maior(a, b, c):
if a > b and a > c:
return a
elif b > a and b > c:
return b
else:
return c
def lados_menores(a, b, c):
if a > b and a > c:
return b, c
elif b > a and b > c:
return a, c
else:
return a, b
def eh_tri... | 4 | 4 |
ignore_signals.py | alex-bormotov/AXE-Bot-open | 18 | 12792048 | <gh_stars>10-100
import time
from time import sleep
from notification import notificator
from config import get_config
ignore_buy_signal_counter = 0
ignore_sell_signal_counter = 0
def ignore_buy_signal_times(signal, times):
global ignore_buy_signal_counter
if signal["signal"] == "BUY" and ignore_buy_signa... | 2.5625 | 3 |
perftool/__main__.py | YajanaRao/Perftool | 3 | 12792049 | <reponame>YajanaRao/Perftool
import sys,os
from perftool import interactive,main
from os import path
import sys
import random
import sys
sys.path.insert(0, path.dirname(path.abspath(path.dirname(__file__))))
class color:
HEADER = '\033[95m'
IMPORTANT = '\33[35m'
NOTICE = '\033[33m'
OK... | 2.875 | 3 |
geodex/utils.py | developmentseed/geodex | 37 | 12792050 | """
utils.py
@author: developmentseed
Functions used to generate a list of tiles via recursion
"""
from os import path as op
import json
from shapely.geometry import Polygon
from pygeotile.tile import Tile
def _get_quadrant_tiles(tile):
"""Return indicies of tiles at one higher zoom (in google tiling scheme)""... | 3.015625 | 3 |