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
hplip-3.20.3/installer/dcheck.py
Deril-Pana/wikiBlackcoinNL
0
12765051
<reponame>Deril-Pana/wikiBlackcoinNL<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- # # (c) Copyright 2003-2015 HP Development Company, L.P. # # 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 Free Software Found...
1.773438
2
solve_v2.py
EliotNapa/urban_hacks
0
12765052
# -*- coding: utf-8 -*- """ """ import copy import time import itertools class CalcRecord(): """ 逆ポーランド用の要素格納クラス """ def __init__(self, a,b,c,d,op1,op2,op3): self.a = a self.b = b self.c = c self.d = d self.op1 = op1 self.op2 = op2 self.op3 = op3 ...
3.703125
4
dataframe_creator.py
Funny-Panda/StructurePrediction18
8
12765053
<filename>dataframe_creator.py __author__ = "<NAME>" __copyright__ = "Copyright 2018-2020 <NAME>" __license__ = "BSD 3-clause" __version__ = "0.2.0" __email__ = "<EMAIL>" """ Code to create a pandas dataframe from a specific corpus """ import os import pandas import json import random import sys import...
3.140625
3
benchmarks/src/garage_benchmarks/experiments/q_functions/__init__.py
blacksph3re/garage
1,500
12765054
<reponame>blacksph3re/garage """Benchmarking experiments for Q-functions.""" from garage_benchmarks.experiments.q_functions.continuous_mlp_q_function import ( # isort:skip # noqa: E501 continuous_mlp_q_function) __all__ = ['continuous_mlp_q_function']
1.015625
1
compile.py
rolandoam/ChesterGL
1
12765055
# compile.py # - Version: 1.0 # - Replacement for the Makefile. This is cross-platform. # - Requires Python 2.7+ import sys, argparse, subprocess, urllib2 externs = ['jquery-1.7.js', 'webkit_console.js', 'google_analytics_api.js', 'json.js'] src = ['chesterGL/core.js', 'chesterGL/block.js', 'chesterGL/blockFrames.js',...
2.015625
2
nodes/rain.py
JavierRefuerzo/WeatherFlow
4
12765056
#!/usr/bin/env python3 """ Polyglot v2 node server for WeatherFlow Weather Station data. Copyright (c) 2018,2019 <NAME> """ import polyinterface import sys import time import datetime import urllib3 import json import socket import math import threading LOGGER = polyinterface.LOGGER class PrecipitationNode(polyinterf...
2.640625
3
lanxinplus_openapi/api/addrbk_tags_api.py
lanxinplus/lanxinplus-python-sdk
0
12765057
<gh_stars>0 """ LanXin+ OpenAPI LanXin+ OpenAPI Platform # noqa: E501 Generated by: https://openapi.lanxin.cn """ import re # noqa: F401 import sys # noqa: F401 from lanxinplus_openapi.api_client import ApiClient, Endpoint as _Endpoint from lanxinplus_openapi.model_utils import ( # noqa: F401 c...
1.40625
1
aura/aura_breaker.py
FrankWhoee/Aura
1
12765058
import numpy as np from aura import aura_loader import os import time import random def break_aura(path, pieces): """ Breaks an aura file into smaller chunks. Saves chunks to local folders. :param path: A string type of the path to the aura file that is being chunked. :param pieces: An integer type ...
3.1875
3
tests/test_xlibs.py
diatoid/xlambda
39
12765059
<gh_stars>10-100 '''Test xlibs''' from typing import Dict import unittest from unittest.mock import patch from xlibs import constants, mutant, utils from xlibs.response import build class TestResponse(unittest.TestCase): '''Test the response routine''' def test_build_simple(self): '''Test the build ...
2.75
3
prep_data/split.py
samiraabnar/DistillingInductiveBias
10
12765060
<filename>prep_data/split.py<gh_stars>1-10 import sys import os import errno import random from util.text_util import deps_from_tsv, deps_to_tsv def make_splits(fname, expr_dir, prop_train=0.1, prop_valid=0.01): # for reproducibility random.seed(42) print('| read in the data') data = deps_from_tsv(fn...
2.203125
2
export.py
mickare/Robust-Reconstruction-of-Watertight-3D-Models
6
12765061
<reponame>mickare/Robust-Reconstruction-of-Watertight-3D-Models """ Export a html page with each step visualized. """ import os from typing import Optional, Sequence import numba import numpy as np import pytorch3d.structures import torch from example import Example, example_config, example_load from reconstruction ...
2.4375
2
uscensus/tests/errors.py
nkrishnaswami/census
4
12765062
from ..util.errors import CensusError, DBError def CensusError_test(): e = CensusError("test") assert isinstance(e, Exception) def DBError_test(): e = DBError("test") assert isinstance(e, CensusError) assert isinstance(e, Exception)
2.828125
3
commands/general.py
murilo-toddy/telegram-ss
1
12765063
<gh_stars>1-10 from telegram import Update, ParseMode, ReplyKeyboardRemove, ReplyKeyboardMarkup from telegram.ext import CallbackContext, CommandHandler import bot from config import COMMANDS_SHEET_ID, commands # Registers execution of certain command def log_command(cmd: str) -> None: print(f"\n [!!] Command {...
2.578125
3
arcane/extras/benchs/bench_microhydro.py
cedricga91/framework
16
12765064
#!/usr/bin/env python3 # Note: il faut au moins python 3.5 (pour subprocess.run()) import argparse import subprocess from string import Template from argparse import RawDescriptionHelpFormatter xstr = """<?xml version="1.0"?> <case codename="ArcaneTest" xml:lang="en" codeversion="1.0"> <arcane> <title>Tube a ch...
2.234375
2
metareader/__main__.py
valossalabs/metadata-reader
2
12765065
<filename>metareader/__main__.py #!/usr/bin/env python # -*- coding: utf-8 -*- # PYTHON_ARGCOMPLETE_OK """Command-line user interface """ from __future__ import print_function, unicode_literals from __future__ import absolute_import from __future__ import division import sys from site import USER_BASE import os import...
3
3
werkit/compute/__init__.py
metabolize/werk
2
12765066
""" Werkit's compute wrapper provides a structured, framework-agnostic execution environment for running any Python code and validating its result using [1schema][] (or plain JSON Schema). It automatically catches and serializes errors, too. By plugging in a werkit.compute.Destination object, you can upon completion s...
1.820313
2
python_modules/libraries/dagster-bash/dagster_bash/solids.py
flowersw/dagster
3
12765067
<gh_stars>1-10 import os from dagster import ( Enum, EnumValue, Failure, Field, InputDefinition, Noneable, Nothing, OutputDefinition, Permissive, check, solid, ) from .utils import execute, execute_script_file def bash_command_solid(bash_command, name='bash_solid', input_...
2.6875
3
tests/test_benchmark.py
neuyhwu/MIPLearn
64
12765068
# MIPLearn: Extensible Framework for Learning-Enhanced Mixed-Integer Optimization # Copyright (C) 2020-2021, UChicago Argonne, LLC. All rights reserved. # Released under the modified BSD license. See COPYING.md for more details. import os.path from scipy.stats import randint from miplearn.benchmark import Benchma...
2.34375
2
stress_tests/python/ptrace_qutip.py
Harmohit-Singh/qpp
2
12765069
<reponame>Harmohit-Singh/qpp # QuTiP partial trace stress tests import os import qutip import sys import timeit if len(sys.argv) != 3: sys.exit("Please specify the number of cores and qubits!") num_cores = int(sys.argv[1]) # number of cores n = int(sys.argv[2]) # number of qubits N = 2 ** n os.environ['OPENBL...
2.359375
2
Recipes/g2g_blastp.py
allista/BioUtils
1
12765070
<filename>Recipes/g2g_blastp.py #!/usr/bin/python # coding=utf-8 ''' Created on Dec 19, 2015 @author: <NAME> <<EMAIL>> ''' import os import signal from time import sleep from BioUtils.NCBI import BlastCLI from reportlab.lib import colors from BioUtils.Tools.tmpStorage import roDict, clean_tmp_files, shelf_result ...
1.671875
2
v2/espacioVacio.py
Davidgh96/LP_Coloca4
0
12765071
import tkinter from tkinter import * class espacioVacio(Canvas): def __init__(self, master=None): Canvas.__init__(self) self.configure(width=150, height=10)
2.59375
3
python/testData/refactoring/extractmethod/OutNotEmptyStatements.after.py
jnthn/intellij-community
2
12765072
def f(): a = 10 result = 0 result = sum_squares(a, result) print("Sum of squares: " + result) def sum_squares(a_new, result_new): while a_new < 10: result_new += a_new * a_new a_new += 1 return result_new
3.921875
4
ansible/venv/lib/python2.7/site-packages/ansible/modules/cloud/vultr/vultr_ssh_key_info.py
gvashchenkolineate/gvashchenkolineate_infra_trytravis
17
12765073
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2018, <NAME> <<EMAIL>> # (c) 2019, <NAME> <<EMAIL>> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = {'metadata_vers...
1.648438
2
agent/trainer.py
shayanthrn/AGAIN-VC
3
12765074
import os import torch from tqdm import tqdm from .base import BaseAgent from util.mylogger import get_writer class Trainer(BaseAgent): def __init__(self, config, args): super().__init__(config, args) if args.load != '': self.ckpt_dir_flag, self.train_set, self.dev_set, self.train_loade...
2.109375
2
roles/slurm/files/update_config.py
brandenm-nag/ansible
0
12765075
#! /opt/cloud_sdk/bin/python import re from typing import Dict, Optional import yaml import citc.utils def load_yaml(filename) -> dict: with open(filename, "r") as f: return yaml.safe_load(f) def get_limits() -> Dict[str, Dict[str, str]]: """ Until OCI has an API to fetch service limits, we ha...
2.328125
2
labjack/ljm/ljm.py
LihongHerman/labjack-ljm-python
0
12765076
<gh_stars>0 """ Cross-platform wrapper for the LJM library. """ import ctypes import sys from labjack.ljm import constants from labjack.ljm import errorcodes class _StreamCallbackData: """Class containing the stream callback information.""" def __init__(self, handle, callback): self.ca...
2.046875
2
demo/store/migrations/0001_initial.py
ikcam/django-boilerplate
5
12765077
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-06-17 21:02 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Creat...
1.734375
2
pytools/lib/common.py
virtualparadox/bbmap
134
12765078
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Function definitions common to all programs. """ ## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## libraries to use #import re import os import time import sys #import getpass import ...
2.515625
3
aioflureedb/__init__.py
pibara/aioflureedb
4
12765079
#!/usr/bin/python3 # pylint: disable=too-few-public-methods # pylint: disable=too-many-arguments # pylint: disable=too-many-instance-attributes # pylint: disable=simplifiable-if-statement """Basic asynchonous client library for FlureeDB""" import sys import asyncio import json import time import aiohttp from aioflureed...
2.3125
2
ex008.py
iagoMaik/exPython
0
12765080
m = float(input('Digite um tamanho (em metros): ')) dm = m * 10 cm = m * 100 mm = m * 1000 dam = m / 10 hm = m / 100 km = m / 1000 print('convertendo...') print('[dm] =', dm) print('[cm] =', cm) print('[mm] =', mm) print('[dam] =', dam) print('[hm] =', hm) print('[km] =', km)
3.84375
4
scripts/format_github_data.py
mhagiwara/nanigonet
62
12765081
import json import os import sys from collections import Counter from pathlib import Path TRAIN_DIR = Path('data/train') def count_popular_languages(): language_counts = Counter() for line in sys.stdin: data = json.loads(line) for _, path_after in data['paths']: extension = path_...
2.8125
3
lib/common.py
thk4711/mediamanager
0
12765082
<reponame>thk4711/mediamanager #!/usr/bin/python3 # -*- coding: utf-8 -*- import threading from http.server import BaseHTTPRequestHandler, HTTPServer import json import time import socket import urllib.request import os import re import argparse import alsaaudio import _thread import select import smbus import errno ...
2.25
2
app/submitter/converter.py
ONSdigital/eq-questionnaire-runner
3
12765083
from typing import Mapping from structlog import get_logger from app.questionnaire.questionnaire_schema import DEFAULT_LANGUAGE_CODE from app.submitter.convert_payload_0_0_1 import convert_answers_to_payload_0_0_1 from app.submitter.convert_payload_0_0_3 import convert_answers_to_payload_0_0_3 logger = get_logger() ...
2.453125
2
phylotyper/data/download/blast_stx1a_genes.py
superphy/insilico-subtyping
5
12765084
<gh_stars>1-10 #!/usr/bin/env python """Download Stx1a gene sequences from Genbank Example: $ python blast_stx1a_genes.py . """ import argparse import csv import logging import os import re from Bio import SeqIO from utils import DownloadUtils, SubtypeParser, GeneFilter from blast import Blast __author_...
2.6875
3
Trescope4Python/example/src/example_add_control.py
chenhebing/Trescope
1
12765085
import os from typing import List from trescope import Trescope from trescope.config import ImageConfig from trescope.controller import EnumControl from trescope.toolbox import simpleDisplayOutputs import pandas as pd def clearTrescope(): for i in range(4): Trescope().selectOutput(i).clear() def add_control():...
2.21875
2
starpolymers/analysis/rdf.py
jakublala/starpolymers
6
12765086
<reponame>jakublala/starpolymers import numpy as np import scipy.spatial.distance as D import pandas as pd from math import pi import matplotlib.pyplot as plt def _volume(bins): shell_width = bins[1] - bins[0] return 4 * pi * bins ** 2 * shell_width def _get_distance_vector(first, second, rmin, rmax): arr...
2.671875
3
tests/keras/layers/test_embeddings.py
nishank974/Keras
2
12765087
import pytest import numpy as np from numpy.testing import assert_allclose from keras.models import Sequential from keras.layers.core import Dense, Activation, Flatten from keras.layers.embeddings import Embedding from keras.constraints import unitnorm from keras import backend as K X1 = np.array([[1], [2]], dtype='i...
2.328125
2
arametrics-test-app/config/config.py
AravinthPanch/araMetrics
0
12765088
TEST_API_ENDPOINT='https://aravinth.info'
1.015625
1
tests/_OLD_test_sensor_SenseHat.py
mlanser/sciLab-sensorMod
0
12765089
import time import pytest from libs.sensorMod.src.sensor_SenseHat import Sensor # ========================================================= # G L O B A L S & P Y T E S T F I X T U R E S # ========================================================= @pytest.fixture() def valid_attribs(): return { '...
2.203125
2
python/problems/jewels_and_stones.py
vivaxy/algorithms
1
12765090
""" https://leetcode.com/problems/jewels-and-stones/ https://leetcode.com/submissions/detail/138688434/ """ class Solution: def numJewelsInStones(self, J, S): """ :type J: str :type S: str :rtype: int """ result = 0 for stone in J: result += S.c...
3.734375
4
src/deepsparse/utils/data.py
SkalskiP/deepsparse
460
12765091
# Copyright (c) 2021 - present / Neuralmagic, Inc. 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 b...
2.484375
2
scripts/busqueda_codon_secuencia.py
rod13-afk/python_class
0
12765092
<gh_stars>0 ''' NAME Busqueda del Codón inicial y secuencia transcrita VERSION 1.0 AUTHOR <NAME> DESCRIPTION Find the start codon and the transcribed sequence CATEGORY Genomic sequence INPUT Read a DNA sequence entered by the user OUTPUT Returns as output the start...
4.09375
4
py/gps_building_blocks/airflow/utils/errors.py
miguelfc/gps_building_blocks
0
12765093
# python3 # coding=utf-8 # Copyright 2020 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 ...
2.59375
3
optaradio/ui/input/keyboard.py
p4cx/optaradio
2
12765094
import sys import pygame as pg from ui.input import control def check_keyboard_events(window, state): def close(): pg.quit() sys.exit() events = pg.event.get() for event in events: if event.type == pg.QUIT: close() elif event.type == pg.KEYDOWN and event.ke...
2.84375
3
elit/optimizers/adamw/__init__.py
emorynlp/levi-graph-amr-parser
9
12765095
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2019-11-11 18:44 import tensorflow as tf from elit.optimizers.adamw.optimization import WarmUp, AdamWeightDecay # from elit.optimization.adamw.optimizers_v2 import AdamW # from elit.optimization.adamw.utils import get_weight_decays # def create_optimizer(model, init_l...
2.3125
2
angalabiri/shop/forms/cartform.py
dark-codr/ebiangala
1
12765096
from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import ( Column, HTML, Field, Fieldset, Layout, Row, Submit, BaseInput, ) from crispy_forms.bootstrap import InlineField, UneditableField from crispy_forms import layout PRODUCT_QUANTITY_CHOICES...
2.390625
2
yakutils/_csv.py
kdebowski/yakutils
0
12765097
"""This module contains boilerplate csv helpers.""" import csv def read_csv(filename): """Read a CSV file. **Example**: >>> read_csv('/path/to/data.csv') [{ 'name': 'foo' }] :param filename: Path to CSV file. :return: A Python representation of the CSV document. """ ...
4
4
alveus/variable_mgr.py
FrederikLehn/alveus
0
12765098
from datetime import date import numpy as np from matplotlib.lines import Line2D from _ids import * import _icons as ico from utilities import pydate2wxdate, wxdate2pydate, GetAttributes from properties import SummaryProperty class VariableManager: def __init__(self, unit_system): # simulat...
2.28125
2
functions.py
gjoe344/python-learning
0
12765099
#Input, arguments def add(x,y): z = x + y b = 'I am here' a = 'hello' return z,b,a x = 20 y = 5 # Calling function print(add(x,y)) z = add(x,y) #same thing print(z) print(add(10,5)) #same thing
3.78125
4
.sim-test.py
niw/linux-on-litex-vexriscv
329
12765100
#!/usr/bin/env python3 # # This file is part of Linux-on-LiteX-VexRiscv # # Copyright (c) 2019-2021, Linux-on-LiteX-VexRiscv Developers # SPDX-License-Identifier: BSD-2-Clause import os import sys import pexpect import time from argparse import ArgumentParser parser = ArgumentParser() parser.add_argument("--sdram-m...
2.203125
2
main.py
filipposerafini/PythonVsAndroid
1
12765101
import pygame_sdl2 pygame_sdl2.import_as_pygame() import random import pygame from pygame.locals import * import android class AppleTypes: NORMAL, GOLDEN, LIFE, SPECIAL = range(4) class Apple: def __init__(self, snakes): retry = True while retry: retry = False self.x...
2.9375
3
main.py
slimtomatillo/major_or_minor_song_classification
8
12765102
# Functions from extract import extract from model import model import os # Logging import logging logging.basicConfig(level=logging.INFO) # Set directory dir = '/Users/alexandrasmith/ds/metis/proj3_mcnulty/PROJ_FILES/major_or_minor_song_classification' # filepath_to_music --> Edit as needed filepath = 'sample_musi...
3.046875
3
wagtail/core/signals.py
smartfactory-gmbh/wagtail
8,851
12765103
<reponame>smartfactory-gmbh/wagtail from django.dispatch import Signal # Page signals # provides args: instance, revision page_published = Signal() # provides args: instance page_unpublished = Signal() # provides args: instance, parent_page_before, parent_page_after, url_path_before, url_path_after pre_page_move =...
1.679688
2
setup.py
ojarva/flask-restful-url-generator
3
12765104
<filename>setup.py """ Packaging for flask-restful-url-generator """ from os import path from codecs import open as codecs_open from setuptools import setup CURRENT_PATH = path.abspath(path.dirname(__file__)) with codecs_open(path.join(CURRENT_PATH, 'README.rst'), encoding='utf-8') as f: LONG_DESCRIPTION = f.rea...
1.476563
1
sugar/data/voxceleb1.py
mechanicalsea/sugar
4
12765105
""" Description: Dataset from VoxCeleb1 Author: <NAME> Date: 2020.11.26 VoxCeleb1: - From iden_split.txt to the training and validation set. - From iden_split.txt to evaulate the identification task. - From veri_test2.txt, list_test_all2.txt, and list_test_hard2.txt to evaluate the corresponding verification tas...
1.773438
2
readthedocs/donate/forms.py
ardalis/readthedocs.org
1
12765106
import logging from django import forms from django.conf import settings from django.utils.translation import ugettext_lazy as _ import stripe from .models import Supporter log = logging.getLogger(__name__) class SupporterForm(forms.ModelForm): class Meta: model = Supporter fields = ( ...
2.171875
2
src/who_is_on_my_wifi.py
tucnakomet1/Python-Who-Is-On-My-WiFi
19
12765107
from scapy.all import * from device import * from who import * import who_is_on_my_wifi import subprocess import argparse import textwrap import platform import inspect import socket import getmac import sys import os if platform.system() == "Windows": import wmi def contact(): print(""" >>>> Contact <<<< My Gm...
2.71875
3
wos/client.py
ConnectedSystems/wos
0
12765108
<filename>wos/client.py #!/usr/bin/env python __all__ = ['WosClient'] import suds as _suds import functools as _functools from base64 import b64encode as _b64encode from collections import OrderedDict as _OrderedDict from limit import limit as _limit class WosClient(): """Query the Web of Science. You mu...
2.625
3
Cursos-Extras/Python/ex035.py
talessantos49/Primeiros_Passos
0
12765109
<gh_stars>0 n1 = float(input('Insira o primeiro valor desejado: ')) n2 = float(input('Insira o segundo valor desejado: ')) n3 = float(input('Insira o terceiro valor desejado: ')) if n1 > n2 != n3 and n1 > n3: n4 = (n2 + n3) if n4 > n1: print('É possivel formar um triangulo com esses valores.') else:...
3.90625
4
code/4.1_make_index_multi.py
ceumicrodata/respect-trade-similarity
1
12765110
<reponame>ceumicrodata/respect-trade-similarity import glob import pandas as pd from multiprocessing import Pool file_list = glob.glob('../temp/index/data/index_??P_20??.csv') #print(len(file_list)) def colnames(df): try: cols = ["DECLARANT_ISO","PARTNER_ISO","TCI"] data = pd.read_csv(df) data.columns=cols d...
2.640625
3
functions/user.py
Katolus/functions
4
12765111
"""Holds functions that ask a user for input""" import warnings from typing import List import typer from functions import logs from functions import styles from functions.config.models import FunctionConfig from functions.constants import ConfigName def ask(question: str, default: str = None, options: List[str] = ...
3.671875
4
formulaic/__init__.py
jzaleski/simpleforms
2
12765112
__version__ = '0.0.1.dev1' from formulaic.attributes import ( Attribute, BooleanAttribute, FloatAttribute, IntegerAttribute, LongAttribute, StringAttribute, TextAttribute, UUIDAttribute, ) from formulaic.formatters import Formatter from formulaic.models import Model from formulaic.pers...
1.515625
2
REGIR/Biochemical_applications/3_RNA_transcription (Fig.4)/3_RNA_sensitivity (Fig. 4D).py
Aurelien-Pelissier/REGIR
0
12765113
<gh_stars>0 import numpy as np import matplotlib.pyplot as plt from SALib.sample import saltelli from SALib.analyze import sobol #https://salib.readthedocs.io/en/latest/ from RNA_model import Gillespie_kinetics N_simulations = 200 sensitivity_res = 64 recompute_sensitivity = False class param_opt: n_iteratio...
2.953125
3
Trojan.Android.GM/gmbot/apps/smsg_r/smsapp/templatetags/mytags.py
010001111/Vx-Suites
2
12765114
<gh_stars>1-10 from django import template from django.conf import settings from django.utils.safestring import mark_safe from django_countries import conf from django.template import Node import pycountry try: from urllib import parse as urlparse except ImportError: import urlparse # Python 2 register = tem...
2.28125
2
common/security-features/subresource/referrer.py
FarooqAR/wpt
1
12765115
def main(request, response): referrer = request.headers.get("referer", "") response_headers = [("Content-Type", "text/javascript")]; return (200, response_headers, "window.referrer = '" + referrer + "'")
2.0625
2
work/apidoc/schema1.py
haizaar/crossbar-examples
97
12765116
<reponame>haizaar/crossbar-examples from jsonschema import validate from pprint import pprint schema = { "type" : "object", "properties" : { "price" : {"type" : "number"}, "name" : {"type" : "string"}, }, } validate({"name" : "Eggs", "price" : 34.99}, schema) #validate({"name" : "Eggs", "...
2.6875
3
tests/test_class.py
Superbalist/django-gcloud-storage
0
12765117
# coding=utf-8 from __future__ import unicode_literals import datetime import ssl from tempfile import TemporaryFile import gcloud.exceptions import pytest from django.core.exceptions import SuspiciousFileOperation from django.utils import six from django.utils.crypto import get_random_string from django_gcloud_stor...
1.976563
2
src/iBeatles/all_steps/event_handler.py
ornlneutronimaging/iBeatles
3
12765118
<gh_stars>1-10 from .. import DataType from ..utilities.status_message_config import StatusMessageStatus, show_status_message from qtpy.QtWidgets import QMessageBox import logging class EventHandler: def __init__(self, parent=None, data_type='sample'): self.parent = parent self.data_type = data_t...
2.125
2
sis/admin.py
rectory-school/rectory-apps-updated
0
12765119
<gh_stars>0 """SIS Admin""" from datetime import date, timedelta from django.contrib import admin from django.db.models import Count, Max from django.utils.translation import gettext_lazy as _ from solo.admin import SingletonModelAdmin from . import models class ViewOnlyAdminMixin: """Admin view for mixin tha...
2.109375
2
counterpartylib/lib/messages/trigger.py
monaparty/counterparty-lib
9
12765120
<filename>counterpartylib/lib/messages/trigger.py #! /usr/bin/python3 """ target_hash is the hash of a trigger. """ import binascii import struct import json import logging logger = logging.getLogger(__name__) from counterpartylib.lib import (config, exceptions, util, message_type) from . import (order, bet, rps) fr...
2.21875
2
fincrypt.py
ThePlasmaRailgun/CryptoChallenge
1
12765121
<reponame>ThePlasmaRailgun/CryptoChallenge<filename>fincrypt.py #!/usr/bin/env python3 import sha import sys import os import argparse import base64 import zlib import randomart import re import ecc import reedsolomon import oaep from asn1spec import FinCryptPublicKey, FinCryptPrivateKey, FinCryptMessage from pyasn1.c...
2.75
3
src/predictor.py
koriavinash1/Fetal-Brain-Segmentation
10
12765122
<filename>src/predictor.py from __future__ import division import numpy as np import os, shutil, sys import SimpleITK as sitk import glob from datetime import datetime import time from estimator import * from config import * from networks import * from test_utils import * from train_utils import * if __name__...
2.171875
2
pyinaturalist/models/observation_field.py
niconoe/pyinaturalist
47
12765123
from datetime import date, datetime from typing import List, Union from pyinaturalist.constants import TableRow from pyinaturalist.converters import safe_split, try_int_or_float from pyinaturalist.models import ( BaseModel, LazyProperty, Taxon, User, datetime_now_field, define_model, field,...
2.375
2
model_a/utils.py
uSasha/pydata_demo
6
12765124
import redis class ClueLogger: def __init__(self, block, model): self.block = block self.r = redis.StrictRedis('redis') def out(self, model, value): self.r.xadd(self.block, {'model': model, 'value': value})
2.515625
3
2d.py
tsmpatagonia/Real-Time-Satellite-Tracking
0
12765125
# Homework for UB DMS 423 - Fall 14 # by <NAME> # # Real-time Satellite Visualization # Input Data type: TLS(Two-line element set) # Can be found at http://www.celestrak.com/NORAD/elements/ # # How to control: # Click a satellite to display its orbit. # Press H to show/hide all orbits on-screen. # Press UP/DOWN to cha...
3.0625
3
meridian/acupoints/quze12.py
sinotradition/meridian
5
12765126
<reponame>sinotradition/meridian<filename>meridian/acupoints/quze12.py #!/usr/bin/python #coding=utf-8 ''' @author: sheng @license: ''' SPELL=u'qūzé' CN=u'曲泽' NAME=u'quze12' CHANNEL='pericardium' CHANNEL_FULLNAME='PericardiumChannelofHand-Jueyin' SEQ='PC3' if __name__ == '__main__': pass
1.25
1
src/detection_efffdet/utils.py
yellowdolphin/SIIM-COVID19-Detection
153
12765127
<filename>src/detection_efffdet/utils.py import random import os import numpy as np import torch import pandas as pd from mean_average_precision import MetricBuilder import pickle classes = [ 'Negative for Pneumonia', 'Typical Appearance', 'Indeterminate Appearance', 'Atypical Appearance' ] def seed_...
2.203125
2
topicmodelling/hdp/ConvertTopicDisplayFormat.py
awbennett/HCA-WSI
6
12765128
""" Quick and simple python program that converts the ugly and dumb vertical display of topics to horizontal display (1 topic per line). Usage: ConvertTopicDisplayFormat.py Stdin: topics.txt Stdout: mod_topics.txt Other Input: N/A Other Output: N/A Author: <NAME> Date: ...
3.671875
4
feat/tests/test_utils.py
TiankangXie/feat
0
12765129
<filename>feat/tests/test_utils.py #!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for `feat` package.""" import pytest import pandas as pd from pandas import DataFrame, Series import numpy as np from os.path import join, exists from .utils import get_test_data_path from feat.utils import read_facet, read_open...
2.1875
2
src/unicef_restlib/fields.py
unicef/unicef-restlib
1
12765130
from collections import OrderedDict from django.utils.translation import gettext_lazy as _ from model_utils import Choices from rest_framework import serializers from rest_framework.fields import empty, Field, SkipField from rest_framework.utils import model_meta from rest_framework_recursive.fields import RecursiveF...
2.0625
2
constants.py
Ares513/DetectingTrollsApi
4
12765131
MAX_VECTOR_COUNT = 40*300 LEARNING_RATE = 0.001
1.148438
1
cyborg/urls.py
aaronbassett/django-cyborg
4
12765132
# -*- coding: utf-8 -*- from django.conf.urls import url, include from django.views.generic import TemplateView cyborg_patterns = [ url( r'^robots\.txt$', TemplateView.as_view( template_name='cyborg/robots.txt', content_type='text/plain' ), name='robots' ...
1.929688
2
app.py
chazapp/garden
0
12765133
<gh_stars>0 from flask import Flask, Blueprint, current_app from threading import Thread from sensors import Sensors from lights import Lights bp = Blueprint('metrics', __name__) @bp.route('/metrics', methods=['GET']) def metrics(): metrics = [{ 'name': 'hygrometer', 'value': current_ap...
2.40625
2
tankobon/sources/mangakakalot.py
onyxware/manhua
1
12765134
<reponame>onyxware/manhua # coding: utf8 import re from .. import models from . import base # mangakakalot chapter urls always end with '/chapter_(number)'. RE_CHAPTER = re.compile(r"(\d+(\.\d+)?)") RE_TITLE = re.compile(r"^.*: (.*)$") class Parser(base.Parser): domain = r"mangakakalot.com" def __init__(...
2.5
2
mlcomp/contrib/catalyst/optim/cosineanneal.py
sUeharaE4/mlcomp
166
12765135
from torch.optim.lr_scheduler import CosineAnnealingLR class OneCycleCosineAnnealLR(CosineAnnealingLR): def __init__(self, *args, **kwargs): self.start_epoch = None self.last_epoch = None super().__init__(*args, **kwargs) def step(self, epoch=None): if self.last_epoch is not N...
2.25
2
ThePythonSpreader.py
53686b/ThePythonSpreader
0
12765136
#!/usr/bin/env python # -*- coding: utf-8 -*- # Code by: @53686b (Github/Twitter) # Version: 1.0.1 (23/03/2021) """ ThePythonSpreader is a script that creates files capable of multiplying themselves. The first file copies itself to a new file, which results of the addition of a random number to the original file name...
3.125
3
lin.py
iboraham/linear-reg-from-scratch
0
12765137
import numpy as np import pandas as pd from sklearn.linear_model import LinearRegression from sklearn.model_selection import train_test_split from sklearn.metrics import r2_score from shared_utilities import find_linearReg_optimal_test_size from shared_utilities import plot_linear_reg from shared_utilities import check...
2.71875
3
extra_utils/finetune_to_save_states.py
humanlab/HaRT
0
12765138
import pandas as pd import torch import torch.nn as nn from transformers.modeling_outputs import SequenceClassifierOutputWithPast from ..src.model.hart import HaRTPreTrainedModel class ArHulmForSequenceClassification(HaRTPreTrainedModel): # _keys_to_ignore_on_load_missing = [r"h\.\d+\.attn\.masked_bias", r"lm_he...
2.4375
2
src/terra/contracts/apollo/__init__.py
fentas/staketaxcsv
0
12765139
import logging from terra import util_terra from terra.execute_type import ( _execute_type, ) from .zap import ( handle_zap_into_strategy, handle_zap_out_of_strategy, ) def handle(exporter, elem, txinfo, index): execute_msg = util_terra._execute_msg(elem, index) if "send" in execute_msg: m...
2.03125
2
src/pyc/compile.py
ahojukka5/pyc
2
12765140
<gh_stars>1-10 import os import sysconfig import subprocess from typing import Tuple from Cython.Build import cythonize from Cython.Compiler import Options def compile(source_file: str, verbose: bool = False) -> Tuple[int, str]: """Compile Python source file to executable using Cython.""" basename = os.path...
2.578125
3
python/to-lower-hyphen.py
smoogi/magic
0
12765141
""" Developed by: <NAME> (2018) This script rename all files in the specified directory to lowercase and then replace all white space with hyphen (-). """ import os import sys import glob import argparse # Print welcome message print("\nDeveloped by: <NAME> (2018)\n" "This script rename all files in the specifi...
3.59375
4
pe/_definition.py
goodmami/pe
18
12765142
from typing import Dict, Tuple, Callable, Any from pe._constants import Operator from pe._errors import Error from pe._escape import escape DOT = Operator.DOT LIT = Operator.LIT CLS = Operator.CLS RGX = Operator.RGX SYM = Operator.SYM OPT = Operator.OPT STR = Operator.STR PLS = Operator.PLS AND = Operator.AND NOT =...
2.640625
3
direfl/api/sld_profile.py
TUM-E21-ThinFilms/direfl
0
12765143
import numpy as np import cmath from functools import reduce from math import pi, ceil from numpy import sin, cos from scipy.interpolate import interp1d """ References: [Majkrzak2003] <NAME>, <NAME>: Physica B 336 (2003) 27-38 Phase sensitive reflectometry and the unambiguous determination o...
2.953125
3
tests/runtime-trace-tests/cases/assign_stmt.py
jaydeetay/pxt
977
12765144
# regular assignment foo = 7 print(foo) # annotated assignmnet bar: number = 9 print(bar)
2.390625
2
hexrd/ui/line_picker_dialog.py
cjh1/hexrdgui
0
12765145
<filename>hexrd/ui/line_picker_dialog.py import copy from PySide2.QtCore import Qt, QObject, Signal from itertools import cycle import numpy as np import matplotlib.pyplot as plt from matplotlib.widgets import Cursor from hexrd.ui import enter_key_filter from hexrd.ui.constants import ViewType from hexrd.ui.ui_lo...
2.265625
2
figures/kCSD_properties/colorblind_friendly.py
rdarie/kCSD-python
11
12765146
<reponame>rdarie/kCSD-python<filename>figures/kCSD_properties/colorblind_friendly.py<gh_stars>10-100 # Based on # Color Universal Design (CUD) # - How to make figures and presentations that are friendly to Colorblind people # # # <NAME> # Jikei Medial School (Japan) # # <NAME> # University of Tokyo, Institute for Molec...
2.859375
3
server/scripts/mts_render.py
smartscenes/multiscan
6
12765147
import os import mitsuba import numpy as np import argparse import utils mitsuba.set_variant('scalar_spectral') from mitsuba.core import xml, Thread, ScalarTransform4f, Transform4f, Bitmap, Struct from mitsuba.python.xml import WriteXML from enoki.scalar import * import open3d as o3d from plyfile import PlyData, PlyE...
2.078125
2
tests/test_tools.py
frenners/python-amazon-paapi
121
12765148
<filename>tests/test_tools.py from amazon_paapi.exceptions import AsinNotFoundException from amazon_paapi.tools import get_asin import pytest def test_get_asin(): assert get_asin('B01N5IB20Q') == 'B01N5IB20Q' assert get_asin('https://www.amazon.es/gp/product/B07PHPXHQS') == 'B07PHPXHQS' assert get_asin('h...
2.25
2
src/core/database/database.py
Bizarious/mra-discord
0
12765149
import os import json from typing import Union class DataBasic: path = "" def first_startup(self): if not os.path.exists(self.path): os.mkdir(self.path) print(f"created {self.path} directory") class Data(DataBasic): path = "./data" def __init__(self): self....
3.0625
3
simplepybotsdk/configurations.py
vellons/SimplePYBotSDK
11
12765150
VERSION = "0.7.0" LICENSE = "MIT - Copyright (c) 2021 <NAME>" MOTORS_CHECK_PER_SECOND = 20 MOTORS_POINT_TO_POINT_CHECK_PER_SECOND = 10 WEB_SOCKET_SEND_PER_SECOND = 10 SOCKET_SEND_PER_SECOND = 20 SOCKET_INCOMING_LIMIT = 5 SLEEP_AVOID_CPU_WASTE = 0.80
0.902344
1