max_stars_repo_path
stringlengths
3
269
max_stars_repo_name
stringlengths
4
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.05M
score
float64
0.23
5.13
int_score
int64
0
5
Python Programs/binarysea.py
Chibi-Shem/Hacktoberfest2020-Expert
77
33200
print("linear search") si=int(input("\nEnter the size:")) data=list() for i in range(0,si): n=int(input()) data.append(n) cot=0 print("\nEnter the number you want to search:") val=int(input()) for i in range(0,len(data)): if(data[i]==val): break; else: cot=co...
3.6875
4
inferqueue.py
AndreasMerentitis/TfLambdaDemo-tfraw
0
33201
try: import unzip_requirements except ImportError: pass import json import os import tarfile import boto3 import tensorflow as tf import numpy as np import census_data import logging logger = logging.getLogger() logger.setLevel(logging.WARNING) FILE_DIR = '/tmp/' BUCKET = os.environ['BUCKET'] import queue im...
2.0625
2
sailbot_ws/src/sailbot/sailbot/control_system.py
wpisailbot/sailbot21-22
1
33202
from time import time import rclpy from rclpy.node import Node import json from std_msgs.msg import String, Float32, Int8, Int16 import sailbot.autonomous.p2p as p2p from collections import deque class ControlSystem(Node): # Gathers data from some nodes and distributes it to others def __init__(self): s...
2.28125
2
tracedump/pwn_wrapper.py
Mic92/tracedumpd
1
33203
import os # stop pwnlib from doing fancy things os.environ["PWNLIB_NOTERM"] = "1" from pwnlib.elf.corefile import Coredump, Mapping # noqa: E402 from pwnlib.elf.elf import ELF # noqa: E402
1.304688
1
postcodeinfo/apps/postcode_api/admin.py
UKHomeOffice/postcodeinfo
0
33204
<filename>postcodeinfo/apps/postcode_api/admin.py import django from django.contrib.gis import admin from .models import Address # from https://djangosnippets.org/snippets/2593/ from django.contrib.admin.options import IncorrectLookupParameters from django.contrib.admin.views.main import ChangeList from django.core...
2.203125
2
tests/molecular/bonds/bond/with_ids/test_with_ids.py
stevenbennett96/stk
0
33205
<reponame>stevenbennett96/stk<filename>tests/molecular/bonds/bond/with_ids/test_with_ids.py from __future__ import annotations from typing import Callable import stk def test_with_ids( bond: stk.Bond, get_id_map: Callable[[stk.Bond], dict[int, int]], ) -> None: """ Test :meth:`.Bond.with_ids`. ...
2.5625
3
app/services.py
fabl1106/emoji_rank
10
33206
from dataclasses import dataclass from app import crud from app.schemas import UserCreate, SlackEventHook from app.settings import REACTION_LIST, DAY_MAX_REACTION # about reaction REMOVED_REACTION = 'reaction_removed' ADDED_REACTION = 'reaction_added' APP_MENTION_REACTION = 'app_mention' # about command CREATE_USER...
2.515625
3
util/build_tests.py
skruger/AVWX-Engine
0
33207
""" Creates files for end-to-end tests python util/build_tests.py """ # stdlib import json from dataclasses import asdict # module import avwx def make_metar_test(station: str) -> dict: """ Builds METAR test file for station """ m = avwx.Metar(station) m.update() # Clear timestamp due to pa...
2.765625
3
pacote-download/ex(1-100)/ex112/utilidadescev/__init__.py
gssouza2051/python-exercicios
0
33208
from ex111.utilidadescev import moeda,dado
0.996094
1
sdk/pyseele/clazz.py
rinkako/SeeleFlow
3
33209
<gh_stars>1-10 # -*- coding: UTF-8 -*- """ Project Seele @author : Rinka @date : 2019/12/17 """ from pyseele.workitem import Workitem class ResourcingContext: """ Resourcing Context maintains all org.rinka.seele.server.resource service principals that guide RS to handle the workitem. """ def __i...
1.648438
2
scripts/python/turtleRelated/circleint.py
jeremiahmarks/dangerzone
1
33210
import math import fvh2, fvh import supercircle masterCircleSet=set() circlecalled = 0 checkcirclescalled = 0 MINOFFSET=5 class Circle(): def __init__(self,x,y,r,lm=None, keep=True): global circlecalled circlecalled+=1 self.keep = keep self.center=(x,y) self.radius=r self.checkStr...
3.046875
3
test_calculations.py
joshmgrant/pybay-pytest-the-awesome-parts-code
0
33211
<reponame>joshmgrant/pybay-pytest-the-awesome-parts-code from calculations import TemperatureConverter def testfreezing_fahrenheit(): converter = TemperatureConverter() actual = converter.to_celsius(32.0) expected = 0.0 assert abs(expected - actual) < 0.01 def test_freezing_celsius(): converter...
2.421875
2
utils.py
xdr940/cc
0
33212
<gh_stars>0 from __future__ import division import shutil import numpy as np import torch import torch.nn as nn from torch.autograd import Variable from matplotlib import cm from matplotlib.colors import ListedColormap, LinearSegmentedColormap from path import Path from collections import OrderedDict import datetime e...
2.15625
2
oops_fhir/r4/value_set/provenance_activity_type.py
Mikuana/oops_fhir
0
33213
<gh_stars>0 from pathlib import Path from fhir.resources.valueset import ValueSet as _ValueSet from oops_fhir.utils import ValueSet from oops_fhir.r4.code_system.v3_participation_type import v3ParticipationType __all__ = ["ProvenanceActivityType"] _resource = _ValueSet.parse_file(Path(__file__).with_suffix(".jso...
1.601563
2
py/adafruit-circuitpython-bundle-7.x-mpy-20211104/examples/is31fl3731_rgbmatrix5x5_rainbow.py
ParentZap/micro-projects
0
33214
<reponame>ParentZap/micro-projects<gh_stars>0 # SPDX-FileCopyrightText: 2021 <NAME>, <NAME>, <NAME> # SPDX-License-Identifier: MIT """ Example to display a rainbow animation on the 5x5 RGB Matrix Breakout. Usage: Rename this file code.py and pop it on your Raspberry Pico's CIRCUITPY drive. This example is ...
2.953125
3
src/GG_ESB.py
CB1204/LapSimulation
7
33215
from TwoDimLookup_motor import TwoDimLookup_motor from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt from scipy import interpolate import numpy as np ### Input Parameters # C_F = 27000 # Cornering stiffness front / Schräglaufsteifigkeit vorne [N/rad] - Is already for two wheels ! # C_R = ...
2.640625
3
models/env.py
claranet/cloud-deploy
25
33216
env = ['prod', 'preprod', 'dev', 'staging', 'test', 'demo', 'int', 'uat', 'oat']
1.148438
1
magic-wand/accelerometers/adxl345/adxl345_const.py
uraich/EdgeComputing
0
33217
from micropython import const ADXL345_ADDRESS = const(0x53) # I2C address of adxl345 ADXL345_DEVICE_ID = const(0xe5) # ADXL345_DEVID = const(0x00) # Device ID ADXL345_THESH_TAP = const(0x1d) # Tap threshold ADXL345_OFSX = const(0x1e) ...
2.21875
2
genes.py
AgamChopra/simulation-in-a-box
0
33218
import random global_mutation = 0.002 encodings = {'0': '00000', '1': '00001', '2': '00010', '3': '00011', '4': '00100', '5': '00101', 'A': '00110', 'B': '00111', 'C': '01000', 'D': '01001', 'E': '01010', 'F': '01011', 'G': '01100', 'H': '01101', 'I': '01110', 'J': '01111...
2.71875
3
src/apetest/cmdline.py
boxingbeetle/apetest
6
33219
<gh_stars>1-10 # SPDX-License-Identifier: BSD-3-Clause """Command line interface.""" from argparse import ArgumentParser from os import getcwd from typing import List from urllib.parse import urljoin, urlparse import logging from apetest.checker import Accept, PageChecker from apetest.plugin import ( Plugin, ...
2.546875
3
rplugin/python3/denite/source/func.py
delphinus/npm.nvim
19
33220
# ============================================================================ # FILE: func.py # AUTHOR: <NAME> <<EMAIL>> # License: MIT license # ============================================================================ # pylint: disable=E0401,C0411 import os import subprocess from denite import util from .base imp...
2.125
2
SoccerPlanner/app/forms.py
guestnone/SoccerPlanner
0
33221
<reponame>guestnone/SoccerPlanner<filename>SoccerPlanner/app/forms.py """ Definition of forms. """ from django import forms from django.forms import ModelForm, DateInput, TextInput from django.contrib.auth.forms import AuthenticationForm, UserCreationForm from django.contrib.auth.models import User from app.models imp...
2.28125
2
Artificial_Intelligence/botvisible.py
csixteen/HackerRank
4
33222
<filename>Artificial_Intelligence/botvisible.py # coding: -*- utf8 -*- import os.path def get_info(): if os.path.exists("map.txt"): with open("map.txt") as m: info = m.readline().strip().split(" ") info[1] = int(info[1]) info[2] = int(info[2]) return info ...
3.734375
4
temboardui/plugins/monitoring/tools.py
pierrehilbert/temboard
0
33223
import logging from .model.orm import ( Check, Host, Instance, ) from .alerting import ( bootstrap_checks, check_specs, ) logger = logging.getLogger(__name__) def merge_agent_info(session, host_info, instances_info): """Update the host, instance and database information with the data re...
2.5625
3
coordFromRsid.py
bnwolford/FHiGR_score
0
33224
#!/usr/bin/env python3 #=============================================================================== # Copyright (c) 2020 <NAME> # Lab of Dr. <NAME> and Dr. <NAME> # University of Michigan #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation f...
1.53125
2
vnpy/pricing/crrCython/setup.py
black0144/vnpy
5
33225
# encoding: UTF-8 from distutils.core import setup from Cython.Build import cythonize import numpy setup( name = 'crrCython', ext_modules = cythonize("crrCython.pyx"), include_dirs = [numpy.get_include()] )
1.171875
1
popularity_sequence_prediction/callbacks.py
JennyXieJiayi/TSMMVED
7
33226
<filename>popularity_sequence_prediction/callbacks.py ''' Copyright (c) 2021. IIP Lab, Wuhan University ''' import os import numpy as np import pandas as pd import tensorflow as tf import tensorflow.keras.backend as K from tensorflow.keras import models from tensorflow.keras import layers from tensorflo...
2.296875
2
sdks/python/test/test_ReleaseUpdateError.py
Brantone/appcenter-sdks
0
33227
# coding: utf-8 """ App Center Client Microsoft Visual Studio App Center API # noqa: E501 OpenAPI spec version: preview Contact: <EMAIL> Project Repository: https://github.com/b3nab/appcenter-sdks """ from __future__ import absolute_import import unittest import appcenter_sdk from ReleaseUpda...
1.804688
2
main.py
matr095/A-Day-Calculator
0
33228
from ftplib import FTP from datetime import * from tkinter import * def interval(): now = date.today() yourDay = int(input("Vous êtes né quel jour ? ")) yourMonth = int(input("Vous êtes né quel mois ? ")) yourYear = int(input("Vous êtes né quelle année ? ")) birthday = date(yourYear, yourMonth, yourDay) daysPas...
3.53125
4
nodes/sunled_action.py
willdickson/virtual_desert
1
33229
<filename>nodes/sunled_action.py import math import rospy import numpy as np import random from base_action import BaseAction class SunledAction(BaseAction): index_to_led_position = {} def __init__(self,init_angle,device,param,trial_index): print('sunled action __init__') super(SunledAction,s...
2.421875
2
Base64_Cleanup.py
Har6ard/HackTheBox
0
33230
<reponame>Har6ard/HackTheBox #!/usr/bin/python3 """ This script is just to clean up Base64 if is has � present in the output. Example: $�G�r�o�U�P�P�O�L�i�C�Y�S�E�t�t�I�N�G�s� �=� �[�r�E�F�]�.�A�S�s�e�M�B�L�Y�.�G�E�t�T�y�p�E� $GroUPPOLiCYSEttINGs = [rEF].ASseMBLY.GEtTypE """ with open("./target.txt", "r") as f_obj:...
2.4375
2
Pio/Pio_prefs.py
arthole/Pio
0
33231
#Pio_prefs prefsdict = { ###modify or add preferences below #below are the database preferences. "sqluser" : "user", "sqldb" : "database", "sqlhost" : "127.0.0.1", #authorization must come from same address - extra security #valid values yes/no "staticip" : "no", #below is to do logging of qrystmts....
1.921875
2
setup.py
jonbulica99/deeplator
64
33232
#!/usr/bin/env python3 from setuptools import setup setup( name="deeplator", version="0.0.7", description="Wrapper for DeepL translator.", long_description="Deeplator is a library enabling translation via the DeepL translator.", author="uinput", author_email="<EMAIL>", license="MIT", u...
1.28125
1
taiga/core/taxonomy.py
flayner2/TaIGa_pkg
0
33233
import sys import logging as log from ..common import parsers, helpers, retrievers, data_handlers from ..common.data_models import Taxon from typing import List def run_taiga(infile: str, email: str, gb_mode: int = 0, tid: bool = False, correction: bool = False,...
2.59375
3
ot/views.py
marclanepitt/ot
0
33234
from django.shortcuts import render def HomeView(request): return render(request , 'site_home.html') def AboutView(request): return render(request, 'about.html')
1.664063
2
Algo and DSA/LeetCode-Solutions-master/Python/maximum-difference-between-node-and-ancestor.py
Sourav692/FAANG-Interview-Preparation
3,269
33235
<filename>Algo and DSA/LeetCode-Solutions-master/Python/maximum-difference-between-node-and-ancestor.py # Time: O(n) # Space: O(h) # Definition for a binary tree node. class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None # iterative stack solutio...
3.78125
4
blogs/migrations/0012_auto_20200601_1247.py
daaawx/bearblog
657
33236
<reponame>daaawx/bearblog<filename>blogs/migrations/0012_auto_20200601_1247.py # Generated by Django 3.0.6 on 2020-06-01 12:47 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blogs', '0011_auto_20200531_0915'), ] operations = [ migratio...
1.46875
1
nlpr/utils/nL_nr_assay_check.py
jgrembi/nL-qPCR_PathogenChip
0
33237
<reponame>jgrembi/nL-qPCR_PathogenChip # THE PURPOSE OF THIS SCRIPT IS TO SELECT ASSAYS FROM A LIST OF PRIMER COMBINATIONS, SUCH THAT NO MORE THAN TWO OF THE ASSAYS TARGET EXACTLY APROXIMATELY THE SAME POSITIONS . import sys fn = sys.argv[1] fh = open(fn, 'r') def plus_or_minus(x,h): L = [] for i in range(h): L.ap...
2.90625
3
script.py
Kevogich/Recurrence-relation
1
33238
import pandas as pd import pandas import numpy as np #provide local path testfile='../input/test.csv' data = open(testfile).readlines() sequences={} #(key, value) = (id , sequence) for i in range(1,len(data)): line=data[i] line =line.replace('"','') line = line[:-1].split(',') id = int(...
3.09375
3
util/mach/mig.py
rovarma/crashpad
2,151
33239
#!/usr/bin/env python # coding: utf-8 # Copyright 2014 The Crashpad 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/LICEN...
2.234375
2
geoutils/geovector.py
AdrienWehrle/GeoUtils
0
33240
<gh_stars>0 """ geoutils.vectortools provides a toolset for working with vector data. """ from __future__ import annotations import warnings from collections import abc from numbers import Number from typing import TypeVar import geopandas as gpd import numpy as np import rasterio as rio from rasterio import features...
2.59375
3
app/setup.py
cleve/varidb
0
33241
from setuptools import setup # with open("../README.md", "r") as fh: # long_description = fh.read() setup(name='pulzar-pkg', version='21.4.1', author='<NAME>', author_email='<EMAIL>', description='Distributed database and jobs', # long_description=long_description, # long...
1.359375
1
data/sample_hq_aniso.py
aneeshnaik/HernquistFlows
0
33242
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Sample 10^6 particles from anisotropic Hernquist DF. Created: February 2021 Author: <NAME> """ import sys from emcee import EnsembleSampler as Sampler import numpy as np sys.path.append("../src") from constants import G, M_sun, kpc from hernquist import calc_DF_aniso...
3
3
csharp/private/sdk.bzl
j3parker/rules_csharp
0
33243
<filename>csharp/private/sdk.bzl """ Declarations for the .NET SDK Downloads URLs and version These are the URLs to download the .NET SDKs for each of the supported operating systems. These URLs are accessible from: https://dotnet.microsoft.com/download/dotnet-core. """ DOTNET_SDK_VERSION = "3.1.100" DOTNET_SDK = { ...
1.390625
1
exibir_frame.py
rafaelblira/python-progressivo
0
33244
<filename>exibir_frame.py<gh_stars>0 from tkinter import * class MinhaGUI: def __init__(self): # Criando a janela principal self.janela_principal = Tk() # Criando os frames self.frame_cima = Frame(self.janela_principal) self.frame_baixo = Frame(self.janela_principal...
3.265625
3
cnc/migrations/0001_initial.py
andrewmallory/pan-cnc
3
33245
# Generated by Django 3.0.5 on 2020-05-26 13:58 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='RepositoryDetails', fields...
1.6875
2
util.py
awb-carleton/pattern-analysis
0
33246
# coding: utf-8 import os, pickle, csv, json import subprocess from typing import NamedTuple, List, TextIO, Tuple, Dict, Optional, Union, Iterable, Hashable import numpy as np import pandas as pd from scipy import stats from itertools import product, groupby, takewhile from collections import namedtuple, Counter impor...
1.867188
2
panaroo/merge_graphs.py
chrisruis/panaroo
0
33247
import os import tempfile import shutil import argparse import networkx as nx from tqdm import tqdm from joblib import Parallel, delayed from collections import defaultdict, Counter import math import numpy as np from .isvalid import * from .__init__ import __version__ from .cdhit import run_cdhit from .clean_network...
2.40625
2
campbellsoup/utilities_test.py
NBOCampbellToets/CampbellSoup
0
33248
<filename>campbellsoup/utilities_test.py # (c) 2016 <NAME> from .utilities import * def test_un_camelcase(): assert un_camelcase('CampbellSoupX') == 'campbell_soup_x' assert un_camelcase('NBOCampbellToets') == 'n_b_o_campbell_toets' def test_append_to(): __all__ = [] class Example(object): ...
2.875
3
change-njk.py
js-dos/repository
12
33249
import os import re import yaml for root, dirs, files in os.walk("."): for file in files: njk = os.path.join(root, file) if njk.endswith(".njk"): with open(njk, "r") as file: lines = file.read().split("\n") if not(lines[0].startswith("---")): ...
2.5
2
core/migrations/0003_auto_20180730_1452.py
CobwebOrg/cobweb-django
7
33250
<reponame>CobwebOrg/cobweb-django # Generated by Django 2.0.7 on 2018-07-30 21:52 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0002_auto_20180730_1451'), ] operations = [ migrations.AddField( model_name='resources...
1.859375
2
moto/servicediscovery/__init__.py
symroe/moto
0
33251
<gh_stars>0 """servicediscovery module initialization; sets value for base decorator.""" from .models import servicediscovery_backends from ..core.models import base_decorator mock_servicediscovery = base_decorator(servicediscovery_backends)
1.476563
1
csr/csr.py
AlexJanse/python_csr2transmart
0
33252
<filename>csr/csr.py from datetime import date from typing import Sequence, Optional, Union, Dict, List, Any from pydantic import BaseModel, validator, Field from csr.entity_validation import validate_entity_data from csr.exceptions import DataException class Individual(BaseModel): """ Individual entity ...
2.59375
3
hwtBuildsystem/yosys/config.py
optical-o/hwtBuildsystem
2
33253
<gh_stars>1-10 from hwtBuildsystem.fileUtils import which class YosysConfig(): _DEFAULT_LINUX = '/usr/bin/yosys' @classmethod def getExec(cls): exe = "yosys" if which(exe) is None: raise Exception('Can find yosys installation') return exe if __name__ == "__main__": ...
2.15625
2
usr/examples/03-Drawing/crazy_drawing.py
SSSnow/MDV3
6
33254
<reponame>SSSnow/MDV3 # Crazy Drawing Example # # This example shows off your OpenMV Cam's built-in drawing capabilities. This # example was originally a test but serves as good reference code. Please put # your IDE into non-JPEG mode to see the best drawing quality. import pyb, sensor, image, math sensor.reset() sen...
2.578125
3
app_python/src/test/test_timegen.py
Mexator/devops
1
33255
<filename>app_python/src/test/test_timegen.py<gh_stars>1-10 """This module contains tests for the project. Can be split into several files later""" from datetime import datetime import pytest import pytz from src.main.pages.get_clock_page import get_time_str zone = pytz.timezone("Europe/Moscow") @pytest.mark.parame...
2.5
2
marketplaces/cron_report_daily_activity.py
diassor/CollectorCity-Market-Place
135
33256
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- import os import logging import datetime os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' from django.core.management import setup_environ from django.core.mail import send_mail #from django.db import transaction import settings setup_environ(settings...
2.1875
2
utils/usergrid-util-python/usergrid_tools/general/queue_monitor.py
snoopdave/incubator-usergrid
788
33257
# */ # * Licensed to the Apache Software Foundation (ASF) under one # * or more contributor license agreements. See the NOTICE file # * distributed with this work for additional information # * regarding copyright ownership. The ASF licenses this file # * to you under the Apache License, Version 2.0 (the # * "License...
2.046875
2
core/__init__.py
johndekroon/RPTR
2
33258
""" Init file for the RPTR Core """
0.988281
1
src/hexdump2/__init__.py
HGrooms/hexdump2
0
33259
""" mirrors functionality of hexdump(1) and API interface of Python hexdump package. Usage: 1. Within Python: from hexdump2 import hexdump, color_always # Enable or disable color all the time color_always() hexdump(bytes-like data) 2. From commandline, run the console scripts hexdump2 or hd2 $ hd2 -h """ # Import ...
3.0625
3
scripts/to-geojson.py
openstates/openstates-geo
9
33260
<reponame>openstates/openstates-geo #!/usr/bin/env python3 import os import sys import csv import json import glob import subprocess import us import openstates_metadata as metadata OCD_FIXES = { "ocd-division/country:us/state:vt/sldu:grand_isle-chittenden": "ocd-division/country:us/state:vt/sldu:grand_isle" } SK...
2.34375
2
mask_detection/api/serializers.py
vinaykudari/MaskDetectionAPI
1
33261
<gh_stars>1-10 import PIL from rest_framework import serializers from rest_framework.exceptions import ParseError from .models import Image class ImageSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Image fields = ('pk', 'image', )
2.125
2
mod_audio.py
NUSTEM-UK/Robot-Orchestra-3
0
33262
<reponame>NUSTEM-UK/Robot-Orchestra-3<gh_stars>0 import glob import os import re import pygame from math import log2, pow try: pygame.init() # Throws error in pylint: security issue for C module. Ignore. except ImportError: exit("This script requires the pygame module\nInstall with: sudo pip3 install pygame") ...
2.46875
2
nds/emden.py
risklayer/corona-landkreis-crawler
12
33263
<gh_stars>10-100 #!/usr/bin/python3 from botbase import * _emden_cc = re.compile(r"(?:ha\w+en\swir\s(?:erneut\s)?|Gesundheitsamt)\s*([0-9.]+|\w+)\s+(?:Corona-\s*)?Neuinfektion(?:en)?") _emden = re.compile(r"([0-9.]+)\s(?:Personen|Infektionen)\s*,\svon\sdenen\s*([0-9.]+)\s(?:\(\+?(-?\s*[0-9.]+)\)\s)?Personen\sgenesen\s...
2.5
2
fedhf/component/evaluator/__init__.py
beiyuouo/FedHF
2
33264
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- # @File : fedhf\component\evaluator\__init__.py # @Time : 2022-05-03 16:00:21 # @Author : <NAME> # @Email : <EMAIL> # @License : Apache License 2.0 __all__ = ["Evaluator", "build_evaluator", "evaluator_factory", "BaseEvaluator"] from .eva...
2.125
2
RAISoft/gui_scripts/ModulatedPhotocurrent.py
daveraees/EMA_Test_Lab
0
33265
# project libraries imports: # instruments: from GenericScript import TestScript class Test(TestScript): def __init__(self): TestScript.__init__(self) self.Name = 'Modulated photocurrent frequency spectrum' self.Description = """Measurement of the modulation frequency spectrum of photocurre...
2.578125
3
ComparativeGenomics/PAML_Analyze/bed_extract_ensembl_NCBIGeneID.py
ajshultz/avian-immunity
4
33266
<reponame>ajshultz/avian-immunity #! /usr/bin/env python import sys import os #This script will read in a bed file with both ensemble IDs and NCBI gene IDs merged, and output a translation table of these IDs. bedfile = sys.argv[1] outfile = sys.argv[2] bed = open(bedfile,"r") output = open(outfile,"w") output.wri...
2.84375
3
ok_redirects/models.py
LowerDeez/ok-redirects
1
33267
from django.conf import settings from django.contrib.sites.models import Site from django.db import models from django.utils.translation import pgettext_lazy from .constants import REDIRECT_TYPE_CHOICES, REDIRECT_301 from .fields import MultipleChoiceArrayField __all__ = ( 'Redirect', ) LANGUAGES = getattr(setti...
2.125
2
slide/D-g-conv.py
tribbloid/convnet-abstraction
5
33268
# -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: percent # format_version: '1.2' # jupytext_version: 0.8.6 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # %% {"slideshow": {"slide_ty...
2.3125
2
tests/transformer/test_assert.py
rahulbahal7/restricted-python
236
33269
<reponame>rahulbahal7/restricted-python from tests.helper import restricted_exec def test_RestrictingNodeTransformer__visit_Assert__1(): """It allows assert statements.""" restricted_exec('assert 1')
2.078125
2
mnist/train_imbalanced_mnist.py
pfnet-research/robust_estimation
3
33270
<filename>mnist/train_imbalanced_mnist.py import argparse import os import numpy as np import chainer from chainer import functions as F from chainer import iterators from chainer import optimizers from chainer import training from chainer.training import extensions as E from chainer_chemistry.models.prediction import...
2.546875
3
driver/urls.py
mzazakeith/uber-clone
1
33271
from django.conf.urls import url, include from driver import views # from djgeojson.views import GeoJSONLayerView # from driver.models import Points urlpatterns = [ url(r'^new/driver$', views.create_driver_profile, name='new-driver-profile'), url(r'^new/car$', views.submit_car, name='new-car'), ]
1.75
2
server/score_calculator/model_mean.py
moonhc/league-of-legend-win-prediction
0
33272
import numpy as np import tensorflow as tf from utils import fc_block from params import* class Model(): def __init__(self, input_dim=INPUT_DIM, output_dim=OUTPUT_DIM, dim_hidden=DIM_HIDDEN, latent_dim=LATENT_DIM, update_lr=LEARNING_RATE, scope='model'): self.input_dim = input_dim self.ou...
2.25
2
tests/conftest.py
arkturix/internet-heroku-aut
0
33273
<filename>tests/conftest.py import pytest from herokuapp_internet.login_page import LoginPage from herokuapp_internet.disappearing_elements_page import DisappearingElementsPage import logging logger = logging.getLogger(__name__) def pytest_addoption(parser): parser.addoption( "--headless", action="store"...
2.234375
2
dodo.py
spandanb/textwalker
2
33274
<reponame>spandanb/textwalker """ doit docs: https://pydoit.org/cmd_run.html """ import pdoc import os import os.path def generate_docs(docs_dir: str): """ python callable that creates docs like docs/textwalker.html, docs/patternparser.py Args: docs_dir: location to output docs to """ if n...
2.859375
3
ComplexNetworkSim/statistics.py
Juliet-Chunli/cnss
14
33275
''' Module for basic averaging of system states across multiple trials. Used in plotting. @author: <NAME> <<EMAIL>> ''' class TrialState(object): def __init__(self, trial_id, times, systemStates, uniqueStates, stateCounterForStateX): self.trial_id = trial_id self.times = times ...
2.609375
3
lhotse/bin/modes/recipes/vctk.py
m-wiesner/lhotse
0
33276
<reponame>m-wiesner/lhotse import click from lhotse.bin.modes import obtain, prepare from lhotse.recipes import download_vctk, prepare_vctk from lhotse.utils import Pathlike __all__ = ['vctk'] @prepare.command() @click.argument('corpus_dir', type=click.Path(exists=True, dir_okay=True)) @click.argument('output_dir',...
2.21875
2
external/fv3fit/setup.py
jacnugent/fv3net
0
33277
#!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" from setuptools import setup, find_packages requirements = [ "xarray>=0.14", "numpy>=1.11", "scikit-learn>=0.22", "fsspec>=0.6.2", "pyyaml>=5.1.2", "tensorflow>=2.2.0", "tensorflow-addons>=0.11.2", "typing_extension...
1.398438
1
dupa/__init__.py
kr1surb4n/dupa
0
33278
# -*- coding: utf-8 -*- """Dupa Set of tools handy during working, debuging and testing the code.""" __version__ = '0.0.1' __author__ = '<NAME> <<EMAIL>>' import time from functools import wraps from dupa.fixturize import fixturize def debug(func): """Print the function signature and return value""" @wraps...
3.09375
3
spa/templates.py
fergalmoran/dss
0
33279
from django.contrib.sites.models import Site from django.shortcuts import render_to_response from django.template.context import RequestContext from htmlmin.decorators import not_minified_response from dss import localsettings from spa.forms import UserForm __author__ = 'fergalm' @not_minified_response de...
1.945313
2
service/imagepost_views.py
sandipsahajoy/Distributed-Social-Networking
5
33280
<reponame>sandipsahajoy/Distributed-Social-Networking from rest_framework import status from rest_framework.response import Response from rest_framework.decorators import api_view from drf_yasg.utils import swagger_auto_schema from service.serializers import PostSerializer, ImagePostSerializer from .models import Autho...
2.421875
2
pixivpy_async/bapi.py
Kyle2142/pixivpy-async
0
33281
<filename>pixivpy_async/bapi.py<gh_stars>0 # -*- coding:utf-8 -*- import hashlib import os from datetime import datetime from .error import * from .utils import Utils from .api import API from .net import Net class BasePixivAPI(Net, Utils): def __init__(self, **requests_kwargs): self.additional_headers = ...
2.0625
2
examples/ConsumptionSaving/example_ConsPortfolioModel.py
HsinYiHung/HARK_HY
0
33282
<reponame>HsinYiHung/HARK_HY # %% ''' Example implementations of HARK.ConsumptionSaving.ConsPortfolioModel ''' from HARK.ConsumptionSaving.ConsPortfolioModel import PortfolioConsumerType, init_portfolio from HARK.ConsumptionSaving.ConsIndShockModel import init_lifecycle from HARK.utilities import plotFuncs from copy im...
2.453125
2
tests/test_order.py
mikedh/lobby
1
33283
<filename>tests/test_order.py import lobby def test_book(): # Create a LOB object lob = lobby.OrderBook() ########### Limit Orders ############# # Create some limit orders someOrders = [{'type': 'limit', 'side': 'ask', 'qty': 5, 'price': 10...
2.546875
3
examples/main_simulation_lemon_graph.py
KaterynaMelnyk/GraphKKE
1
33284
import os import argparse import numpy as np import scipy import imageio import matplotlib.pyplot as plt from sklearn.cluster import KMeans import graphkke.generate_graphs.graph_generation as graph_generation import graphkke.generate_graphs.generate_SDE as generate_SDE parser = argparse.ArgumentParser() parser.add_...
2.46875
2
tests/io/open_plus.py
peterson79/pycom-micropython-sigfox
37
33285
import sys try: import uos as os except ImportError: import os if not hasattr(os, "unlink"): print("SKIP") sys.exit() # cleanup in case testfile exists try: os.unlink("testfile") except OSError: pass try: f = open("testfile", "r+b") print("Unexpectedly opened non-existing file") excep...
2.765625
3
scraper/spiders/ytch.py
IDex/youtube-live-alert2
0
33286
import json import re import datetime import scrapy import yaml import munch import pathlib from appdirs import user_config_dir config_path = list(pathlib.Path(__file__).parent.parent.parent.resolve().glob('config.yml'))[0] class YtchSpider(scrapy.Spider): name = "ytch" start_urls = list( munch.Munch...
2.46875
2
pih2o/controls/pump.py
anxuae/piH2O
8
33287
<gh_stars>1-10 # -*- coding: utf-8 -*- """Pih2o pump / electro-valve management. """ import threading from RPi import GPIO from pih2o.utils import LOGGER class Pump(object): def __init__(self, pin): self._running = threading.Event() self.pin = pin GPIO.setup(pin, GPIO.OUT) GPIO...
3.171875
3
driloader/config/config_base.py
lucasmello/Driloader
4
33288
<reponame>lucasmello/Driloader """ Responsible to return the abstract browser configs. """ from abc import ABC, abstractmethod class BrowserConfigBase(ABC): """ Holds abstract methods to be implemented in Browser Config classes. """ @abstractmethod def base_url(self): """ Return b...
2.859375
3
visualize-candle.py
frozenrainyoo/deep_learning.study
0
33289
import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from mpl_finance import candlestick_ohlc # import matplotlib as mpl then mpl.use('TkAgg') import pandas as pd import numpy as np from datetime import datetime df = pd.read_csv('BitMEX-OHLCV-1d.csv') df.columns = ['date', 'open', 'high', 'low', 'clo...
2.15625
2
vmware_nsx/tests/unit/common_plugin/test_housekeeper.py
salv-orlando/vmware-nsx
0
33290
<gh_stars>0 # Copyright 2018 VMware, 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 r...
1.820313
2
tests/integration/fields/follow_reference/test_complex_type.py
guglielmoseminara/mongoengine-goodjson
0
33291
<reponame>guglielmoseminara/mongoengine-goodjson #!/usr/bin/env python # coding=utf-8 """Complex Type Tests.""" import json import mongoengine_goodjson as gj import mongoengine as db from ...fixtures.base import Dictable from ....con_base import DBConBase class FollowReferenceFieldLimitRecursionComlexTypeTest(DBC...
2.203125
2
src/mine/invest/calc_stock_cost.py
AldrichYang/HelloPython3
0
33292
<filename>src/mine/invest/calc_stock_cost.py # 现在单位成本价,现在数量 current_unit_cost = 78.1 current_amount = 1300 # 计算补仓后成本价 def calc_stock_new_cost(add_buy_amount,add_buy_unit_cost): # 补仓买入成本 buy_stock_cost = add_buy_amount*add_buy_unit_cost # 补仓后总投入股票成本 = 现数量 * 现成本单价 + 新数量 * 新成本单价 new_stock_cost = current_a...
2.859375
3
appengine/findit/libs/test_results/webkit_layout_test_results.py
xinghun61/infra
2
33293
# Copyright 2018 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """This module is for webkit-layout-tests-related operations.""" import re from libs import test_name_util from libs.test_results.base_test_results import B...
1.882813
2
recvCases/views.py
BattleJudge/recvCase
0
33294
import os import zipfile import hashlib import logging import json from django.conf import settings from django.shortcuts import render from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.permissions import (AllowAny, IsAuthenticated, ) from .serializers import Test...
2.125
2
client/python/tests/test_multi_packet.py
SaschaZ/ff-proxy
1
33295
<filename>client/python/tests/test_multi_packet.py from ff_client import FfClient, FfConfig, FfRequest import unittest import logging class TestFfClientMutiPacket(unittest.TestCase): def test_create_request_packets(self): client = FfClient(FfConfig(ip_address='127.0.0.1', ...
2.65625
3
model_card_toolkit/model_card.py
Saiprasad16/model-card-toolkit
1
33296
# 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 or agreed to in writing, ...
2.109375
2
nodes/ros_random_search.py
ARQ-CRISP/bopt_grasp_quality
0
33297
#!/usr/bin/env python from __future__ import division, print_function import numpy as np import rospy from rospkg.rospack import RosPack from copy import deepcopy from tf2_ros import TransformListener, Buffer from bopt_grasp_quality.srv import bopt, boptResponse from bayesian_optimization import Random_Explorer from b...
1.820313
2
modules/channel_opting/channel_message_manager.py
DenverCoder1/jct-discord-bot
10
33298
<gh_stars>1-10 from typing import List, Optional from utils.embedder import build_embed from utils.utils import one from database.channel_message import ChannelMessage import discord class ChannelMessageManager: def __init__(self, host_channel: discord.TextChannel, emoji: str): self.__host_channel = host_channel ...
2.40625
2
test.py
Timokasse/rediscache
0
33299
#!/usr/bin/env python from time import sleep from rediscache import rediscache import time, redis @rediscache(1, 2) def getTestValue(): return (5, 'toto') if __name__ == '__main__': myfunction()
2.296875
2