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
allink_core/core_apps/allink_legacy_redirect/config.py
allink/allink-core
5
12791851
# -*- coding: utf-8 -*- from django.apps import AppConfig class AllinkLegacyConfig(AppConfig): name = 'allink_core.core_apps.allink_legacy_redirect' verbose_name = "Legacy Redirect"
1.015625
1
test/test_mnist_gan.py
kevjn/simplegrad
0
12791852
# rough copy of https://github.com/geohot/tinygrad/blob/master/examples/mnist_gan.py from simplegrad import Tensor, Device, Adam import numpy as np import itertools as it from torchvision.utils import make_grid, save_image import torch from abc import abstractmethod import os def leakyrelu(x, neg_slope=0.2): retu...
2.453125
2
Scripts/UpdateCopyright.py
davidbrownell/Common_Environment
1
12791853
<filename>Scripts/UpdateCopyright.py # --------------------------------------------------------------------------- # | # | UpdateCopyright.py # | # | <NAME> (<EMAIL>) # | # | 01/01/2016 06:12:15 PM # | # --------------------------------------------------------------------------- # | # | Copyrigh...
2.3125
2
spiral/utils.py
miyosuda/variational_walkback
0
12791854
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pylab as plt def save_figure(xs, file_path): plt.figure() plt.ylim([-2.0, 2.0]) plt.xlim([-2.0, 2.0])...
2.390625
2
api/models.py
dschien/greendoors-web
0
12791855
<gh_stars>0 import random import string import datetime from django.contrib.contenttypes.generic import GenericRelation from django.core.urlresolvers import reverse from tinymce.models import HTMLField __author__ = 'schien' import re from django.contrib.contenttypes.models import ContentType from django.contrib.co...
2.078125
2
src/api.py
kolbl/HAR_master_thesis
1
12791856
import flask from tensorflow import keras import pandas as pd from flask import request, jsonify from pandas.io.json import json_normalize app = flask.Flask(__name__) app.config["DEBUG"] = True @app.route('/api/prediction', methods=['POST']) def precict(): # Validate the request body contains JSON if reque...
2.8125
3
problems/find-all-anagrams-in-a-string/solution.py
tonymontaro/leetcode-hints
1
12791857
from collections import Counter class Solution: def findAnagrams(self, word: str, substr: str): """O(n) time | O(1) space""" if not word or not substr: return [] l = 0 r = -1 seen = 0 ln = len(substr) counts = Counter(substr) counts = {char: -counts[c...
3.578125
4
nautilus/utils/env.py
LeptoSpira/nautilus-chambers
1
12791858
<reponame>LeptoSpira/nautilus-chambers """Set up local enviroment.""" import yaml try: with open('config.yml') as file: env = yaml.load(file, Loader=yaml.FullLoader) except FileNotFoundError: env = {}
1.78125
2
main.py
Pzqqt/Whyred_Rom_Update_Checker
11
12791859
<reponame>Pzqqt/Whyred_Rom_Update_Checker<gh_stars>10-100 #!/usr/bin/env python3 # encoding: utf-8 from argparse import ArgumentParser import json import time import traceback import sys import threading from concurrent.futures import ThreadPoolExecutor from requests import exceptions from config import ( ENABLE...
2.15625
2
Chat_bot.py
Ananda602/Chat-bot
1
12791860
import random import speech_recognition as sr import datetime import calendar import time import webbrowser import wikipedia from gtts import gTTS import playsound import os import win10toast from bs4 import BeautifulSoup import requests import re import nltk from googletrans import Translator import sp...
2.90625
3
script/decawave_driver_shell.py
horverno/ros_decawave
3
12791861
#!/usr/bin/env python import rospy import tf import time import serial import struct from geometry_msgs.msg import PointStamped from ros_decawave.msg import Tag, Anchor, AnchorArray, Acc class DecawaveDriver(object): """ docstring for DecawaveDriver """ def __init__(self): rospy.init_node('decawave...
2.296875
2
keep_alive.py
DHRUV-CODER/Captcha-Image-Api
5
12791862
<gh_stars>1-10 from PIL import Image, ImageFont, ImageDraw from PIL import Image from io import BytesIO from flask import Flask, jsonify, render_template, send_file, abort, redirect, url_for from threading import Thread import random import string app = Flask('') @app.route('/') def sup(): return redirect(url_fo...
2.6875
3
snowddl/resolver/stage_file.py
littleK0i/SnowDDL
21
12791863
<reponame>littleK0i/SnowDDL<gh_stars>10-100 from io import BytesIO from hashlib import md5 from pathlib import Path from snowddl.blueprint import StageBlueprint, StageFileBlueprint from snowddl.error import SnowDDLExecuteError from snowddl.resolver.abc_resolver import AbstractResolver, ResolveResult, ObjectType clas...
2.140625
2
lab3/es3/to_bike_webservice.py
haraldmeister/Programming_for_IoT_applications
0
12791864
<filename>lab3/es3/to_bike_webservice.py import cherrypy import json import requests class BikeSharing(): exposed=True @cherrypy.tools.json_out() def GET(self,*uri,**params): if len(uri)==0: self.json_data = requests.get("https://api.citybik.es/v2/networks/to-bike").json() ...
2.953125
3
Modulo 1/ex014.py
Werberty/Curso-em-Video-Python3
1
12791865
graus = float(input('Informe a temperatura em °C: ')) coversao = graus * 1.8 + 32 print(f'A temperatura de {graus:.1f}°C corresponde a {coversao:.1f}°F!')
3.96875
4
CameraTest.py
StanislavEng/Autonomous_Rover
0
12791866
<gh_stars>0 from picamera import PiCamera from time import sleep #camera = picamera.PiCamera() camera = PiCamera() #camera.resolution = (1920x1080) #camera.capture('Test.jpg') camera.start_preview() # for if you're feelng feisty #for i in range(5) sleep(15) # camera.capture('/home/pi/capture%s.jpg' %i) camera.capt...
2.453125
2
notification/admin.py
anyidea/django-user-notification
2
12791867
from django.contrib import admin from . import models from .models import Notification from django.contrib.contenttypes.admin import GenericTabularInline # Register your models here. class NotificationAdmin(GenericTabularInline): model = models.Notification extra = 0 def get_queryset(self, request): ...
1.929688
2
self_play.py
mojtabamozaffar/toolpath-design-rl
1
12791868
import numpy as np import torch import math import ray import copy import networks import global_config def play_one_game(model, env_func, config, temperature, save=False, filename = ''): game_history = GameHistory() game = env_func(max_steps = config.max_moves, window_size = config.observation_shape[1]) ...
2.234375
2
bvc/management/commands/test_mail.py
Vayel/GUCEM-BVC
2
12791869
import io import csv from smtplib import SMTPException from django.core.management.base import BaseCommand from django.core.mail import EmailMessage from django.conf import settings from bvc import utils class Command(BaseCommand): def handle(self, *args, **options): csvfile = io.StringIO() writ...
2.28125
2
workspace/extract_psf.py
thhsieh00/utoolbox-core
3
12791870
<filename>workspace/extract_psf.py import logging import os import imageio import numpy as np from vispy import app, scene from vispy.color.colormap import BaseColormap, Colormap, ColorArray from vispy.visuals.transforms import STTransform from utoolbox.analysis.psf_average import PSFAverage from utoolbox...
2
2
docs/sajou_examples/markers.py
cristobaltapia/sajou
1
12791871
#!/usr/bin/env python # -*- coding: utf-8 -*- """Example to show the new marker styles""" import matplotlib.pyplot as plt from sajou.plot.lines_mpl import Line2D fig = plt.figure(figsize=(12, 3)) ax = fig.add_subplot(111) markers = ['ap', 'an', 'psx', 'rsx', 'es', 'rex', 'rc'] for ix, mark in enumerate(markers): ...
2.8125
3
ocs_ci/ocs/ui/validation_ui.py
prsurve/ocs-ci
0
12791872
<reponame>prsurve/ocs-ci<gh_stars>0 import logging from ocs_ci.ocs.ui.base_ui import PageNavigator from ocs_ci.ocs.ui.views import locators from ocs_ci.utility.utils import get_ocp_version, TimeoutSampler from ocs_ci.framework import config from ocs_ci.ocs import constants logger = logging.getLogger(__name__) clas...
2.265625
2
headbang/motion.py
sevagh/headbang.py
4
12791873
import numpy import sys import scipy from scipy.signal import find_peaks_cwt import matplotlib.pyplot as plt from headbang.params import DEFAULTS from headbang.util import find_closest openpose_install_path = "/home/sevagh/thirdparty-repos/openpose" openpose_dir = openpose_install_path sys.path.append(openpose_dir + ...
1.875
2
Exec/testing/Thermal-RMI-implosion/movie.py
darylbond/cerberus
5
12791874
import sys cmd_folder = "../../../vis" # nopep8 if cmd_folder not in sys.path: # nopep8 sys.path.insert(0, cmd_folder) from tile_mov import tile_movie from make_mov import make_all, get_particle_trajectories import pylab as plt import numpy as np from mpl_toolkits.axes_grid1 import make_axes_locatable import matp...
2.125
2
services/aws/support.py
shunyeka/autobotAI-backend
0
12791875
from autobot_helpers import boto3_helper, context_helper from botocore.exceptions import ClientError import traceback class Support: def __init__(self): self.client = boto3_helper.get_client('support') def refresh_checks(self): try: ta_checks = self.client.describe_trusted_adviso...
1.976563
2
kiteGetAccessToken.py
vishalr4202/ZerodhaCode
0
12791876
import logging import kitesettings from kiteconnect import KiteConnect logging.basicConfig(level=logging.DEBUG) kite = KiteConnect(kitesettings.API_KEY) # https://kite.zerodha.com/connect/login?v=4&API_KEY=Q8JPzjkt8ftXgqvmXa request_token = input("Request Token: ") data = kite.generate_session(request_token, kitese...
2.015625
2
balsa/formatter.py
jamesabel/balsa
4
12791877
from typing import Union from datetime import datetime from logging import Formatter, LogRecord class BalsaFormatter(Formatter): """ Format time in ISO 8601 """ def formatTime(self, record: LogRecord, datefmt: Union[str, None] = None) -> str: assert datefmt is None # static format t...
3.296875
3
last_file.py
CarlosPetrikov/random_python_functions
1
12791878
<reponame>CarlosPetrikov/random_python_functions import os from datetime import datetime, timezone # Function that will return the most recent file from a directory, filtering by extension def last_file(path, extension): directory = os.scandir(path) dict_file = {} for file in directory: ...
3.609375
4
LeetCode/03_Hard/lc_460.py
Zubieta/CPP
8
12791879
<reponame>Zubieta/CPP<gh_stars>1-10 # 460 - LFU Cache (Hard) # https://leetcode.com/problems/lfu-cache/ # Implement a Least Frequently Used cache. GODDAMN I almost died. from collections import OrderedDict, defaultdict class LFUCache(object): def __init__(self, capacity): """ :type capacity: int ...
3.359375
3
src/utils/prepare2.py
comword/TCD20-DP-DeepModel
0
12791880
<filename>src/utils/prepare2.py import argparse import json from pathlib import Path from glob import glob class DatasetPrepare: def __init__(self, config: argparse.Namespace): self.config = config def run(self, input_dir: str): in_path = Path(input_dir) if not in_path.exists(): ...
2.875
3
vm_manager/constants.py
NeCTAR-RC/bumblebee
3
12791881
from novaclient.v2 import servers as nova_servers LINUX = "linux" SCRIPT_ERROR = 0 SCRIPT_OKAY = 1 ERROR = -1 # These are Openstack Nova server status values that the # python client library doesn't define constants for. ACTIVE = "ACTIVE" BUILD = "BUILD" REBOOT = "REBOOT" REBUILD = "REBUILD" RESCUE = "RESCUE" RESIZ...
2.203125
2
renthouse/apps/users/basic_tools.py
huifeng-kooboo/RentHouseSite
2
12791882
''' @description: basic function for common @return : return value is all by jsondata ''' #-*- coding:utf-8 -*- import json from django.contrib.auth.hashers import make_password,check_password from django.contrib.auth import authenticate def checkUserLoginInfo(username,password): ''' @brief: basic function to...
2.9375
3
src/Tasks/UnionOfIntervals.py
PaulLafytskyi/Hackerrank-Tests
0
12791883
<reponame>PaulLafytskyi/Hackerrank-Tests<gh_stars>0 if __name__ == '__main__': start = [5, 10] end = [3, 12] #if start[- 1] >
1.875
2
src/etools_validator/utils.py
unicef/etools-validator
0
12791884
<filename>src/etools_validator/utils.py from django.contrib.contenttypes.fields import GenericForeignKey from django.db.models import Model, ObjectDoesNotExist from django.db.models.fields.files import FieldFile from itertools import chain def get_all_field_names(model): '''Return a list of all field names that a...
2.234375
2
scripts/detokenize.py
mishu45/lang2sign
3
12791885
#!python # pylint: disable=redefined-outer-name,unexpected-keyword-arg """Script to detokenize text file""" from lang2sign.lang2gloss.tokenizers.en_asl import EnAslTokenizer if __name__ == "__main__": import argparse parser = argparse.ArgumentParser( description="Detokenize text files" ) par...
3.078125
3
web/web.py
BAFurtado/PolicySpace2
10
12791886
import os from flask import Blueprint, render_template, redirect, url_for, send_from_directory import conf from . import manager from .forms import SimulationForm bp = Blueprint('web', __name__) @bp.route('/') def index(): return render_template('status.html') @bp.route('/start', methods=['GET', 'POST']) de...
2.28125
2
code/model/common.py
lewisyangliu/LDP
3
12791887
import math import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable def default_conv(in_channels, out_channels, kernel_size, bias=True): return nn.Conv2d( in_channels, out_channels, kernel_size, padding=(kernel_size//2), bias=bias) class MeanShift(n...
2.5625
3
lab2.5/individual.py
etozhekimm/lab2
0
12791888
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys if __name__ == '__main__': tpl = tuple(map(float, input().split())) if not tpl: print("Заданный кортеж пуст", file=sys.stderr) exit(1) if tuple(sorted(tpl, reverse=True)) == tpl: print("Команды перечислены в соответствии с ...
3.40625
3
getchapp/migrations/0003_post_tag.py
gem763/getch
0
12791889
<filename>getchapp/migrations/0003_post_tag.py # Generated by Django 2.2.7 on 2020-01-08 09:40 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('getchapp', '0002_brand_item'), ] operations = [ migrations.C...
1.875
2
test/pyaz/sql/dw/__init__.py
bigdatamoore/py-az-cli
0
12791890
<filename>test/pyaz/sql/dw/__init__.py import json, subprocess from ... pyaz_utils import get_cli_name, get_params def create(__CATALOG_COLLATION=None, collation=None, __ELASTIC_POOL_ID=None, __LICENSE_TYPE=None, max_size=None, service_objective=None, __RESTORE_POINT_IN_TIME=None, __SAMPLE_NAME=None, __SKU=None, __SO...
1.992188
2
advanced_databases/lab2/populate.py
piotrgiedziun/university
0
12791891
#!/usr/bin/python import MySQLdb import random from datetime import datetime as dt, timedelta # MySQL format DATE_FORMAT = '%Y-%m-%d %H:%M:%S' db = MySQLdb.connect(host="localhost", user="root", passwd="", db="sakila") cur = db.cursor() print "connected" # truncate old data cur.execute("SET FOREIGN_KEY_CHECKS = 0...
2.8125
3
Classes/Magnet.py
PMSMcqut/pyleecan-of-manatee
2
12791892
# -*- coding: utf-8 -*- """Warning : this file has been generated, you shouldn't edit it""" from os import linesep from pyleecan.Classes.check import check_init_dict, check_var from pyleecan.Functions.save import save from pyleecan.Classes.frozen import FrozenClass from pyleecan.Methods.Machine.Magnet.comp_angle_open...
1.867188
2
tests/emmet-builders/test_electronic_structure.py
acrutt/emmet
19
12791893
from pathlib import Path import pytest from maggma.stores import JSONStore, MemoryStore from monty.serialization import dumpfn, loadfn from emmet.builders.materials.electronic_structure import ElectronicStructureBuilder from emmet.builders.vasp.materials import MaterialsBuilder @pytest.fixture(scope="session") def ...
1.882813
2
uri/2533.py
AdilsonTorres/programming-problems
0
12791894
<filename>uri/2533.py<gh_stars>0 while True: try: T = int(input()) except EOFError: break a, b = 0, 0 for i in range(T): n, c = map(int, input().split(' ')) a += n * c b += c * 100 print("{:.4f}".format(a / b))
2.6875
3
src/download.py
n3ssuno/MSA-patents
0
12791895
#!/usr/bin/env python """ Download needed raw data Author: <NAME> Copyright (c) 2021 - <NAME> License: See the LICENSE file. Date: 2021-02-05 """ import os import time import random import requests import tempfile import sys import zipfile import shutil import tarfile from tqdm import tqdm from parse_args import p...
2.796875
3
Samples/Simple_Demo/Python_Export/Export_forms_separately/child_window.py
Embarcadero/Delphi4PythonExporter
18
12791896
import os from delphifmx import * class Child_Form(Form): def __init__(self, owner): self.child_heading = None self.result_text_heading = None self.result_text_label = None self.LoadProps(os.path.join(os.path.dirname(os.path.abspath(__file__)), "child_window.pyfmx"))
1.96875
2
pypi_wheel/setup.py
mcellteam/mcell_build
2
12791897
import setuptools import platform import sys import os THIS_DIR = os.path.dirname(os.path.abspath(__file__)) BUILD_DIR = 'mcell/utils/pybind11_test/build/' if platform.system() == 'Linux': # TODO: copy mcell library to the current directory pass elif platform.system() == 'Darwin': # pass elif 'Windows...
1.648438
2
app/jobs/plex.py
Foxboron/Frank
7
12791898
#!/usr/bin/env python import requests from jobs import AbstractJob from lxml import etree class Plex(AbstractJob): def __init__(self, conf): self.interval = conf['interval'] self.movies = conf['movies'] self.shows = conf['shows'] self.timeout = conf.get('timeout') def _parse...
2.640625
3
.env-cbre/bin/django-admin.py
ThebiggunSeeoil/app-cbre-exxon
0
12791899
<reponame>ThebiggunSeeoil/app-cbre-exxon #!/Users/yutthachaithongkumchum/myproject/app-cbre-exxon/app-cbre-exxon/.env-cbre/bin/python3 from django.core import management if __name__ == "__main__": management.execute_from_command_line()
1.023438
1
custom/commands/osb_fix.py
M-Spencer-94/configNOW
3
12791900
<gh_stars>1-10 def run(cfg): """OSB Fix to deal with 11.1.1.5+ requirements""" username=cfg.getProperty('wls.admin.username') password=cfg.getProperty('wls.admin.password') admin=cfg.getProperty('osb.as.host') port=cfg.getProperty('wls.admin.listener.port') urladmin=admin + ":" + port ...
1.765625
2
Project/src/uff/ic/mell/sentimentembedding/statistical_evaluation/statistic_test.py
MeLLL-UFF/tuning_sentiment
2
12791901
from scipy import stats import scikit_posthocs as sp import numpy as np import pandas as pd import glob def friedman_test(dataframe): return stats.friedmanchisquare(*[row for index, row in dataframe.T.iterrows()]) def nemenyi_test(dataframe): nemenyi = sp.posthoc_nemenyi_friedman(dataframe) list_index=[] ...
2.78125
3
client.py
jorgebg/pysoa-example
1
12791902
<filename>client.py from pysoa.client import Client from settings import SOA_CLIENT_SETTINGS if __name__ == '__main__': client = Client({'example': SOA_CLIENT_SETTINGS}) action_response = client.call_action('example', 'square', {'number': 42}) print(action_response)
2.3125
2
lightreid/models/architectures/build.py
nataliamiccini/light-reid
296
12791903
<gh_stars>100-1000 from lightreid.utils import Registry ARCHs_REGISTRY = Registry('arch')
1.21875
1
dz/dz-02/src/searches/nelder_mead.py
Yalfoosh/AIPR
0
12791904
# Copyright 2020 Yalfoosh # # 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, softw...
2.6875
3
autobump.py
rfrandse/mytools
0
12791905
#!/usr/bin/env python2 import argparse import os #import sh import sys import math import subprocess PIPE = subprocess.PIPE try: import git from git import GitCommandError HAVE_GIT = True except ImportError: # _log.debug('Failed to import git module') HAVE_GIT = False def log(msg, args): if a...
2.421875
2
wapps/migrations/0005_drop_identity_logo.py
apihackers/wapps
7
12791906
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-08-08 14:52 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('wapps', '0004_add_wapps_image'), ] operations = [ migrations.RemoveField( ...
1.328125
1
experiments/jaccard_metric/test_jaccard.py
jajajaqlt/nsg
10
12791907
<reponame>jajajaqlt/nsg # Copyright 2017 Rice University # # 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 la...
1.5625
2
options/__init__.py
kwshh/ImageDeconvlution
25
12791908
<reponame>kwshh/ImageDeconvlution from .running_options import *
1.007813
1
PetService/apps.py
sifullahrakin/HelloPaw
0
12791909
from django.apps import AppConfig class PetserviceConfig(AppConfig): name = 'PetService'
1.164063
1
video_module.py
RoboQYD/cobblr-video-recorder
0
12791910
from engine import SystemState from engine import Utilities from engine import Menu from engine import Screen from engine import TextWriter from engine import Events import RPi.GPIO import pyaudio import wave import atexit import io import stat import os import signal import picamera import time import sys import threa...
2.296875
2
mysqlsmo/objects/table_constraints/__init__.py
DaeunYim/pgtoolsservice
33
12791911
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
1.375
1
tf_datasets/datasets_old/cifar10.py
tmattio/tf_datasets
5
12791912
<reponame>tmattio/tf_datasets # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import hashlib import shutil import sys from six.moves import cPickle import numpy as np import tensorflow as tf from tf_datasets.core.download i...
2.3125
2
nicos_demo/vrefsans/setups/nok/sc2.py
jkrueger1/nicos
12
12791913
description = "sc2 height after nok9" group = 'lowlevel' devices = dict( sc2 = device('nicos.devices.generic.VirtualMotor', description = 'sc2 Motor', abslimits = (-150, 150), speed = 1., unit = 'mm', # refpos = -7.2946, ), )
1.6875
2
gh_build.py
sonvt1710/manga-py
337
12791914
#!/usr/bin/python3 # -*- coding: utf-8 -*- from helpers.gh_pages import main main()
1.234375
1
officials/migrations/0003_auto_20210523_0810.py
Fabrice-64/advocacy_project
0
12791915
<filename>officials/migrations/0003_auto_20210523_0810.py # Generated by Django 3.1.5 on 2021-05-23 08:10 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('communities', '0002_auto_20210523_0725'), ('officials', '0...
1.523438
2
tests/src/Composite_report/click_on_district_block_cluster_home.py
JalajaTR/cQube
0
12791916
from selenium.webdriver.support.select import Select from Data.parameters import Data from reuse_func import GetData class click_on_home(): def __init__(self,driver): self.driver = driver def test_homeicon(self): self.p = GetData() self.driver.implicitly_wait(20) self.driver....
2.796875
3
en-us/sbs/wire/led.py
chain01/wiki
13
12791917
<reponame>chain01/wiki<gh_stars>10-100 from machine import Pin gpio1 = Pin(GPIO1, Pin.OUT, Pin.PULL_DISABLE, 0) import utime i = 1 # GPIOn 整型。引脚号。 # 引脚对应关系如下: # GPIO1–引脚号 22 # GPIO2–引脚号 23 # GPIO3–引脚号 178 # GPIO4–引脚号 199 # GPIO5–引脚号 204 # direction 整型。 # IN 输入模式 # OUT 输出模式 # pullMode 整型。 # PULL_DISABLE 浮空模式 ...
2.890625
3
tests/unit/test_lists.py
scherroman/mugen
119
12791918
import pytest from mugen import lists from mugen.lists import MugenList class Dummy(object): foo = 1 @pytest.fixture def mugen_list() -> MugenList: return MugenList([Dummy(), Dummy(), Dummy(), Dummy(), Dummy(), Dummy()]) @pytest.mark.parametrize("l, expected_foo", [ (mugen_list(), [1, 1, 1, 1, 1, 1])...
2.75
3
utilities/mytests/fileexplorerdict.py
Saldenisov/pyconlyse
0
12791919
<filename>utilities/mytests/fileexplorerdict.py from PyQt5.QtWidgets import QApplication, QTreeWidget, QTreeWidgetItem from PyQt5.QtCore import QModelIndex class ViewTree(QTreeWidget): def __init__(self, value): super().__init__() self.clicked.connect(self.click) def fill_item(item, valu...
2.78125
3
src/osm2paths.py
MikeNezumi/osm2tracks
1
12791920
<filename>src/osm2paths.py """ This is the main function with main script, the application. Inputs: from console Output: Window animation + console metrics (potentially) """ import pyglet import subprocess import json import os from pyglet.gl import * from scripts.read_json import get_dict from scripts.render_json im...
2.59375
3
server.py
doppioandante/covid_andamento_regionale
5
12791921
<gh_stars>1-10 # -*- coding: utf-8 -*- import argparse from datetime import datetime from pathlib import Path import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output, State import covid_data external_scripts = ["https://cdn.plot.ly/plotly-locale-i...
2.375
2
basecategory/views.py
RevolutionTech/revolutiontech.ca
0
12791922
""" :Created: 13 July 2015 :Author: <NAME> """ import random from django.http import HttpResponseRedirect from django.urls import reverse from django.views.generic import TemplateView class HomeView(TemplateView): template_name = "home.html" class CategoryPageView(TemplateView): template_name = "catego...
2.390625
2
musicbot/cogs/music.py
richteer/py-music-bot
0
12791923
from discord.ext import commands import discord import asyncio import youtube_dl import logging import math import random import heapq from urllib import request from ..video import Video from ..video import Setlist # TODO: abstract FFMPEG options into their own file? FFMPEG_BEFORE_OPTS = '-reconnect 1 -reconnect_stre...
2.734375
3
lwip_py/stack/exceptions.py
vvish/py-lwip
2
12791924
class StackException(Exception): """Base class for stack-related exceptions.""" class LwipError(StackException): """Class representing lwip error codes.""" _mapping = { -1: 'Out of memory', -2: 'Buffer error', -3: 'Timeout', -4: 'Routing problem', -5: 'Operation in...
3.3125
3
frontend/web/core/view_mixins.py
uktrade/trade-access-program
1
12791925
<filename>frontend/web/core/view_mixins.py from django.urls import reverse from django.utils.http import urlencode from django.utils.translation import gettext_lazy as _ class BackContextMixin: back_text = None back_url = None def get_back_url(self): if hasattr(self, 'back_url_name') and getattr(...
2.171875
2
config.py
marijawo/jp
0
12791926
<gh_stars>0 # config.py import os basedir = os.path.abspath((os.path.dirname(__file__))) class BaseConfig(object): DEBUG = True SECRET_KEY = <KEY>' SQLALCHEMY_DATABASE_URI = 'mysql://username:password@localhost/mitdb' # SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \ # ...
2.125
2
crabageprediction/venv/Lib/site-packages/fontTools/ttLib/tables/_c_i_d_g.py
13rianlucero/CrabAgePrediction
2,705
12791927
# coding: utf-8 from .otBase import BaseTTXConverter class table__c_i_d_g(BaseTTXConverter): """The AAT ``cidg`` table has almost the same structure as ``gidc``, just mapping CIDs to GlyphIDs instead of the reverse direction. It is useful for fonts that may be used by a PDF renderer in lieu of a font reference w...
2.46875
2
python-pass.py
Ri-dha/GIZ-pass-python
0
12791928
<gh_stars>0 class Solution: def longestPalindrome(self, s: str) -> str: # function to find the longest palindrome from the string def pointersfun(left,right): #we start from the middle of the string then go left and right to find out the longest Palindrome while (...
3.875
4
heightmaptilemaker/mesh/greiner_hormann_clipper.py
ulrichji/HeightmapTileMaker
0
12791929
<reponame>ulrichji/HeightmapTileMaker from .polygon_boolean_operator import PolygonBooleanOperator from enum import Enum from math import sqrt class IntersectionType(Enum): NOT_AN_INTERSECTION=0 UNKNOWN=1 ENTRY=2 EXIT=3 def isIntersection(self): return self == self.UNKNOWN or self == self...
3.15625
3
app/routes/models/form_model.py
mampilly/fileaccess
0
12791930
<filename>app/routes/models/form_model.py<gh_stars>0 from pydantic import BaseModel from fastapi.param_functions import Body from typing import Optional class FormModel(BaseModel): first_name: str = None second_name: str
1.859375
2
python_meteorologist/forecast/__init__.py
AlertingAvian/python-meteorologist
0
12791931
from .forecast import Forecaster
1.117188
1
NintendoOne/api/noe.py
Hkakashi/nintendo-one
2
12791932
<filename>NintendoOne/api/noe.py from typing import Iterator, Optional import requests, json SEARCH_URL = "http://search.nintendo-europe.com/en/select" def _search( query: str = "*", nsuid: str = None, ) -> Iterator[dict]: ''' make query to noe api return a iterator of diction useful ...
3.390625
3
backend/api/migrations/0009_merge_20180723_0852.py
pietervdvn/healthdata
6
12791933
# Generated by Django 2.0.7 on 2018-07-23 08:52 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('api', '0008_merge_20180723_0613'), ('api', '0006_auto_20180719_2243'), ] operations = [ ]
1.351563
1
utils.py
AnyByte/ErgoKB
0
12791934
import matplotlib.pyplot as plt from multiprocessing import Pool, Manager, cpu_count from functools import partial import numpy as np from bs4 import BeautifulSoup from colour import Color import copy import math import re import time from consts import QWERTY, THUMBS, COORDS CACHE = {} def cleanhtml(raw_html): ...
2.4375
2
Project/source/data_retrieval/remoteGet.py
EricPapagiannis/CSCC01-team10-Project
1
12791935
class remoteGet: def __init__(self, link, saveTo): self._link = link self._saveTo = saveTo def getFile(self): '''(NoneType) -> NoneType Retrieves file from set url to set local destination Raises CannotRetrieveFileException Returns NoneType ''' im...
2.796875
3
agent/input/sysinfo.py
tcarlisi/dxagent
3
12791936
""" sysinfo.py obtain system informations @author: K.Edeline """ import platform class SysInfo(): """ extend me """ def __init__(self): self.system = platform.system() self.node = platform.node() self.release = platform.release() self.version = platform.version() s...
2.890625
3
tclothes/clothes/models/interactions.py
EstebanMongui/tclothes
1
12791937
"""Interactions model""" # Django from django.db import models # Utils from tclothes.utils.baseModels import TClothesModel class InteractionsModel(TClothesModel): """Interactions interactions model.""" clothe = models.ForeignKey( 'clothes.ClothesModel', on_delete=models.CASCADE ) us...
3.015625
3
_broken/old/matching_functions.py
SU-ECE-17-7/ibeis
0
12791938
<filename>_broken/old/matching_functions.py # -*- coding: utf-8 -*- """ #================= # matching_functions: # Module Concepts #================= PREFIXES: qaid2_XXX - prefix mapping query chip index to qfx2_XXX - prefix mapping query chip feature index to TUPLES: * nns - a (qfx2_dx, qfx2_dist) tuple * nnfi...
2.03125
2
kg/ner/preprocess.py
ToddMorrill/knowledge-graphs
2
12791939
""" This module contains preprocessing code to prepare data for training and inference. Examples: $ python preprocess.py \ --config configs/baseline.yaml """ import argparse from collections import Counter import os from types import SimpleNamespace import pandas as pd import torch import torchtext from ...
3.015625
3
tests/test_zero_forcing.py
somacdivad/grinpy
12
12791940
import grinpy as gp import pytest class TestZeroForcing: def test_non_integral_value_for_k_raises_TypeError_in_is_k_forcing(self): with pytest.raises(TypeError): G = gp.star_graph(2) gp.is_k_forcing_vertex(G, 1, [1], 1.5) def test_0_value_for_k_raises_ValueError_in_is_k_forcin...
2.265625
2
StudentsPerformance.py
AbhigyanRanjan0505/dvyo5sh6g9vdynxfoiubte
0
12791941
import plotly.figure_factory as ff import plotly.graph_objects as go import pandas as pd import statistics dataframe = pd.read_csv("StudentsPerformance.csv") data_list = dataframe["reading score"].to_list() data_mean = statistics.mean(data_list) data_median = statistics.median(data_list) data_mode = statist...
3.484375
3
models/entidad_paciente.py
gopherss/PClinicaRehabilitacion
0
12791942
<filename>models/entidad_paciente.py from database import conexion, consulta from math import pow class Paciente: nombre: str apellido: str celular: str genero: str dni: str peso: float talla: float fecha_nacimiento: str def __init__(self, nombre, apellido, celular, genero, dni, ...
2.484375
2
crazyflie_demo/scripts/hl_traj.py
wydmynd/crazyflie_tom
0
12791943
#!/usr/bin/env python # source - https://github.com/whoenig/crazyflie_ros/commit/b048c1f2fd3ee34f899fa0e2f6c58a4885a39405#diff-970be3522034ff436332d391db26982a from __future__ import absolute_import, division, unicode_literals, print_function import rospy import crazyflie import uav_trajectory import time import tf #...
1.90625
2
Authentication.py
ueabu/RaspberryPi-Spotify-Controller
2
12791944
import json from flask import Flask, request, redirect, session import requests import json from urllib.parse import quote app = Flask(__name__) app.secret_key = "super secret key" # Authentication Steps, paramaters, and responses are defined at https://developer.spotify.com/web-api/authorization-guide/ # Visit this ...
3
3
books/urls.py
simonv3/django-reading-list
1
12791945
from django.conf.urls import patterns, include, url from rest_framework import routers from books.api import views as api_views from books import views router = routers.DefaultRouter() # TODO: Nest API endpoints # # from rest_framework_extensions.routers import ExtendedSimpleRouter router.register(r'books', api_vie...
1.96875
2
Machine Learning/House price prediction/server/app.py
rokingshubham1/Python_Scripts
20
12791946
from flask import Flask , request , jsonify,render_template import util app=Flask(__name__) @app.route('/') def get_location_names(): response = util.get_location_names() print(response) #response.headers.add('Access-control-Allow-origin','*') return render_template('app.html',response=response) @app....
3.046875
3
estimagic/inference/bootstrap_samples.py
vishalbelsare/estimagic
83
12791947
import numpy as np import pandas as pd def get_bootstrap_indices(data, cluster_by=None, seed=None, n_draws=1000): """Draw positional indices for the construction of bootstrap samples. Storing the positional indices instead of the full bootstrap samples saves a lot of memory for datasets with many variabl...
3.296875
3
demo_app/lib/layers/fetch.py
HiImJayHireMe/garnish
0
12791948
<gh_stars>0 from concurrent.futures import ThreadPoolExecutor from garnish.garnish import Layer class ConcurrentFetchLayer(Layer): def __call__(self, *args, **kwargs): def call(t): return t.__call__() with ThreadPoolExecutor(max_workers=4) as pool: results = list(pool.map...
2.40625
2
services/workers/settings/base.py
paulowe/aws-boilerplate
711
12791949
import json import boto3 from environs import Env env = Env() AWS_ENDPOINT_URL = env('AWS_ENDPOINT_URL', None) SMTP_HOST = env('SMTP_HOST', None) EMAIL_ENABLED = env.bool('EMAIL_ENABLED', default=True) secrets_manager_client = boto3.client('secretsmanager', endpoint_url=AWS_ENDPOINT_URL) def fetch_db_secret(db_se...
2
2
examples/cmdui_example.py
TheBrokenEstate/CMDUI
3
12791950
<filename>examples/cmdui_example.py import sys sys.path.insert(0,'..') import threading import time import CMDUI as CMD def counter(): btn_txt.set("Stop") tt = time.time() while running: t = f"{time.time()-tt:.2f}" txt.set(t) time.sleep(0.01) btn_txt.set("Reset") def...
2.9375
3