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
src/prefect/environments/execution/__init__.py
vnsn/prefect
8,633
12784051
""" Execution environments encapsulate the logic for where your Flow should execute in Prefect Cloud. DEPRECATED: Environment based configuration is deprecated, please transition to configuring `flow.run_config` instead of `flow.environment`. See https://docs.prefect.io/orchestration/flow_config/overview.html for more...
1.234375
1
src/load_files.py
marckolak/radio-map-calibration-robot
0
12784052
""" The pypositioning.system.load_files.py module contains functions allowing to load measurement results from various types of files. The currently available functions allow to load **.psd** files collected with TI Packet Sniffer and results obtained using IONIS localization system. Copyright (C) 2020 <NAME> """ impo...
2.515625
3
Chess/main.py
jlefkoff/GridBoard
1
12784053
import ChessFuntions import pprint game = ChessFuntions.Chessgame() game.setup() game.wereToMove(2, 1)
1.617188
2
Q084.py
Linchin/python_leetcode_git
0
12784054
<reponame>Linchin/python_leetcode_git """ 84 hard max rectangle in histogram Given an array of integers heights representing the histogram's bar height where the width of each bar is 1, return the area of the largest rectangle in the histogram. """ from typing import List class Solution: def largestRectangleA...
3.578125
4
packages/w3af/w3af/core/controllers/threads/threadpool.py
ZooAtmosphereGroup/HelloPackages
0
12784055
""" threadpool.py Copyright 2006 <NAME> This file is part of w3af, http://w3af.org/ . w3af 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 Foundation version 2 of the License. w3af is distributed in the hope that it will ...
2.59375
3
lib/service.py
psobot/biographer
1
12784056
import logging import inspect import mechanize log = logging.getLogger(__name__) class Service(object): """ The superclass of all services. When creating a service, inherit from this class and implement the following methods as necessary: __init__ authenticate check_<attribute>...
2.96875
3
ostap/fitting/fitresult.py
TatianaOvsiannikova/ostap
14
12784057
<reponame>TatianaOvsiannikova/ostap #!/usr/bin/env python # -*- coding: utf-8 -*- # ============================================================================= ## @file ostap/fitting/fitresult.py # Tiny decoration for ROOT.FitResult object # @author <NAME> <EMAIL> # @date 2011-06-07 # ===========================...
1.703125
2
positionsize.py
fearlessspider/IKH-Quant-Connect
3
12784058
<reponame>fearlessspider/IKH-Quant-Connect from decimal import Decimal class PositionSize: symbol = "USDJPY" algorithm = None bonus = 0 def __init__(self, algorithm, symbol, tenkan, kijun, senkou, period=15): self.symbol = symbol self.algorithm = algorithm # Get POINT value for...
2.5
2
alpha.py
ssadjina/FatTailedTools
0
12784059
# A collection of various tools to help estimate and analyze the tail exponent. import pandas as pd import numpy as np import matplotlib.pyplot as plt from FatTailedTools.plotting import plot_survival_function from FatTailedTools.survival import get_survival_function def fit_alpha_linear(series, tail_start_mad=2.5,...
3.25
3
foreman_compute_resource.py
Nosmoht/ansible-module-foreman
53
12784060
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage Foreman compute resource resources. # # This module 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 Foundation, either version 3 of the License, or # ...
1.53125
2
tests/isct/test_container.py
UvaCsl/desist
0
12784061
<filename>tests/isct/test_container.py import pathlib import pytest from desist.isct.container import create_container from desist.isct.docker import Docker from desist.isct.singularity import Singularity from .test_runner import DummyRunner from desist.isct.utilities import OS @pytest.mark.parametrize("platform", [...
1.96875
2
pysprint/core/bases/_apply.py
kingablgh/PySprint
13
12784062
import types import warnings from collections.abc import Iterable from inspect import getfullargspec import numpy as np class _DatasetApply: """ Helper class to apply function to `pysprint.core.bases.dataset.Dataset` objects. """ def __init__( self, obj, func, ...
2.53125
3
calculations/statraw/stats2csv.py
paqs2020/paqs2020
1
12784063
<gh_stars>1-10 import csv import pickle finalstat = pickle.load(open("finalstats.pkl","rb")) with open('finalstat.csv','a') as f: w = csv.writer(f) w.writerow(['statistics']+list(finalstat['accurate'].keys())) for quality in finalstat: w.writerow([quality]+list(finalstat[quality].values())) sta...
2.765625
3
chill/examples/chill/testcases/jacobi_box_1_32.py
CompOpt4Apps/Artifact-DataDepSimplify
5
12784064
from chill import * source('jacobi_box_1_32.c') destination('jacobi_box_1_32modified.c') procedure('smooth_box_1_32') loop(0) original() print_code() stencil_temp(3) print_code() print_space()
1.679688
2
Exercicios/PythonExercicios/ex041 - 050/ex047.py
sggrilo/Curso-em-Video-Python
0
12784065
# CONTAGEM DE PARES — Crie um programa que mostre na tela todos os números pares entre 1 e 50. from time import sleep print('NÚMEROS PARES ENTRE 2 E 50\n') sleep(1) for i in range(2, 51, 2): print(i)
3.5
4
tests/conftest.py
workforce-data-initiative/etp-warehouse
0
12784066
import os import pytest from sqlalchemy.inspection import inspect from sqlalchemy_utils.functions import drop_database from alembic import config from dbutils import conn_uri_factory, DbConnection def pytest_addoption(parser): """ Custom command line options required for test runs """ parser.addopti...
2.203125
2
uploader.py
fuzzycode/DawnDriver
1
12784067
<gh_stars>1-10 # Copyright (c) 2014, Dawn Robotics Ltd # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, this # list of c...
0.878906
1
res/py/3/Context/http/scrape/_DEFAULT.py
ytyaru0/Python.TemplateFileMaker.20180314204216
0
12784068
import urllib.request from bs4 import BeautifulSoup url = 'https://www.google.co.jp' with urllib.request.urlopen(url) as res: soup = BeautifulSoup(res.read(), 'html.parser') print(soup.select('title')[0].text) # `<title>*</title>`
3.484375
3
restapi/apis.py
reindexer/django-restapi
2
12784069
all_apis = []
1.078125
1
env_settings/migrations/0001_initial.py
jjorissen52/django-env-settings
2
12784070
<filename>env_settings/migrations/0001_initial.py from django.conf import settings from django.contrib.auth import get_user_model from django.db import migrations, models INITIAL_GROUPS = [] def add_initial_auth(apps, schema_editor): Group = apps.get_model('auth', 'Group') User = get_user_model() initi...
2.0625
2
wiki/forms.py
Jeromeschmidt/makewiki_v2
0
12784071
<filename>wiki/forms.py from django.forms import ModelForm from wiki.models import Page class PageForm(ModelForm): """ Render and process a form based on the Page model. """ model = Page
2.390625
2
parallel/worker.py
proteneer/timemachine
91
12784072
<filename>parallel/worker.py import argparse import numpy as np from datetime import datetime import os import logging import pickle from concurrent import futures from parallel.grpc import service_pb2, service_pb2_grpc from parallel.utils import get_worker_status from parallel.constants import DEFAULT_GRPC_OPTIONS ...
2.71875
3
common/test/test_signing_serializer.py
andkononykhin/plenum
148
12784073
<gh_stars>100-1000 from collections import OrderedDict import pytest from common.serializers.serialization import serialize_msg_for_signing def test_serialize_int(): assert b"1" == serialize_msg_for_signing(1) def test_serialize_str(): assert b"aaa" == serialize_msg_for_signing("aaa") def test_serialize...
2.53125
3
src/asphalt/redis/component.py
asphalt-framework/asphalt-redis
5
12784074
<filename>src/asphalt/redis/component.py from __future__ import annotations import logging from typeguard import check_argument_types from asphalt.core import Component, Context, context_teardown from redis.asyncio import Redis logger = logging.getLogger(__name__) class RedisComponent(Component): """ Prov...
2.34375
2
models/HarmonicNet.py
stegmaierj/HarmonicNet
1
12784075
# -*- coding: utf-8 -*- """ # HarmonicNet. # Copyright (C) 2021 <NAME>, <NAME>, S.Koppers, <NAME> # # 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 Liceense at # # http://www.apache.org/licenses/LICE...
1.6875
2
Eldorado_Actor-Critic/source/utils/rollouts.py
jbr-ai-labs/BAROCCO
3
12784076
<gh_stars>1-10 import numpy as np from source.env.lib.log import Blob def discountRewardsTD(rewards, vals, gamma=0.99, nSteps=10000): N = len(rewards) - 1 rets = np.zeros(N) rets[-1] = rewards[-1] for idx in reversed(range(N - 1)): nStepsCur = min(nSteps, N - 1 - idx) ret = [rewards[i...
2.15625
2
pyfont/api.py
BingerYang/pyfont
0
12784077
# -*- coding: utf-8 -*- # @Time : 2019-11-08 10:08 # @Author : binger from .draw_by_html import EffectFont from .draw_by_html import FontDrawByHtml from . import FontDraw, FontAttr from PIL import Image, ImageDraw, ImageFont class FontFactory(object): def __init__(self, effect_font, render_by_mixed=False)...
2.609375
3
study_tool/query.py
cubeman99/russian-study-tool
0
12784078
<reponame>cubeman99/russian-study-tool<filename>study_tool/query.py from study_tool.card import Card class CardQuery: """ Queries a list of cards. """ def __init__(self, max_count=30, max_score=1.0, max_proficiency=10, card_type=None): """ Defines a study query ...
3.140625
3
thermosteam/utils/decorators/thermo_user.py
yoelcortes/thermotree
2
12784079
<filename>thermosteam/utils/decorators/thermo_user.py # -*- coding: utf-8 -*- # BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules # Copyright (C) 2020-2021, <NAME> <<EMAIL>> # # This module is under the UIUC open-source license. See # github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LI...
1.929688
2
project/university/migrations/0009_rename_courseid_course_courseid.py
minaee/cd557
0
12784080
# Generated by Django 4.0.3 on 2022-03-12 20:16 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('university', '0008_rename_course_id_course_courseid_and_more'), ] operations = [ migrations.RenameField( model_name='course', ...
1.734375
2
personal_context_builder/test/test_API_models.py
InternetOfUs/personal-context-builder
0
12784081
""" Test for the API that handle models Copyright (c) 2021 Idiap Research Institute, https://www.idiap.ch/ Written by <NAME> <<EMAIL>>, """ import unittest from fastapi.testclient import TestClient # type: ignore from personal_context_builder import config from personal_context_builder.wenet_fastapi_app import app ...
2.484375
2
fonction_py/tools.py
LaRiffle/axa_challenge
1
12784082
<filename>fonction_py/tools.py from numpy import * import math import pandas def poly_exp(X, degree): N,D = X.shape for d in range(2,degree+1): X = column_stack([X,X[:,0:D]**d]) return X def MSE(yt,yp): print("NE PAS UTILISER MSE !! utiliser LinExp !!!") def normalize(df): return (df - d...
2.84375
3
pyot/managedep/static/startproject/views.py
paaksing/Pyot
60
12784083
<reponame>paaksing/Pyot from aiohttp import web from pyot.models import lol from pyot.core.exceptions import NotFound from .wsgi import app # Create your views here ... @app.routes.get('/summoner_level/{name}/{platform}') async def summoner_level(request: web.Request): '''Get summoner level by name and platfo...
2.46875
2
tests/test_guard_instance.py
joaoteixeira88/pyguard
2
12784084
import pytest from exception.argument_not_instance_of_exception import ArgumentNotInstanceOfException from guard import Guard @pytest.mark.parametrize( "param, typeof, param_name, message, expected", [ (2, str, None, "parameter is not from type <class 'str'>.", pytest.raises(ArgumentNotInstanceOfExce...
2.765625
3
src/UnloadAutoPartitions/genunload.py
rmcelroyF8/amazon-redshift-utils
2,452
12784085
<reponame>rmcelroyF8/amazon-redshift-utils<gh_stars>1000+ """ GenUnload : Generate unload commands given a config file (config.ini) which has information about table, schema, partition column & sort columns -----------------------------------------------------------------------------------------------------------------...
2.578125
3
django_shop/apps/goods/admin.py
XZH950926/mydjango
0
12784086
<gh_stars>0 from django.contrib import admin from .models import Goods,GoodsCategory,IndexBanner,goodsImage # Register your models here. import xadmin class GoodsAdmin(object): #显示的列 list_display = ["name", "click_num", "sold_num", "fav_num", "goods_num", "market_price", "shop_price", "goods_brief...
1.921875
2
src/materials/reeds_data.py
spasmann/1DQMC
0
12784087
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Mar 28 13:22:41 2022 @author: sampasmann """ import numpy as np from time import process_time def reeds_data(Nx=1000, LB=-8.0, RB=8.0): G = 1 # number of energy groups sigt = np.empty((Nx,G)) sigs = np.empty((Nx,G,G)) source = np.empty(...
2.15625
2
Establishment of basic Database/a3-Q1.py
Xuechunqiu/Basic-SQLite
0
12784088
import sqlite3 import time import hashlib conn = None c = None def connect(path): global conn, c conn = sqlite3.connect(path) c = conn.cursor() c.execute(' PRAGMA foreign_keys=ON; ') conn.commit() return def drop_tables(): global conn, c c.execute("drop table if exists demeritNotice...
3.1875
3
pajbot/modules/basic/permaban.py
sadlyfell/bullbot
0
12784089
<reponame>sadlyfell/bullbot import logging from pajbot.managers.adminlog import AdminLogManager from pajbot.models.command import Command from pajbot.models.command import CommandExample from pajbot.modules import BaseModule from pajbot.modules import ModuleType from pajbot.modules.basic import BasicCommandsModule lo...
2.203125
2
text/jython/delete/text_delete.py
ekzemplaro/data_base_language
3
12784090
#! /opt/jython/bin/jython # -*- coding: utf-8 -*- # # delete/text_delete.py # # Oct/12/2016 import sys import string # # --------------------------------------------------------------- sys.path.append ('/var/www/data_base/common/python_common') sys.path.append ('/var/www/data_base/common/jython_common') from jython...
2.421875
2
dekit/run_once.py
algobot76/dekit
0
12784091
import functools def run_once(func): """ The decorated function will only run once. Other calls to it will return None. The original implementation can be found on StackOverflow(https://stackoverflow.com/questions/4103773/efficient-way-of-having-a-function-only-execute-once-in-a-loop) :param func: the fu...
3.796875
4
scripts/lib/FrequencyLib.py
ixent/qosa-snee
1
12784092
<gh_stars>1-10 #Util library for frequency distributions held as dictionaries of key:count from math import sqrt def sortedReport(frequencies): keys = frequencies.keys() keys.sort() for key in keys: report(str(key)+" :" + str(frequencies[key])) def showSumary(frequencies): sortedReport(frequencies) if len(freq...
3.296875
3
scripts/hackathon/create_all_sts.py
mikiec84/delphi
25
12784093
<reponame>mikiec84/delphi """ Get all preassembled statements, prune away unneeded information, pickle them. """ import sys import pickle from delphi.utils.indra import get_statements_from_json_file if __name__ == "__main__": all_sts = get_statements_from_json_file(sys.argv[1]) with open(sys.argv[2], "wb") a...
2.203125
2
scheduled_bots/ontology/obographs_GO.py
turoger/scheduled-bots
6
12784094
import argparse import os from scheduled_bots.ontology.obographs import Graph, Node from wikidataintegrator import wdi_login, wdi_core, wdi_helpers from scheduled_bots import PROPS def ec_formatter(ec_number): splits = ec_number.split('.') if len(splits) < 4: for x in range(4 - len(splits)): ...
2.3125
2
blog/views.py
rahulbiswas24680/Blogapp
0
12784095
from django.shortcuts import render, get_object_or_404, redirect from .models import ( Category, Post, Profile, Comment, PostCreationForm, PostEditForm, UserLoginForm, UserRegistrationForm, UserUpdateForm, ProfileUpdateForm, CommentForm ) from django.views.generic.edit import...
1.945313
2
pixelpal/callbacks/model_checkpoint.py
mparusinski/pixelpal
1
12784096
from tensorflow.keras.callbacks import ModelCheckpoint import os def produce_callback(): checkpoint_filepath = "./run/weights-improvement-{epoch:02d}-{val_psnr_metric:.2f}-{val_ssim_metric:.2f}.hdf5" os.makedirs(os.path.dirname(checkpoint_filepath), exist_ok=True) model_checkpoint = ModelCheckpoint(checkp...
2.28125
2
coding-challenges/firecode/find-ranges.py
acfromspace/infinitygauntlet
3
12784097
def find_range(input_list, input_number): search = [] number_range = [] for index in range(1, len(input_list)): if input_list[index] == input_number: search.append(index) if input_list[index] > input_number: break number_range.append(search[0]) number_range.ap...
3.703125
4
scripts/contractInteraction/config.py
omerzam/Sovryn-smart-contracts
108
12784098
from brownie import * from brownie.network.contract import InterfaceContainer import json def loadConfig(): global contracts, acct thisNetwork = network.show_active() if thisNetwork == "development": acct = accounts[0] configFile = open('./scripts/contractInteraction/testnet_contracts.json...
2.390625
2
social_core/backends/fedora.py
shnaqawi/social-core
745
12784099
<filename>social_core/backends/fedora.py<gh_stars>100-1000 """ Fedora OpenId backend, docs at: https://python-social-auth.readthedocs.io/en/latest/backends/fedora.html """ from .open_id import OpenIdAuth class FedoraOpenId(OpenIdAuth): name = 'fedora' URL = 'https://id.fedoraproject.org' USERNAME_KEY ...
1.390625
1
SnakesAndLadders.py
S0obi/SnakesAndLadders
0
12784100
from Joueur import Joueur from Plateau import Plateau from BonusType import BonusType from random import randrange nbBonus = int(input("Nombre de bonus : ")) nbJoueur = int(input("Saisissez le nombre de joueur : ")) listJoueur = [] for i in range(0,nbJoueur): listJoueur.append(Joueur(input("Nom du joueur " + str(...
3.109375
3
classifier/example.py
Alex92rus/ErrorDetectionProject
1
12784101
<reponame>Alex92rus/ErrorDetectionProject import tensorflow as tf ''' input > weight > hidden layer 1 (activation function) > weights > hidden l 2 (activation function) > weights > output layer feed forward compare output to intended output > cost or loss function (cross entropy) optimisation function (optimizer) >...
3.5625
4
day19.py
drewbrew/advent-of-code-2020
4
12784102
<gh_stars>1-10 from typing import Dict, List, Sequence, Tuple, Union import re TEST_RULES, TEST_MESSAGES = [ i.splitlines() for i in """0: 4 1 5 1: 2 3 | 3 2 2: 4 4 | 5 5 3: 4 5 | 5 4 4: "a" 5: "b" ababbb bababa abbbab aaabbb aaaabbb""".split( "\n\n" ) ] P2_TEST_RULES, P2_TEST_MESSAGES = [ i....
2.25
2
code/network.py
alzaia/four_shapes_classifier
0
12784103
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Definition of the CNN architectures. Baseline: very simple net with few params and no regularization. Regularized: simple net combined with dropout and data augmentation. """ import numpy as np import random import tensorflow as tf from tensorflow.keras.models import...
3.28125
3
orthoMcl.py
vetscience/Tools
0
12784104
#!/usr/bin/env python ''' Oct 10, 2017: <NAME>, The University of Melbourne Simplifies running orthoMCL with a wrapper and pre-checks the known formatting issues with FASTA headers to avoid failure in later stages of the run. ''' import os, sys, optparse, getpass from multiprocessing import Process, Pipe from Util...
2.3125
2
testing/import_text_test.py
kstepanmpmg/mldb
1
12784105
<reponame>kstepanmpmg/mldb # # import_text_test.py # <NAME>, 2016-06-21 # This file is part of MLDB. Copyright 2016 mldb.ai inc. All rights reserved. # import tempfile from mldb import mldb, MldbUnitTest, ResponseException class ImportTextTest(MldbUnitTest): @classmethod def setUpClass(cls): cls.regul...
2.53125
3
src/pyfx/view/components/help_bar/help_bar.py
cielong/pyfx
9
12784106
<filename>src/pyfx/view/components/help_bar/help_bar.py import urwid class HelpBar(urwid.WidgetWrap): HELP_TEXT = [ ('title', "Pyfx"), " ", "UP, DOWN, ENTER, Q", ] def __init__(self, manager): self._manager = manager self._text_widget = urwid.Text(HelpBar.HELP_TEXT) sup...
2.265625
2
aws_interface/cloud/auth/register.py
hubaimaster/aws-interface
53
12784107
from cloud.crypto import * from cloud.auth.get_login_method import do as get_login_method from cloud.permission import Permission, NeedPermission from cloud.auth.get_login_method import match_policy from cloud.message import error import string # Define the input output format of the function. # This information is u...
2.4375
2
src/plotVoltage.py
gdetor/Crebral
0
12784108
<filename>src/plotVoltage.py import numpy as np import matplotlib.pylab as plt def plotVoltage(t, y): fig = plt.figure(figsize=(10, 10)) ax = fig.add_subplot(111) ax.plot(t, y, 'k', lw=2) if __name__ == '__main__': t = np.genfromtxt('time.dat') y = np.genfromtxt('solution.dat') s = np.genfro...
3.0625
3
learning-algorithm-batch/run_Batch_DF_Classifier.py
rashid-islam/Differential_Fairness
4
12784109
# -*- coding: utf-8 -*- """ Created on Wed Feb 6 21:52:54 2019 @author: USER """ import pandas as pd import numpy as np import matplotlib.pyplot as plt import sklearn as sk from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.metrics import accuracy_scor...
2.625
3
Ejercicios/Filtro.py
dannieldev/Fundamentos-de-Python
0
12784110
def filtro(elem): return(elem > 0) l = [1,-3,2,-7,-8,-9,10] lr = filter(filtro,l) print(l) print(lr)
2.953125
3
Source/input/ai/searcher.py
LucXyMan/starseeker
0
12784111
<reponame>LucXyMan/starseeker<gh_stars>0 #!/usr/bin/env python2.7 # -*- coding:UTF-8 -*-2 u"""searcher.py Copyright (c) 2019 <NAME> This software is released under BSD license. コマンド探索モジュール。 """ import pieces as _pieces import utils.const as _const if _const.IS_MULTIPROCESSING: import multiprocessing as __multipro...
2.28125
2
code/Spectral_condensation.py
matthew-hirn/condensation
2
12784112
# -*- coding: utf-8 -*- """ Created on Thu May 2 13:42:37 2019 @author: <NAME> """ import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import matplotlib.cm as cm from mpl_toolkits.mplot3d import Axes3D import cycler def spectral_decay(case = 4, vname = 'example_0', ...
2.3125
2
dlkit/services/commenting.py
UOC/dlkit
2
12784113
"""DLKit Services implementations of commenting service.""" # pylint: disable=no-init # osid specification includes some 'marker' interfaces. # pylint: disable=too-many-ancestors # number of ancestors defined in spec. # pylint: disable=too-few-public-methods,too-many-public-methods # number of methods defin...
2.15625
2
service/user.py
kittolau/selepy
0
12784114
<filename>service/user.py from service.logger_manager import logger class Map(dict): """ Example: m = Map({'first_name': 'Eduardo'}, last_name='Pool', age=24, sports=['Soccer']) """ def __init__(self, *args, **kwargs): super(Map, self).__init__(*args, **kwargs) for arg in args: ...
2.984375
3
project_euler/problem_112/sol1.py
kadirbaytin/Python
0
12784115
<reponame>kadirbaytin/Python<filename>project_euler/problem_112/sol1.py<gh_stars>0 """ Problem: Working from left-to-right if no digit is exceeded by the digit to its left it is called an increasing number; for example, 134468. Similarly if no digit is exceeded by the digit to its right it is called a decreasing numbe...
4.03125
4
App/gui/server_widget.py
Wizard-collab/wizard
0
12784116
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'C:\Users\conta\Documents\script\Wizard\App\work\ui_files\server_widget.ui' # # Created by: PyQt5 UI code generator 5.13.0 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Form(o...
1.84375
2
src/visualization_helpers.py
edesz/store-item-demand-forecast
3
12784117
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- import matplotlib.pyplot as plt import pandas as pd from matplotlib.ticker import MaxNLocator def customize_splines(ax: plt.axis) -> plt.axis: ax.spines["left"].set_edgecolor("black"), ax.spines["left"].set_linewidth(2), ax.spines["left"].set...
2.625
3
mp_video.py
yuangan/A2L
0
12784118
import cv2 import numpy as np import mediapipe as mp import glob import os mp_drawing = mp.solutions.drawing_utils mp_drawing_styles = mp.solutions.drawing_styles mp_face_mesh = mp.solutions.face_mesh #import os os.environ['JOBLIB_TEMP_FOLDER'] = '/tmp' # wait for process: "W016","W017","W018","W019","W023","W024","W...
2.234375
2
py/admin/login.py
newdefence/cj
1
12784119
# coding=utf-8 from tornado.web import RequestHandler, HTTPError from tornado.gen import coroutine from bson import ObjectId from bson.json_util import dumps, loads __author__ = '<EMAIL>' __date__ = "2018/12/14 下午9:58" UID_KEY = 'uid' class LoginHandler(RequestHandler): def check_xsrf_cookie(self): pas...
2.328125
2
agent/tool/result_logger.py
it-akumi/tiss
1
12784120
<reponame>it-akumi/tiss # -*- coding: utf-8 -*- from config.log import TASK_RESULT_KEY, EPISODE_RESULT_KEY import logging import time episode_result_logger = logging.getLogger(EPISODE_RESULT_KEY) task_result_logger = logging.getLogger(TASK_RESULT_KEY) class ResultLogger(object): def __init__(self): self....
2.734375
3
insights/combiners/multinode.py
lhuett/insights-core
1
12784121
from insights import combiner from insights.combiners.hostname import hostname from insights.core.context import create_product from insights.parsers.metadata import MetadataJson from insights.specs import Specs @combiner(MetadataJson, [hostname, Specs.machine_id]) def multinode_product(md, hn, machine_id): hn = ...
2.109375
2
src/nwb_datajoint/common/common_subject.py
jihyunbak/spyglass
1
12784122
<reponame>jihyunbak/spyglass<filename>src/nwb_datajoint/common/common_subject.py import datajoint as dj schema = dj.schema('common_subject') @schema class Subject(dj.Manual): definition = """ subject_id: varchar(80) --- age = NULL: varchar(200) description = NULL: varchar(2000) genotype = NUL...
2.671875
3
bosonCloud/freq_res_script.py
Unoaccaso/freqle
0
12784123
<gh_stars>0 from cProfile import label from freqle import cluster import freqle as fr import matplotlib.pyplot as plt import numpy as np import sys Nbh = int(sys.argv[1]) cluster_eta = float(sys.argv[2]) Tfft = float(sys.argv[3]) binsize = 1/Tfft mu = float(sys.argv[4]) pal = cluster(Nbh = Nbh, n_mus = 300, cluster_e...
2.1875
2
mcenter_client/parallelm/mcenter_client/client.py
lisapm/mlpiper
7
12784124
<reponame>lisapm/mlpiper #! /usr/bin/python3 from __future__ import print_function import time import collections import copy import sys import traceback from . import rest_api from .rest_api.rest import ApiException class _REST(object): def __init__(self, client): self._client = client self.to...
2.140625
2
grammar-pyml/__init__.py
lschaack/grammar-pyml
0
12784125
<reponame>lschaack/grammar-pyml<gh_stars>0 from __future__ import division import reader
0.851563
1
model/sketch.nyu/test_something_here.py
denyingmxd/Torchssc
0
12784126
<gh_stars>0 import torch import torch.nn as nn import os import numpy as np from utils.ply_utils import * colorMap = np.array([[22, 191, 206], # 0 empty, free space [214, 38, 40], # 1 ceiling red tp [43, 160, 4], # 2 floor green fp [158, 216, 22...
1.757813
2
ashtadhyayi_data/writer/__init__.py
ashtadhyayi/data_curation
0
12784127
<filename>ashtadhyayi_data/writer/__init__.py import logging import os import ashtadhyayi_data from doc_curation.md import library from doc_curation.md.file import MdFile for handler in logging.root.handlers[:]: logging.root.removeHandler(handler) logging.basicConfig( level=logging.DEBUG, format="%(levelname)s:...
2.234375
2
Desafios/Desafio 049.py
tiagosm1/Pyhton_CEV
0
12784128
num = int(input('Escolha um número para saber sua tabuada:')) tab = 0 for c in range(1, 11): print('{} x {:2} = {:2}'.format(num, c, num*c))
3.90625
4
stock_notifier/__init__.py
saswatraj/stock_notifier
0
12784129
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Package file for Stock Notifier package. @author: rajsaswa """
0.894531
1
util/apis.py
lucasxlu/MMNet
3
12784130
""" Performance Comparision with Commercial APIs like Face++, Google, MS and Amazon """ import sys import os import requests import numpy as np import pandas as pd from sklearn.metrics import confusion_matrix from sklearn.metrics import accuracy_score sys.path.append('../') from config.cfg import cfg def prepare_te...
2.546875
3
bitcoin_networkapis.py
vizeet/bitcoin_core_python_client
4
12784131
import pycurl from io import BytesIO import json import datetime import pandas as pd myaddress = input('Enter Bitcoin Address: ') btcval = 100000000.0 # in santoshis block_time_in_min = 10 block_time_in_sec = block_time_in_min*60 def getBalance(address: str): strbuf = BytesIO() getreq = pycurl.Curl(...
2.625
3
sandbox/check-mcmc.py
ligo-asimov/asimov
2
12784132
<reponame>ligo-asimov/asimov<gh_stars>1-10 import ast import subprocess from shutil import copy from asimov import gitlab, mattermost from asimov import config from asimov import condor, git from asimov.ini import RunConfiguration import os, glob, datetime from subprocess import check_output as bash import otter s...
2.09375
2
pyweno/__init__.py
alexfikl/PyWENO
1
12784133
<reponame>alexfikl/PyWENO """The PyWENO module.""" import points import kernels import nonuniform import symbolic import symbols import version import weno import cweno
0.992188
1
complaints/forms.py
Three-Dev-Musketeers/Mumbai_Police
5
12784134
<filename>complaints/forms.py from django.forms import ModelForm
1.125
1
recaman_test.py
sfrebel/recamansvg
0
12784135
<filename>recaman_test.py<gh_stars>0 import pytest from recaman import calculate_racaman def test_uniqeness(): sequence = calculate_racaman(24) for elem in sequence: assert sequence.count(elem) == 1 # sequences longer that 24 can contain duplicates (42 for example) def test_sequencelength(): s...
2.96875
3
api/classification/feat_peak.py
xiafanzeng/Raman-Spectroscopy
4
12784136
from scipy.signal import find_peaks import numpy as np import math def search_peaks(x_data, y_data, height=0.1, distance=10): prominence = np.mean(y_data) peak_list = find_peaks(y_data, height=height, prominence=prominence, distance=distance) peaks = [] for i in peak_list[0]: peak = (x_data[i]...
2.453125
2
pytorch_ares/third_party/free_adv_train/free_train.py
thu-ml/realsafe
107
12784137
<reponame>thu-ml/realsafe """Trains a model, saving checkpoints and tensorboard summaries along the way.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from datetime import datetime import os import shutil from timeit import default_timer as ...
2.453125
2
DataGenSalientIU_DUC_allAlignments_CDLM.py
oriern/ClusterProp
2
12784138
import pandas as pd from transformers import BertTokenizer, RobertaTokenizer, AutoTokenizer import os import numpy as np import re import glob from nltk import sent_tokenize from utils import num_tokens import math def read_generic_file(filepath): """ reads any generic text file into list conta...
2.921875
3
Code/grace/source.py
AndreasMadsen/grace
1
12784139
<gh_stars>1-10 __all__ = ["filelist", "getgrid", "getdata", "getposition"] import os import os.path as path import csv import datetime import numpy as np # Resolve the absolute directory path the grids directory grids = path.join(path.dirname(path.realpath(__file__)), 'grids') # Generate a list of all names for the...
3.140625
3
setpasswd/src/__init__.py
Haehnchen/enigma2-plugins
1
12784140
<reponame>Haehnchen/enigma2-plugins # -*- coding: ISO-8859-1 -*- from Components.Language import language from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE import os,gettext PluginLanguageDomain = "SetPasswd" PluginLanguagePath = "SystemPlugins/SetPasswd/locale" def localeInit(): la...
2.3125
2
boot_django.py
Volkova-Natalia/django_rest_auth_email_confirm_reset
0
12784141
<reponame>Volkova-Natalia/django_rest_auth_email_confirm_reset # This file sets up and configures Django. It's used by scripts that need to # execute as if running in a Django server. import os import django from django.conf import settings BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "django_re...
2.03125
2
tests/testLock.py
geek-plus/vlcp
1
12784142
''' Created on 2015/12/14 :author: hubo ''' from __future__ import print_function import unittest from vlcp.server.server import Server from vlcp.event.runnable import RoutineContainer from vlcp.event.lock import Lock, Semaphore from vlcp.config.config import manager class Test(unittest.TestCase): def setUp(self...
2.328125
2
src/tests/__init__.py
miguelarbesu/asd-asd
0
12784143
"""Test suite for asd asd"""
0.894531
1
src/pokeapp/views.py
luisgdev/djangopoke
0
12784144
<filename>src/pokeapp/views.py from django.http import JsonResponse from django.core.serializers import serialize from django.forms.models import model_to_dict from .models import Pokemon, Stat, Evolution # Create your views here. def pokesearch(request, name): pokemon: Pokemon = Pokemon.objects.get(name=name) ...
2.234375
2
Prep/ProgrammingPrac/temp.py
talk2sunil83/UpgradLearning
0
12784145
<reponame>talk2sunil83/UpgradLearning<filename>Prep/ProgrammingPrac/temp.py # %% from typing import Sequence from numba import njit # %% def fib(n: int): if(n <= 2): return 1 return fib(n-1) + fib(n-2) # print(fib(3)) # print(fib(5)) # print(fib(8)) def fib_memo(n: int, memo={1: 1, 2: 1}): if ...
3.625
4
pandoc-convert/convert-directory.py
toffer/docker-data-only-container-demo
17
12784146
#!/usr/bin/env python """Convert Directory. Usage: convert_directory.py <src_dir> <dest_dir> -h --help show this """ import errno import os import subprocess from docopt import docopt def convert_directory(src, dest): # Convert the files in place for root, dirs, files in os.walk(src): for fil...
3.234375
3
build_site_col.py
griffij/eq_hazmap_tests
1
12784147
"""Test building site collection at interpolated points and writing to nrml format Can run in parallel in order to deal with large site collections <NAME> Geoscience Australia """ import os, sys import numpy as np from time import localtime, strftime, gmtime import string import pypar from get_site_model import get_s...
2.234375
2
hknweb/candidate/tests/models/requirements/committee_project/test_committee_project.py
jyxzhang/hknweb
20
12784148
from django.test import TestCase from hknweb.candidate.tests.models.utils import ModelFactory class CommitteeProjectRequirementModelTests(TestCase): def setUp(self): semester = ModelFactory.create_semester( semester="Spring", year=0, ) committeeproject = ModelFacto...
2.609375
3
ogb_lsc/pcq/conformer_utils.py
kawa-work/deepmind-research
10,110
12784149
# 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 # # Unless required by applicable law or agreed...
2.109375
2
remu/plotting.py
ast0815/likelihood-machine
0
12784150
"""Module for handling plotting functions This module contains plotting classes to plot :class:`.Binning` objects. Examples -------- :: plt = plotting.get_plotter(binning) plt.plot_values() plt.savefig('output.png') """ from itertools import cycle import numpy as np from matplotlib import pyplot as ...
3.515625
4