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
qnap_locate_parser.py
killruana/snippets
0
12500
<reponame>killruana/snippets #!/usr/bin/env python3 import json import sys import clize def get_file_handler(input_file): if input_file is None: return sys.stdin return open(input_file, 'r') @clize.clize def main(input_file=None): result = {'datas': []} with get_file_han...
2.5625
3
evennia/contrib/tutorial_examples/mirror.py
lootcrawl/evennia
0
12501
""" TutorialMirror A simple mirror object to experiment with. """ from evennia import DefaultObject from evennia.utils import make_iter, is_iter from evennia import logger class TutorialMirror(DefaultObject): """ A simple mirror object that - echoes back the description of the object looking at it ...
3.4375
3
python/patternlock.py
Floozutter/silly
0
12502
<gh_stars>0 from tkinter import Tk from turtle import ScrolledCanvas, TurtleScreen, RawTurtle DIGIT2POS = dict(zip( "123456789", ((100 * (j - 1), 100 * (-i + 1)) for i in range(3) for j in range(3)) )) def draw_dots(turt: RawTurtle) -> None: penstate = turt.pen() turt.penup() for x, y in DIGIT2POS...
3.359375
3
synthesizing/gui/python-portmidi-0.0.7/test_pyportmidi.py
Chiel92/MusicTheory
0
12503
<reponame>Chiel92/MusicTheory #!/usr/bin/env python # test code for PyPortMidi # a port of a subset of test.c provided with PortMidi # <NAME> # harrison [at] media [dot] mit [dot] edu # March 15, 2005: accommodate for SysEx messages and preferred list formats # SysEx test code contributed by <NAME> # ...
2.5
2
cnn_model/Compute_accuarcy.py
csJd/dg_text_contest_2018
0
12504
<gh_stars>0 #coding=utf-8 import pandas as pd def get_labels(init_file,predict_file): init_label = [] predict_label = [] pd_init = pd.read_csv(init_file,sep="^",header=None) for index,row in pd_init.iterrows(): init_label.append(row[0]) pd_predict = pd.read_csv(predict_file,sep=",",he...
3.0625
3
ex01/arquivo/__init__.py
duartele/exerc-python
0
12505
from ex01.funcoes import * def arqExiste(nome): try: a = open(nome, 'rt') #rt = read text a.close() except FileNotFoundError: return False else: return True def criarArq(nome): try: a = open(nome, 'wt+') #wt = write text and + = create one if it not exists ...
3.609375
4
ck_airport.py
58565856/checkinpanel
3
12506
<reponame>58565856/checkinpanel<gh_stars>1-10 # -*- coding: utf-8 -*- """ :author @Icrons cron: 20 10 * * * new Env('机场签到'); """ import json import re import traceback import requests import urllib3 from notify_mtr import send from utils import get_data urllib3.disable_warnings() class SspanelQd(object): def ...
2.359375
2
src/04_exploration/03_determine_fire_season.py
ranarango/fuegos-orinoquia
0
12507
# ----------------------------------------------------------------------- # Author: <NAME> # # Purpose: Determines the fire season for each window. The fire season is # defined as the minimum number of consecutive months that contain more # than 80% of the burned area (Archibald ett al 2013; Abatzoglou et al. # 2018). ...
2.75
3
holo/modules/blender.py
chinarjoshi/holo
1
12508
<reponame>chinarjoshi/holo import bpy import json from bpy.types import SpaceView3D from bpy.app.handlers import persistent from mathutils import Quaternion, Matrix, Vector from holo.gestures import prediction_from_camera def duplicate_window(window_type: str = 'INVOKE_DEFAULT') -> None: """Duplicates a new windo...
2.0625
2
ncp/models/det_mix_ncp.py
JoeMWatson/ncp
2
12509
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
1.992188
2
api/models/target.py
zanachka/proxy-service
1
12510
""" DB operations for Targets """ from api.models.base import DBModel class TargetDB(DBModel): '''DBModel for the targets table''' tablename = 'targets'
1.625
2
myTeam.py
alexrichardson21/PacmanDQNAgent
0
12511
<filename>myTeam.py # myTeam.py # --------- # Licensing Infoesmation: You are free to use or extend these projects for # educational purposes provided that (1) you do not distribute or publish # solutions, (2) you retain this notice, and (3) you provide clear # attribution to UC Berkeley, including a link to http://ai...
2.296875
2
wordBreak2.py
saai/LeetcodePythonSolutions
0
12512
<gh_stars>0 class Solution: # @param s, a string # @param wordDict, a set<string> # @return a string[] def wordBreak(self, s, wordDict): n = len(s) res = [] chars = ''.join(wordDict) for i in xrange(n): if s[i] not in chars: return res ...
3.1875
3
setup.py
astrodeepnet/sbi_experiments
3
12513
from setuptools import setup, find_packages setup( name='SBIExperiments', version='0.0.1', url='https://github.com/astrodeepnet/sbi_experiments', author='<NAME> and friends', description='Package for numerical experiments of SBI tools', packages=find_packages(), install_requires=[ 'numpy>=1.19.2', ...
1.085938
1
deploy/deploy_asterisk_provider2.py
orpolaczek/astricon-2017-demos
0
12514
<reponame>orpolaczek/astricon-2017-demos<gh_stars>0 import datetime import libcloud from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver from pprint import pprint Engine = get_driver(Provider.ELASTICHOSTS) driver = Engine("733b7dc7-7498-4db4-9dc4-74d3fee8abed", ...
2.125
2
todo/admin.py
haidoro/TODO_lesson
0
12515
<gh_stars>0 from django.contrib import admin from .models import TodoModel admin.site.register(TodoModel)
1.210938
1
assignments/06-python-first-lines/first_lines.py
antoniog1995/biosys-analytics
0
12516
#!/usr/bin/env python3 """ Author : antoniog1 Date : 2019-02-21 Purpose: Rock the Casbah """ import argparse import sys import os # -------------------------------------------------- def get_args(): """get command-line arguments""" parser = argparse.ArgumentParser( description='Argparse Python scri...
3.4375
3
lvmsurveysim/target/target.py
albireox/lvmsurveysim
0
12517
<filename>lvmsurveysim/target/target.py #!/usr/bin/env python # encoding: utf-8 # # @Author: <NAME> # @Date: Oct 10, 2017 # @Filename: target.py # @License: BSD 3-Clause # @Copyright: <NAME> from __future__ import division from __future__ import print_function from __future__ import absolute_import import os import ...
2.53125
3
samples/snippets/test_export_to_bigquery.py
renovate-bot/python-contact-center-insights
4
12518
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
1.984375
2
Author/admin.py
CMPUT404-Fa21-Organization/CMPUT404-Project-Social-Distribution
3
12519
<gh_stars>1-10 from django.contrib import admin from django.contrib.auth.admin import UserAdmin from .models import * # Register your models here. def set_active(modeladmin, request, queryset): for user in queryset: user.is_active = True user.save() set_active.short_description = 'Set Account Stat...
2.203125
2
TP2/pyApp/venv/lib/python3.8/site-packages/pyloco/task.py
MariusBallot/09-2021-Robotics-EFREI-Files
0
12520
<gh_stars>0 # -*- coding: utf-8 -*- """task module.""" from __future__ import unicode_literals import sys import os import pydoc import time import json import logging import collections import pkg_resources import subprocess import webbrowser import websocket from pyloco.parse import TaskArgParser, PylocoArgParser ...
2.015625
2
azure-iot-device/azure/iot/device/aio/__init__.py
olivakar/azure-iot-sdk-python
0
12521
<filename>azure-iot-device/azure/iot/device/aio/__init__.py<gh_stars>0 """Azure IoT Device Library - Asynchronous This library provides asynchronous clients for communicating with Azure IoT services from an IoT device. """ from azure.iot.device.iothub.aio import * from azure.iot.device.provisioning.aio import * from ...
1.632813
2
lino_xl/lib/reception/__init__.py
khchine5/xl
1
12522
<reponame>khchine5/xl<gh_stars>1-10 # -*- coding: UTF-8 -*- # Copyright 2013-2016 <NAME> # # License: BSD (see file COPYING for details) """This module is for managing a reception desk and a waiting queue: register clients into a waiting queue as they present themselves at a reception desk (Empfangsschalter), and unre...
2.21875
2
old/accent_analyser/rules/RuleRemoveThe.py
stefantaubert/eng2ipa-accent-transformer
0
12523
from accent_analyser.rules.EngRule import EngRule class RuleRemoveThe(EngRule): def __init__(self, likelihood=1.0): super().__init__(likelihood) def _convert_core(self, words: list, current_index: int): word = words[current_index].content if word == "the": return "" else: return word
2.75
3
ssrl/providers/base.py
AspirinGeyer/PySSRL
6
12524
<reponame>AspirinGeyer/PySSRL # -*- coding:utf-8 -*- class BaseProvider(object): @staticmethod def loads(link_url): raise NotImplementedError("Implemetion required.") @staticmethod def dumps(conf): raise NotImplementedError("Implemetion required.")
1.96875
2
tornado_demo/web2py/applications/examples/controllers/global.py
ls-2018/tips
2
12525
session.forget() def get(args): if args[0].startswith('__'): return None try: obj = globals(), get(args[0]) for k in range(1, len(args)): obj = getattr(obj, args[k]) return obj except: return None def vars(): """the running controller function!""" ...
2.171875
2
medium/python3/c0108_223_rectangle-area/00_leetcode_0108.py
drunkwater/leetcode
0
12526
# DRUNKWATER TEMPLATE(add description and prototypes) # Question Title and Description on leetcode.com # Function Declaration and Function Prototypes on leetcode.com #223. Rectangle Area #Find the total area covered by two rectilinear rectangles in a 2D plane. #Each rectangle is defined by its bottom left corner and to...
3.40625
3
serialTest.py
fmuno003/SeniorDesign
1
12527
import serial import RPi.GPIO as GPIO import time ser=serial.Serial("/dev/ttyACM0",9600) start_time = time.time() imu = open("IMU.txt","w") while time.time() - start_time <= 1: ser.readline() while time.time() - start_time <= 8: read_ser=ser.readline() if float(read_ser) == 0.00: pa...
2.796875
3
src/pyg_base/_zip.py
nclarey/pyg-base
0
12528
from pyg_base._types import is_iterable from pyg_base._loop import len0 __all__ = ['zipper', 'lens'] def lens(*values): """ measures (and enforces) a common length across all values :Parameters: ---------------- *values : lists Raises ------ ValueError if you have values with...
3.765625
4
cli/pawls/preprocessors/grobid.py
vtcaregorodtcev/pawls-1
0
12529
<reponame>vtcaregorodtcev/pawls-1 import json from typing import List import requests from pawls.preprocessors.model import Page def fetch_grobid_structure(pdf_file: str, grobid_host: str = "http://localhost:8070"): files = { "input": (pdf_file, open(pdf_file, "rb"), "application/pdf", {"Expires": "0"}) ...
2.65625
3
scripts/run_custom_eslint_tests.py
lheureuxe13/oppia
4
12530
# coding: utf-8 # # Copyright 2020 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
2.359375
2
nmpc_mhe/tst_algorithmsv2_nmpc_hi_t0115_setp.py
joycezyu/cappresse
0
12531
from __future__ import print_function from pyomo.environ import * from pyomo.core.base import Constraint, Objective, Suffix, minimize from pyomo.opt import ProblemFormat, SolverFactory from nmpc_mhe.dync.NMPCGenv2 import NmpcGen from nmpc_mhe.mods.bfb.nob5_hi_t import bfb_dae from snap_shot import snap import sys, os i...
1.8125
2
csvapi/security.py
quaxsze/csvapi
15
12532
from urllib.parse import urlparse from quart import current_app as app, request, jsonify def filter_referrers(): filters = app.config.get('REFERRERS_FILTER') if not filters: return None referrer = request.referrer if referrer: parsed = urlparse(referrer) for filter in filters:...
2.515625
3
linkit/models.py
what-digital/linkit
8
12533
from django.db import models from filer.fields.file import FilerFileField class FakeLink(models.Model): """ In our widget we need to manually render a AdminFileFormField. Basically for every other Field type this is not a problem at all, but Failer needs a rel attribute which consists of a reverse relatio...
2.171875
2
tests/helper.py
nirs/python-manhole
0
12534
from __future__ import print_function import atexit import errno import logging import os import select import signal import sys import time from process_tests import setup_coverage TIMEOUT = int(os.getenv('MANHOLE_TEST_TIMEOUT', 10)) SOCKET_PATH = '/tmp/manhole-socket' OUTPUT = sys.__stdout__ def handle_sigterm(s...
1.953125
2
ecommerce/User/admin.py
AwaleRohin/commerce-fm
18
12535
from django.contrib import admin from django.conf import settings from django.core.exceptions import ImproperlyConfigured from . import models if settings.HAS_ADDITIONAL_USER_DATA: try: class UserProfileInline(admin.TabularInline): model = models.UserProfile extra = 0 except (...
2.21875
2
client/external/xp_tracker.py
Suirdna/OR-Origin
0
12536
from client import exception, embed_creator, console_interface, discord_manager, file_manager, ini_manager, json_manager, origin, permissions, server_timer from client.config import config as c, language as l from discord.ext import commands, tasks from client.external.hiscores import hiscores_xp from PIL import Image,...
2
2
days/01/part1.py
gr3yknigh1/aoc2021
0
12537
<filename>days/01/part1.py<gh_stars>0 from __future__ import annotations import os import collections BASE_PATH = os.path.dirname(__file__) INPUT_PATH = os.path.join(BASE_PATH, "input.txt") OUTPUT_PATH = os.path.join(BASE_PATH, "output.txt") def proceed_buffer(buffer: str) -> list[int]: return [int(line) for ...
2.984375
3
src/ensemble_nn/agent_nn.py
AbhinavGopal/ts_tutorial
290
12538
<reponame>AbhinavGopal/ts_tutorial """Agents for neural net bandit problems. We implement three main types of agent: - epsilon-greedy (fixed epsilon, annealing epsilon) - dropout (arXiv:1506.02142) - ensemble sampling All code is specialized to the setting of 2-layer fully connected MLPs. """ import numpy as np...
3.375
3
leaflet_storage/management/commands/storagei18n.py
Biondilbiondo/django-leaflet-storage-concurrent-editing
0
12539
<filename>leaflet_storage/management/commands/storagei18n.py<gh_stars>0 import io import os from django.core.management.base import BaseCommand from django.conf import settings from django.contrib.staticfiles import finders from django.template.loader import render_to_string from django.utils.translation import to_loc...
2.3125
2
spikemetrics/metrics.py
MarineChap/spikemetrics
0
12540
# Copyright © 2019. <NAME>. All rights reserved. import numpy as np import pandas as pd from collections import OrderedDict import math import warnings from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA from sklearn.neighbors import NearestNeighbors from sklearn.metrics import silhouette_sco...
2.515625
3
pdpbox/pdp_plot_utils.py
flinder/PDPbox
0
12541
import pandas as pd import numpy as np import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec import copy from .pdp_calc_utils import _sample_data, _find_onehot_actual, _find_closest from sklearn.cluster import MiniBatchKMeans, KMeans def _pdp_plot_title(n_grids, feature_name, ax, multi_flag, whi...
2.671875
3
tests/basic_step_tests.py
kodexa-ai/kodexa
1
12542
import os import pytest from kodexa import Document, Pipeline, PipelineContext, TagsToKeyValuePairExtractor, RollupTransformer def get_test_directory(): return os.path.dirname(os.path.abspath(__file__)) + "/../test_documents/" @pytest.mark.skip def test_html_rollup(): document = Document.from_msgpack(open...
2.171875
2
dftimewolf/lib/containers/__init__.py
fooris/dftimewolf
1
12543
<reponame>fooris/dftimewolf<filename>dftimewolf/lib/containers/__init__.py """Make containers available here.""" from .report import Report from .threat_intelligence import ThreatIntelligence from .stackdriver import StackdriverLogs
1.210938
1
egs/skl_historical_poly_regression_variable_window_overmqtt/client_mqtt_random.py
COMEA-TUAS/mcx-public
0
12544
<reponame>COMEA-TUAS/mcx-public #!/usr/bin/env python3 """Script for simulating IOT measurement stream to ModelConductor experiment.""" import pandas as pd import numpy as np import sqlalchemy as sqla from datetime import datetime as dt from time import sleep, time import logging import sys, os, asyncio from hbmqtt.c...
2.078125
2
5/challenge2.py
roryeiffe/Adent-of-Code
0
12545
<reponame>roryeiffe/Adent-of-Code import sys import math L = [] f = open(sys.argv[1],"r") for item in f: L.append(item.strip()) def find_id(sequence): rows = sequence[:7] seats = sequence[7:] upper = 127 lower = 0 for letter in rows: half = math.ceil((upper-lower)/2) if letter == "F": upper -= half ...
3.09375
3
Injector/injector.py
MateusGabi/Binary-Hacking-on-Super-Mario
1
12546
# -*- coding: utf-8 -*- """ Injector. A partir de um arquivo binario, de uma tabela binaria gerada com o Finder, e um arquivo de substituição, o Injector é capaz de injetar um texto no binario trocando o texto in-game O Injector faz automaticamente a adequação do tamanho do texto ao tamanho da caixa, truncan...
3.046875
3
var/spack/repos/scs_io/packages/cudnn/package.py
scs-lab/spack
0
12547
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os from spack import * class Cudnn(Package): """NVIDIA cuDNN is a GPU-accelerated library of primitives for d...
1.703125
2
python/svm.py
mwalton/em-machineLearning
0
12548
import numpy as np import argparse import os.path import plots as plot from sklearn.preprocessing import StandardScaler from sklearn.grid_search import GridSearchCV import time from sklearn import svm from sklearn.metrics import classification_report from sklearn.metrics import accuracy_score from sklearn.externals imp...
2.453125
2
aio_logstash/formatter.py
SinaKhorami/aio-logstash
4
12549
<gh_stars>1-10 import abc import json import logging import socket import sys import time import aio_logstash import traceback from aio_logstash import constants from datetime import datetime, date class BaseFormatter(logging.Formatter): def __init__(self, message_type='aio_logstash', fqdn=False): super(...
2.109375
2
.venv/lib/python2.7/site-packages/celery/events/cursesmon.py
MansoorHanif/FYP-web-app
4
12550
# -*- coding: utf-8 -*- """Graphical monitor of Celery events using curses.""" from __future__ import absolute_import, print_function, unicode_literals import curses import sys import threading from datetime import datetime from itertools import count from textwrap import wrap from time import time from math import c...
2.421875
2
features/extraction/3_extraction/feature_extractors/utilization.py
bayesimpact/readmission-risk
19
12551
"""A feature extractor for patients' utilization.""" from __future__ import absolute_import import logging import pandas as pd from sutter.lib import postgres from sutter.lib.feature_extractor import FeatureExtractor log = logging.getLogger('feature_extraction') class UtilizationExtractor(FeatureExtractor): ...
2.953125
3
safe_control_gym/math_and_models/normalization.py
catgloss/safe-control-gym
120
12552
"""Perform normalization on inputs or rewards. """ import numpy as np import torch from gym.spaces import Box def normalize_angle(x): """Wraps input angle to [-pi, pi]. """ return ((x + np.pi) % (2 * np.pi)) - np.pi class RunningMeanStd(): """Calulates the running mean and std of a data stream. ...
3.328125
3
networking/pycat.py
itsbriany/PythonSec
1
12553
<reponame>itsbriany/PythonSec #!/usr/bin/python import socket import threading import sys # Support command line args import getopt # Support command line option parsing import os # Kill the application import signal # Catch an interrupt import time # Thread sleeping # Global variables definitions target =...
3
3
code/striatal_model/neuron_model_tuning.py
weidel-p/go-robot-nogo-robot
1
12554
<gh_stars>1-10 import nest import pylab as pl import pickle from nest import voltage_trace from nest import raster_plot as rplt import numpy as np from params import * seed = [np.random.randint(0, 9999999)] * num_threads def calcFI(): #amplitudesList = np.arange(3.5,4.5,0.1) amplitudesList = np.arange(100,...
2.046875
2
fastf1/tests/test_livetiming.py
JellybeanAsh/Fast-F1
690
12555
<filename>fastf1/tests/test_livetiming.py import os from fastf1.core import Session, Weekend from fastf1.livetiming.data import LiveTimingData def test_file_loading_w_errors(): # load file with many errors and invalid data without crashing livedata = LiveTimingData('fastf1/testing/reference_data/livedata/wit...
2.65625
3
src/plot/S0_read_jld2.py
OUCyf/NoiseCC
4
12556
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Oct 21 20:09:08 2021 ###################### ##### read h5 ######## ###################### # 1.read h5-file h5_file = h5py.File(files[1],'r') # 2.show all keys in h5-file h5_file.keys() # 3.循环读取所有 keys in h5-file for key in h5_file.keys(): onekey =...
2.484375
2
setup.py
MrJakeSir/theming
3
12557
<filename>setup.py from distutils.core import setup setup( name = 'colormate', packages = ['colormate'], version = '0.2214', license='MIT', description = 'A package to theme terminal scripts with custom colors and text formatting', author = 'Rodrigo', author_email = '<EMAIL>', url = 'https://github.com/...
1.335938
1
tests/test_compound_where.py
WinVector/data_algebra
37
12558
import data_algebra import data_algebra.test_util from data_algebra.data_ops import * # https://github.com/WinVector/data_algebra import data_algebra.util import data_algebra.SQLite def test_compount_where_and(): d = data_algebra.default_data_model.pd.DataFrame( { "a": ["a", "b", None, None]...
2.515625
3
students/admin.py
eustone/sms
0
12559
<gh_stars>0 from django.contrib import admin from .models import Student # Register your models here. class StudentAdmin(admin.ModelAdmin): list_display = ('first_name','middle_name', 'last_name','identification_number') search_fields = ('first_name','middle_name', 'las...
1.984375
2
lshmm/viterbi/vit_diploid_variants_samples.py
jeromekelleher/lshmm
0
12560
<filename>lshmm/viterbi/vit_diploid_variants_samples.py """Collection of functions to run Viterbi algorithms on dipoid genotype data, where the data is structured as variants x samples.""" import numba as nb import numpy as np # https://github.com/numba/numba/issues/1269 @nb.njit def np_apply_along_axis(func1d, axis,...
2.625
3
src/test/test_pg_function.py
gyana/alembic_utils
0
12561
<filename>src/test/test_pg_function.py from alembic_utils.pg_function import PGFunction from alembic_utils.replaceable_entity import register_entities from alembic_utils.testbase import TEST_VERSIONS_ROOT, run_alembic_command TO_UPPER = PGFunction( schema="public", signature="toUpper(some_text text default 'my...
2.109375
2
proof_of_work/multiagent/turn_based/v6/environmentv6.py
michaelneuder/parkes_lab_fa19
0
12562
<filename>proof_of_work/multiagent/turn_based/v6/environmentv6.py import numpy as np np.random.seed(0) class Environment(object): def __init__(self, alpha, T, mining_cost=0.5): self.alpha = alpha self.T = T self.current_state = None self.mining_cost = mining_cost def reset(self...
2.640625
3
passgen-py/setup.py
hassanselim0/PassGen
0
12563
from setuptools import setup, find_packages setup( name='passgen-py', packages=find_packages(), version='1.1', description='Generate Passwords Deterministically based on a Master Password.', classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: MIT License', ...
1.296875
1
python-peculiarities/source/MultiplicationComplication.py
noamt/presentations
0
12564
<gh_stars>0 # https://codegolf.stackexchange.com/a/11480 multiplication = [] for i in range(10): multiplication.append(i * (i + 1)) for x in multiplication: print(x)
3.765625
4
bin/mkSampleInfo.py
icbi-lab/nextNEOpi
24
12565
<reponame>icbi-lab/nextNEOpi #!/usr/bin/env python """ Requirements: * Python >= 3.7 * Pysam Copyright (c) 2021 <NAME> <<EMAIL>> MIT License <http://opensource.org/licenses/MIT> """ RELEASE = False __version_info__ = ( "0", "1", ) __version__ = ".".join(__version_info__) __version__ += "-dev" if no...
2.0625
2
garrick.py
SebNickel/garrick
0
12566
#!/usr/bin/env python import sys import colorama from pick_db_file import pick_db_file import db_connection import card_repository from review_cards import review_cards from new_card import new_card from new_cards import new_cards import review from user_colors import print_info, print_instruction, print_error from usa...
2.4375
2
perceiver/train/dataset.py
kawa-work/deepmind-research
10,110
12567
<reponame>kawa-work/deepmind-research # Copyright 2021 DeepMind Technologies Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Un...
2.203125
2
pyapprox/manipulate_polynomials.py
samtx/pyapprox
0
12568
import numpy as np from scipy.special import factorial from pyapprox.indexing import hash_array from pyapprox.indexing import compute_hyperbolic_level_indices def multiply_multivariate_polynomials(indices1,coeffs1,indices2,coeffs2): """ TODO: instead of using dictionary to colect terms consider using uniqu...
2.6875
3
core/data/load_data.py
Originofamonia/mcan-vqa
0
12569
<filename>core/data/load_data.py # -------------------------------------------------------- # mcan-vqa (Deep Modular Co-Attention Networks) # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> https://github.com/cuiyuhao1996 # -------------------------------------------------------- import h5p...
2.078125
2
src/scrapers/models/__init__.py
jskroodsma/helpradar
0
12570
<reponame>jskroodsma/helpradar<gh_stars>0 from .database import Db from .initiatives import InitiativeBase, Platform, ImportBatch, InitiativeImport, BatchImportState, InitiativeGroup
1.046875
1
spyder/widgets/ipythonconsole/debugging.py
Bhanditz/spyder
1
12571
<filename>spyder/widgets/ipythonconsole/debugging.py # -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Widget that handles communications between a console in debugging mode and Spyder """ import ast from qtpy....
2.578125
3
python/testData/completion/relativeImport/pkg/main.after.py
jnthn/intellij-community
2
12572
from .string import <caret>
1.054688
1
code/scripts/train_fxns_nonimage.py
estherrolf/representation-matters
1
12573
<gh_stars>1-10 import numpy as np import sklearn.metrics from dataset_chunking_fxns import subsample_df_by_groups import sklearn import sklearn.linear_model from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardSca...
2.578125
3
MITx-6.00.1x-EDX-Introduction-to-Computer-Science/Week-7/PSET-7/phraseTriggers.py
lilsweetcaligula/MIT6.00.1x
0
12574
""" PSET-7 Part 2: Triggers (PhraseTriggers) At this point, you have no way of writing a trigger that matches on "New York City" -- the only triggers you know how to write would be a trigger that would fire on "New" AND "York" AND "City" -- which also fires on the phrase "New students at York University love the c...
3.734375
4
vault/tests/unit/test_views.py
Natan7/vault
1
12575
# -*- coding: utf-8 -*- from unittest import TestCase from mock import Mock, patch from vault.tests.fakes import fake_request from vault.views import SetProjectView from django.utils.translation import ugettext as _ class SetProjectTest(TestCase): def setUp(self): self.view = SetProjectView.as_view() ...
2.34375
2
qa/tasks/cephfs/test_dump_tree.py
rpratap-bot/ceph
4
12576
<gh_stars>1-10 from tasks.cephfs.cephfs_test_case import CephFSTestCase import random import os class TestDumpTree(CephFSTestCase): def get_paths_to_ino(self): inos = {} p = self.mount_a.run_shell(["find", "./"]) paths = p.stdout.getvalue().strip().split() for path in paths: ...
2
2
catkin_ws/src/devel_scripts/stepper.py
AROMAeth/robo_code
0
12577
<gh_stars>0 import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) control_pins = [7,11,13,15] for pin in control_pins: GPIO.setup(pin, GPIO.OUT) GPIO.output(pin, 0) halfstep_seq = [ [1,0,0,0], [1,1,0,0], [0,1,0,0], [0,1,1,0], [0,0,1,0], [0,0,1,1], [0,0,0,1], [1,0,0,1] ] # speed from 0 t...
2.984375
3
Experimental/OpenCVExp.py
awesomesauce12/6DBytes-CV
1
12578
import numpy as np import cv2 import os import math os.system("fswebcam -r 507x456 --no-banner image11.jpg") def showImage(capImg): cv2.imshow('img', capImg) cv2.waitKey(0) cv2.destroyAllWindows() img = cv2.imread('image11.jpg',-1) height, width, channel = img.shape topy= height topx = width hsv = cv2.cv...
2.6875
3
poem/Poem/urls_public.py
kzailac/poem
0
12579
<reponame>kzailac/poem from django.conf.urls import include from django.http import HttpResponseRedirect from django.urls import re_path from Poem.poem_super_admin.admin import mysuperadmin urlpatterns = [ re_path(r'^$', lambda x: HttpResponseRedirect('/poem/superadmin/')), re_path(r'^superadmin/', mysuperadm...
1.617188
2
optimism/ReadMesh.py
btalamini/optimism
0
12580
import json from optimism.JaxConfig import * from optimism import Mesh def read_json_mesh(meshFileName): with open(meshFileName, 'r', encoding='utf-8') as jsonFile: meshData = json.load(jsonFile) coordinates = np.array(meshData['coordinates']) connectivity = np.array(meshData['connectivi...
2.703125
3
networkx/algorithms/approximation/ramsey.py
rakschahsa/networkx
445
12581
<gh_stars>100-1000 # -*- coding: utf-8 -*- """ Ramsey numbers. """ # Copyright (C) 2011 by # <NAME> <<EMAIL>> # All rights reserved. # BSD license. import networkx as nx from ...utils import arbitrary_element __all__ = ["ramsey_R2"] __author__ = """<NAME> (<EMAIL>)""" def ramsey_R2(G): r"""Approximately ...
3.34375
3
pysyte/oss/linux.py
git-wwts/pysyte
1
12582
"""Linux-specific code""" from pysyte.types import paths def xdg_home(): """path to $XDG_CONFIG_HOME >>> assert xdg_home() == paths.path('~/.config').expand() """ return paths.environ_path("XDG_CONFIG_HOME", "~/.config") def xdg_home_config(filename): """path to that file in $XDG_CONFIG_HOME ...
2.640625
3
osu/osu_overlay.py
HQupgradeHQ/Daylight
2
12583
<filename>osu/osu_overlay.py<gh_stars>1-10 import mpv import keyboard import time p = mpv.MPV() p.play("song_name.mp4") def play_pause(): p.pause = not p.pause keyboard.add_hotkey("e", play_pause) def full(): p.fullscreen = not p.fullscreen keyboard.add_hotkey("2", full) def g...
2.53125
3
test/unit/common/test_db.py
dreamhost/swift
0
12584
<gh_stars>0 # Copyright (c) 2010-2011 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
2.078125
2
robocorp-code/tests/robocorp_code_tests/fixtures.py
mardukbp/robotframework-lsp
92
12585
<gh_stars>10-100 import os import pytest from robocorp_ls_core.protocols import IConfigProvider from robocorp_ls_core.robotframework_log import get_logger from robocorp_ls_core.unittest_tools.cases_fixture import CasesFixture from robocorp_code.protocols import IRcc, ActionResult import sys from typing import Any fro...
1.976563
2
tensorflow_model_optimization/python/core/quantization/keras/quantize_emulatable_layer.py
akarmi/model-optimization
1
12586
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
2.609375
3
GEN_cell_culture/phase_plotting.py
dezeraecox/GEN_cell_culture
0
12587
<reponame>dezeraecox/GEN_cell_culture<gh_stars>0 import os import re import string import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from GEN_Utils import FileHandling from loguru import logger logger.info("Import OK") # Set sample-specific variables input_path = 'examples...
2.3125
2
PlatformerGame/malmopy/explorers.py
MrMaik/platformer-ml-game
10
12588
<gh_stars>1-10 # -------------------------------------------------------------------------------------------------- # Copyright (c) 2018 Microsoft Corporation # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and # associated documentation files (the "Software"), to de...
1.398438
1
Lib/icecreamscrape/__main__.py
kdwatt15/icecreamscrape
0
12589
# Standard imports import sys # Project imports from icecreamscrape.cli import cli from icecreamscrape.webdriver import driver_factory from icecreamscrape import composites as comps from icecreamscrape.composites import create_timestamped_dir def main(args=sys.argv[1:]): """ Main function. :param: args is used for ...
2.40625
2
tests/models/programdb/mission/mission_unit_test.py
weibullguy/ramstk
4
12590
# pylint: skip-file # type: ignore # -*- coding: utf-8 -*- # # tests.controllers.mission.mission_unit_test.py is part of The # RAMSTK Project # # All rights reserved. # Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com """Test class for testing Mission module algorithms ...
2.421875
2
src/streamlink/packages/flashmedia/flv.py
RomanKornev/streamlink
5
12591
#!/usr/bin/env python from .error import FLVError from .compat import is_py2 from .tag import Header, Tag class FLV(object): def __init__(self, fd=None, strict=False): self.fd = fd self.header = Header.deserialize(self.fd) self.strict = strict def __iter__(self): return self ...
2.484375
2
tests/core/test_core_renderer.py
timvink/pheasant
24
12592
from pheasant.renderers.jupyter.jupyter import Jupyter jupyter = Jupyter() jupyter.findall("{{3}}3{{5}}") jupyter.page
1.554688
2
chapter2-5-your-code-in-multiple-servers/packer/webapp.py
andrecp/devops-fundamentals-to-k8s
0
12593
<reponame>andrecp/devops-fundamentals-to-k8s<gh_stars>0 #!/usr/bin/env python3 import json from http.server import HTTPServer, BaseHTTPRequestHandler num_requests = 0 class Handler(BaseHTTPRequestHandler): def _set_headers(self): self.send_response(200) self.send_header("Content-type", "applicatio...
2.984375
3
run.py
ellotecnologia/galadriel
0
12594
from app.app import create_app from config import BaseConfig app = create_app(BaseConfig)
1.367188
1
retarget/make_data.py
EggPool/rx-experiments
1
12595
<gh_stars>1-10 """ Create data for simulations (c) 2019 - EggdraSyl """ import json # from mockup import Blockchain, Block from minersimulator import MinerSimulator from math import sin, pi SPECIAL_MIN_TIME = 5 * 60 def init_stable( start, end, block_time=60, target="0000000000000028acfa28a803d200...
2.84375
3
software/pynguin/tests/testcase/statements/test_primitivestatements.py
se2p/artifact-pynguin-ssbse2020
3
12596
# This file is part of Pynguin. # # Pynguin is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Pynguin is distributed in the ho...
2.328125
2
src/data/download/datasets/download_tencent_test.py
lcn-kul/conferencing-speech-2022
1
12597
from pathlib import Path from src import constants from src.data.download.utils.download_dataset_zip import download_dataset_zip def download_tencent_test( tmp_dir: Path = None, tqdm_name: str = None, tqdm_idx: int = None, ): """Download the test set of the Tencent Corpus and extract it to the ap...
2.453125
2
malaya_speech/train/model/fastspeechsplit/model.py
ishine/malaya-speech
111
12598
import tensorflow as tf from ..fastspeech.model import ( TFFastSpeechEncoder, TFTacotronPostnet, TFFastSpeechLayer, ) from ..speechsplit.model import InterpLnr import numpy as np import copy class Encoder_6(tf.keras.layers.Layer): def __init__(self, config, hparams, **kwargs): super(Encoder_6,...
2.296875
2
test/test_memory_leaks.py
elventear/psutil
4
12599
#!/usr/bin/env python # # $Id$ # """ Note: this is targeted for python 2.x. To run it under python 3.x you need to use 2to3 tool first: $ 2to3 -w test/test_memory_leaks.py """ import os import gc import sys import unittest import psutil from test_psutil import reap_children, skipUnless, skipIf, \ ...
2.53125
3