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
space_shuttle_autoladnding_eda.py
ShaonMajumder/space_shuttle_autolanding_decision
2
12779051
# -*- coding:utf-8 -*- import numpy as np import pandas as pd data = pd.read_csv('data/shuttle-landing-control.csv',names=['auto_control','stability','error','sign','wind','magnitude','visibility']) ## replacing missing values '*' with 0 data = data.replace('*',0) ## |---------- Data Set Properties ------------| # ...
3.46875
3
tests/test_cmanalysis.py
niklastoe/classifier_metric_uncertainty
4
12779052
import unittest as ut import pandas as pd import pymc3 as pm from bayesian_inference_confusion_matrix import ConfusionMatrixAnalyser, bayes_laplace_prior class TestConfusionMatrixAnalyser(ut.TestCase): def __init__(self, *args, **kwargs): super(TestConfusionMatrixAnalyser, self).__init__(*args, **kwargs...
2.625
3
pystratis/api/coldstaking/responsemodels/infomodel.py
TjadenFroyda/pyStratis
8
12779053
<filename>pystratis/api/coldstaking/responsemodels/infomodel.py from pydantic import Field from pystratis.api import Model class InfoModel(Model): """A pydantic model for cold wallet information.""" cold_wallet_account_exists: bool = Field(alias='coldWalletAccountExists') """True if cold wallet account ex...
2.484375
2
models/skin.py
V1ckeyR/snake_snake
1
12779054
<reponame>V1ckeyR/snake_snake from app import db class Skin(db.Model): """ Params for category 'color': 'hex' Params for category 'gradient': 'direction', 'colors' """ id = db.Column(db.Integer, primary_key=True) category = db.Column(db.Integer, db.ForeignKey('category.id'), nullable=False) ...
2.71875
3
stock_algorithms/record_coordinates.py
Vermee81/practice-coding-contests
0
12779055
if __name__ == '__main__': N = int(input()) xy_arr = [list(map(int, input().split())) for _ in range(N)] M = int(input()) op_arr = [list(map(int, input().split())) for _ in range(M)] Q = int(input()) ab_arr = [list(map(int, input().split())) for _ in range(Q)] ans_arr = [xy_arr] ...
2.796875
3
src/server/main.py
arkarkark/feedapp
0
12779056
# Copyright 2011 <NAME> (wtwf.com) # based on code by '<EMAIL> (<NAME>)' __author__ = 'wtwf.com (<NAME>)' # If you want to check this with pychecker on osx you can do this... # export PYTHONPATH=$PYTHONPATH:/usr/local/google_appengine/ # export PYTHONPATH=$PYTHONPATH:/usr/local/google_appengine/lib/yaml/lib/ from g...
2.09375
2
src/RGT/XML/SVG/Attribs/classAttribute.py
danrg/RGT-tool
7
12779057
from RGT.XML.SVG.Attribs.basicSvgAttribute import BasicSvgAttribute from types import StringType class ClassAttribute(BasicSvgAttribute): ATTRIBUTE_CLASS = 'class' def setClass(self, data=None): if data is not None: if type(data) is not StringType: data = str(dat...
2.640625
3
swap/router_addresses.py
samirma/BasicDefiToolkit
0
12779058
<gh_stars>0 spooky_factory = "0x152eE697f2E276fA89E96742e9bB9aB1F2E61bE3" hyper_factory = "0x991152411A7B5A14A8CF0cDDE8439435328070dF" spirit_factory = "0xEF45d134b73241eDa7703fa787148D9C9F4950b0" waka_factory = "0xB2435253C71FcA27bE41206EB2793E44e1Df6b6D" sushi_factory = "0xc35DADB65012eC5796536bD9864eD8773aBc74C4" p...
1.195313
1
clusprotools/report/__init__.py
Mingchenchen/cluspro-tools
1
12779059
# ./report/__init__.py from .filtering_parameters import *
1.09375
1
block_average/tests/test.py
rsdefever/block_average
1
12779060
# coding: utf-8 import numpy as np import math from block_average import block_average def main(): # Enter details here n_samples = [int(2.5e5)] # n_samples = [int(5e5),int(1e6),int(2e6),int(4e6)] for n_sample in n_samples: # Generate uncorrelated random samples uncorrelated_sample...
2.71875
3
WebScrapping/getData.py
marcsze/pythonPrograms
0
12779061
#! Python from bs4 import BeautifulSoup from urllib.request import urlopen import requests, re, time # Might need to run the following command in windows to change the encoder # chcp 65001 def getInput(datafile): links = open(datafile, 'r') LinkStorage = [] for line in links: goodLine = line.strip('\n') LinkS...
2.625
3
descriptors/preprocessing.py
truejulosdu13/NiCOlit
2
12779062
<reponame>truejulosdu13/NiCOlit import numpy as np from rdkit import Chem from rdkit import RDLogger RDLogger.logger().setLevel(RDLogger.CRITICAL) def preprocess(df): """Preprocesses the dataframe as described in the article : reference. ### 1.None substrates are removed. ### 2.Reaction extracted from Che...
2.5625
3
Policy Refinement Using Bayesian Optimization/BipadelRandom.py
britig/policy-refinement-bo
1
12779063
""" Code for collecting failure trajectories using Bayesian Optimization Project : Policy correction using Bayesian Optimization Description : The file contains functions for computing failure trajectories given RL policy and safety specifications """ import numpy as np import gym import GPyOp...
2.84375
3
affiliate/req/mobidea.py
gods-view/AdclickIO
0
12779064
<gh_stars>0 #!/usr/bin/env python # encoding: utf-8 """ @author: amigo @contact: <EMAIL> @phone: 15618318407 @software: PyCharm @file: mobidea.py @time: 2017/4/11 下午2:58 """ import urllib import requests from affiliate.req.base_req import BaseReq class MobideaReq(BaseReq): def __init__(self, url, username, pas...
2.375
2
CGPA calculator.py
jasonlmfong/UofT-Grade-Analytics
0
12779065
<filename>CGPA calculator.py from openpyxl import load_workbook from grade_to_gpa import find_gpa from Predictor import predict def weighted_average_grade(workbook): """outputs weighted average of grades""" total_weight = 0 total_grade = 0 for i in range(2, workbook.max_row+1): if workbook[f"{'D'}{i}"...
3.5625
4
74-search-a-2d-matrix/74-search-a-2d-matrix.py
felirox/DS-Algos-Python
0
12779066
<filename>74-search-a-2d-matrix/74-search-a-2d-matrix.py class Solution: def searchMatrix(self, matrix: List[List[int]], target: int) -> bool: for row in matrix: if row[-1]>=target: if target in row: return True return False
3.484375
3
tests/test_pybunpro.py
patrickayoup/pybunpro
1
12779067
<gh_stars>1-10 import pytest from click.testing import CliRunner from pybunpro.__main__ import cli class TestPyBunpro(object): @pytest.fixture def runner(self): return CliRunner() def test_study_queue(self, requests_mock, api_key, runner, mock_study_queue_response, ...
2.28125
2
lfs.py
g-k/github-org-scripts
0
12779068
<reponame>g-k/github-org-scripts #!/usr/bin/env python from __future__ import print_function import json import os import re import time from github_selenium import GitHub2FA, WebDriverException URL = "https://github.com/organizations/mozilla/settings/billing" GH_LOGIN = os.getenv('GH_LOGIN', "org_owner_login") GH_PAS...
2.640625
3
data_io_fns/export_data/write_matrix.py
chrisjdavie/ws_cross_project
0
12779069
<filename>data_io_fns/export_data/write_matrix.py ''' writes various file strutures. Created on 11 Oct 2012 @author: chris ''' import h5py import numpy as np import csv def write_zmp_matrix_hdf(fname,data,x,y,z,t,dname='gas density'): hdf_file = __open_hdf__(fname) __write_data__(hdf_file,dname,...
2.6875
3
experiments/jz/utils/loading_script_utils/load_dataset.py
chkla/metadata
13
12779070
<gh_stars>10-100 import logging import sys import hydra from datasets import config, load_dataset from hydra.core.config_store import ConfigStore from bsmetadata.input_pipeline import DataConfig from bsmetadata.train import show_help logger = logging.getLogger(__name__) cs = ConfigStore.instance() cs.store(name="d...
2.078125
2
core/analyzers/postgresqlanalyzer.py
cmu-db/cmdbac
31
12779071
import os, sys sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir)) import logging import re from baseanalyzer import BaseAnalyzer ## ===================================================================== ## LOGGING CONFIGURATION ## ===================================================================== ...
2.171875
2
tutorial/pipeline_outputProcessing.py
AGAPIA/waymo-open-dataset
0
12779072
# The purpose of this pileine stage script is to copy only the cleaned output files that is needed in the end (such that we can share them easily) import os import pipeline_commons import shutil import ReconstructionUtils def do_output(segmentPath, globalParams): segmentName = pipeline_commons.ext...
2.296875
2
models/base_model.py
MoustafaMeshry/lsr
8
12779073
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
1.859375
2
chaosplt_experiment/storage/model/__init__.py
chaostoolkit/chaosplatform-experiment
0
12779074
<filename>chaosplt_experiment/storage/model/__init__.py # -*- coding: utf-8 -*- from .discovery import Discovery from .execution import Execution from .experiment import Experiment from .init import Init from .recommendation import Recommendation __all__ = ["Discovery", "Execution", "Experiment", "Execution", "Init", ...
1.179688
1
connectdjango/settings.py
gabrielstonedelza/connectdjango
0
12779075
import os import locale from decouple import config # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.0/howto/deployment...
1.773438
2
challenge/migrations/0001_initial.py
cedricnoel/django-hearthstone
0
12779076
<gh_stars>0 # Generated by Django 2.2.dev20190116205049 on 2019-01-16 20:54 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('decks', '0007_auto_20190116_2054'), ...
1.78125
2
scraps/fitsS21/utils.py
FaustinCarter/scraps
9
12779077
<gh_stars>1-10 """A set of simple utility functions for array math.""" import numpy as np import scipy.signal as sps def reduce_by_midpoint(array): """Subtract off and divide by middle array element. Sorts the array before picking mid-point, but returned array is not sorted.""" midpoint = sorted(arra...
3.453125
3
Curso Em Video-python/PYTHON (MUNDO 1, MUNDO 2 E MUNDO 3)/exercicios/ex0094Unindo_dict_listas.py
AlamoVinicius/code-pratice
0
12779078
""" Crie um programa que leia nome, sexo e idade de várias pessoas, guardando os dados de cada pessoa em um dicionário e todos os dicionários em uma lista. No final, msotre: a - quantas pessoas foram cadastradas/ b - a média de idade do grupo/ c- uma lista com todas as mulheres. d - uma lista com todas as pessoas com i...
3.9375
4
tuesmon_ncurses/ui/views/auth.py
tuesmoncom/tuesmon-ncurses
0
12779079
# -*- coding: utf-8 -*- """ tuesmon_ncurses.ui.views.auth ~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ from tuesmon_ncurses.ui.widgets import generic, auth from . import base class LoginView(base.View): login_button = None def __init__(self, username_text, password_text): # Header header = generic.bann...
2.234375
2
generated/python/proto-google-cloud-language-v1beta2/google/cloud/proto/language/v1beta2/language_service_pb2_grpc.py
landrito/api-client-staging
18
12779080
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from grpc.framework.common import cardinality from grpc.framework.interfaces.face import utilities as face_utilities import google.cloud.proto.language.v1beta2.language_service_pb2 as google_dot_cloud_dot_proto_dot_language_dot_v1beta2_d...
1.679688
2
lametro/context_processors.py
datamade/la-metro-councilmatic
5
12779081
<reponame>datamade/la-metro-councilmatic from django.conf import settings def recaptcha_public_key(request): # See: https://developers.google.com/recaptcha/docs/faq recaptcha_dev_key = '<KEY>' return { 'recaptcha_public_key': getattr(settings, 'RECAPTCHA_PUBLIC_KEY', recaptcha_dev_key) }
1.78125
2
pygoap/memory.py
bitcraft/storymaker
6
12779082
<gh_stars>1-10 """ Memories are stored precepts. """ class MemoryManager(set): """ Store and manage precepts. """ max_size = 300 def add(self, other): assert (other is not None) if len(self) > MemoryManager.max_size: self.pop() super().add(other) def of_c...
2.953125
3
SuperTracker_EPM_Template.py
EBGU/RodentTracker
1
12779083
import os import numpy as np import time from multiprocessing import Pool import psutil import cv2 import matplotlib.pyplot as plt import av #for better performance ############################################################################## #For EPM, please select pionts from the OPEN arm to the CLOSE arm and press...
1.929688
2
data_filters/src/square.py
smontanaro/csvprogs
0
12779084
<reponame>smontanaro/csvprogs #!/usr/bin/env python """ =========== %(PROG)s =========== ----------------------------------------------------- Convert data from point-to-point to square movements ----------------------------------------------------- :Author: <EMAIL> :Date: 2013-03-15 :Copyright: TradeLink LLC 2013 :...
2.953125
3
src/main/seed.py
Couapy/shelf
0
12779085
<reponame>Couapy/shelf from django.contrib.auth.models import User from django_seed import Seed from .models import Book, Chapter, Shelf seeder = Seed.seeder() seeder.add_entity(User, 3) seeder.add_entity(Shelf, 5) seeder.add_entity(Book, 25) seeder.add_entity(Chapter, 150) inserted_pks = seeder.execute() for shel...
2.125
2
python/_collections/py_collections_deque/main.py
bionikspoon/hackerrank-challenges
0
12779086
<reponame>bionikspoon/hackerrank-challenges<gh_stars>0 from collections import deque from fileinput import input def parse_input(data): _ = int(data.pop(0)) return [op.split(' ', 1) for op in data] def create_stack(ops): stack = deque() def_cmd = { 'append': lambda d, *args: d.append(*args)...
3.515625
4
pontoon/translate/tests/test_views.py
nanopony/pontoon
1
12779087
<reponame>nanopony/pontoon import pytest from django.urls import reverse from waffle.testutils import override_switch @pytest.mark.django_db def test_translate_behind_switch(client): url = reverse('pontoon.translate.next') response = client.get(url) assert response.status_code == 404 with override...
2.0625
2
tests/test_stock_availability.py
mrkevinomar/saleor
4
12779088
<reponame>mrkevinomar/saleor import pytest from django.test import override_settings from saleor.core.exceptions import InsufficientStock from saleor.warehouse.availability import ( are_all_product_variants_in_stock, check_stock_quantity, get_available_quantity, get_available_quantity_for_customer, ...
2.296875
2
prototype/ukwa/lib/utils.py
GilHoggarth/ukwa-manage
1
12779089
<gh_stars>1-10 ''' Created on 10 Feb 2016 @author: andy ''' import os from urlparse import urlparse def url_to_surt(in_url, host_only=False): ''' Converts a URL to SURT form. ''' parsed = urlparse(in_url) authority = parsed.netloc.split(".") authority.reverse() surt = "http://(%s," % ","...
3.21875
3
src/promnesia/__init__.py
halhenke/promnesia
1,327
12779090
from pathlib import Path from .common import PathIsh, Visit, Source, last, Loc, Results, DbVisit, Context, Res # add deprecation warning so eventually this may converted to a namespace package? import warnings warnings.warn("DEPRECATED! Please import directly from 'promnesia.common', e.g. 'from promnesia.common import...
1.3125
1
yourenv/pythonClub/pythonClubProject/views.py
oconnalla/pythonClub
0
12779091
<reponame>oconnalla/pythonClub<filename>yourenv/pythonClub/pythonClubProject/views.py from django.shortcuts import render, get_object_or_404 from .models import Meeting, Meeting_Minutes, Resource, Event from .forms import MeetingForm, MeetingMinutesForm from django.contrib.auth.decorators import login_required #may nee...
2.140625
2
internalScripts/analysis-scripts/SummarizeGapfillResultsTables.py
kbase/probabilistic_annotation
0
12779092
<reponame>kbase/probabilistic_annotation<gh_stars>0 #!/usr/bin/python # Generate summary statistics comparing two gapfill results tables from AnalyzeGapfillResults.py (one for probanno # and one for non-probanno) import optparse import sys usage = "%prog [Probanno_result_table] [Non_probanno_result_table]" descripti...
2.265625
2
podcasts/utils/serializers.py
janwh/selfhosted-podcast-archive
26
12779093
import datetime from django.core.serializers.json import DjangoJSONEncoder class PodcastsJSONEncoder(DjangoJSONEncoder): def default(self, o): # See "Date Time String Format" in the ECMA-262 specification. if isinstance(o, datetime.timedelta): return round(o.total_seconds() * 1000) ...
2.296875
2
31/00/list.remove.1.py
pylangstudy/201705
0
12779094
l = [1,2,1,3] l.remove(4) print(l)
2.859375
3
src/scripts/distribution_samples.py
secimTools/GalaxyTools
10
12779095
<gh_stars>1-10 #!/usr/bin/env python ################################################################################ # Date: 2016/July/06 ed. 1016/July/11 # # Module: distribution_samples.py # # VERSION: 1.1 # # AUTHOR: <NAME> (<EMAIL>) # Edited by <NAME> (<EMAIL>) # # DESCRIPTION: This program creates a di...
2.328125
2
src/view/ClassGraphView.py
dangbinghoo/SourceScope
0
12779096
<reponame>dangbinghoo/SourceScope<filename>src/view/ClassGraphView.py #!/usr/bin/python2 # Copyright (c) 2010 <NAME> # All rights reserved. # # License: BSD from PyQt4.QtGui import * from PyQt4.QtCore import * from PyQt4.QtSvg import * import os import sys if __name__ == '__main__': import sys import os app_dir ...
2
2
p1379_find_corresponding_node_in_binary_tree_clone.py
hugoleeney/leetcode_problems
0
12779097
""" 1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree Difficulty: medium Given two binary trees original and cloned and given a reference to a node target in the original tree. The cloned tree is a copy of the original tree. Return a reference to the same node in the cloned tree. Note that yo...
3.671875
4
reader.py
build18-fpga-on-the-web/server
2
12779098
import socket import time host = 'localhost' port = 2540 size = 1024 def Open(host, port): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(( host,port)) return s def SendData(conn,IR,data,length): value = bin(data).split('0b')[1].zfill(length) #Convert from int to binary string ...
2.640625
3
collect_tweets.py
yassineAlouini/intro_to_airflow
0
12779099
# Inspired from this: https://www.data-blogger.com/2017/02/24/gathering-tweets-with-python/ import tweepy import json # Specify the account credentials in the following variables: # TODO: Get them from an env varibale or secret file consumer_key = 'INSERT CONSUMER KEY HERE' consumer_secret = 'INSERT CONSUMER SECRET ...
3.453125
3
erec/__init__.py
cajohare/DarkElectronRecoils
0
12779100
__all__ = ["Params","LabFuncs", "AtomicFuncs","HaloFuncs","DMFuncs","NeutrinoFuncs","PlotFuncs"]
1.101563
1
txsecrethandshake/server.py
david415/txsecrethandshake
3
12779101
<reponame>david415/txsecrethandshake import automat import attr import cbor import types import zope from twisted.protocols.basic import Int32StringReceiver from twisted.internet.protocol import Factory from nacl.signing import VerifyKey from envelopes import SecretHandshakeEnvelopeFactory, Curve25519KeyPair, Ed255...
2.34375
2
config.py
namhong1412/Image-Search-Engine-Python-and-Faiss
0
12779102
import psycopg2 HOSTNAME = '192.168.1.204' USERNAME = 'postgres' PASSWORD = '<PASSWORD>' DATABASE_NAME = 'data_lake' PORT = 5432 postgres_connection_string = "postgresql://{DB_USER}:{DB_PASS}@{DB_ADDR}:{PORT}/{DB_NAME}".format( DB_USER=USERNAME, DB_PASS=PASSWORD, DB_ADDR=HOSTNAME, PORT=PORT, DB_NA...
3.15625
3
exercicios/ex031.py
Roberto-Mota/CursoemVideo
0
12779103
<filename>exercicios/ex031.py<gh_stars>0 # Desafio 031 -> Desenvolva um programa que pergunte a distância de uma viagem em Km. # Calcule o preço da passagem do ônibus, cobrando R$0,50 po km para viagens de até 200km # e R$0.45 para viagens mais...
3.921875
4
migrations/versions/567424e5046c_add_fortunki_table.py
landmaj/qbot
3
12779104
"""add fortunki table Revision ID: 567424e5046c Revises: <PASSWORD> Create Date: 2019-09-19 18:59:11.629057 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = "567424e5046c" down_revision = "f32a45256434" branch_labels = None depends_on = None def upgrade(): ...
1.375
1
feedcrawler/ombi.py
rix1337/FeedCrawler
16
12779105
<filename>feedcrawler/ombi.py # -*- coding: utf-8 -*- # FeedCrawler # Projekt von https://github.com/rix1337 import json import requests from imdb import IMDb import feedcrawler.search.shared.content_all import feedcrawler.search.shared.content_shows from feedcrawler import internal from feedcrawler.common import de...
2.59375
3
scripts/030_fastenloc/utils/group_by_phenotype.py
miltondp/phenomexcan
3
12779106
import os import re from glob import glob import pandas as pd # enloc #FILE_SUFFIX = '*.enloc.rst' #FILE_PATTERN = '(?P<pheno>.+)__PM__(?P<tissue>.+)\.enloc\.rst' # fastenloc ALL_TISSUES = pd.read_csv('/mnt/phenomexcan/fastenloc/fastenloc_gtex_tissues.txt', header=None, squeeze=True).tolist() FILE_PREFIX = 'fastenlo...
2.71875
3
scripts/colum.py
OkanoShogo0903/character_estimation
8
12779107
#!/usr/bin/python # -*- coding: utf-8 -*- COLUMNS=[ 'angle-R-mid-0', 'angle-R-mid-1', 'angle-R-mid-2', 'angle-L-mid-0', 'angle-L-mid-1', 'angle-L-mid-2', 'angle-R-top-0', 'angle-R-top-1', 'angle-L-top-0', 'angle-L-top-1', 'angle-R-bot-0', 'angle-R-bot-1', 'angle-R-bot-2', 'angle-L-bot-0', '...
1.953125
2
examples/fantom/rename.py
pkuksa/FILER_giggle
210
12779108
import sys if len(sys.argv) != 4: sys.stderr.write('usage:\t' + \ sys.argv[0] + \ ' <name2library file>' + \ ' <expression count matrix file>' + \ ' <out dir>\n') sys.exit(1) name2library_file=sys.argv[1] expression_count_matr...
2.34375
2
appr/platforms/kubernetes.py
sergeyberezansky/appr
31
12779109
from __future__ import absolute_import, division, print_function import hashlib import json import logging import subprocess import tempfile import time import requests from requests.utils import urlparse __all__ = ['Kubernetes', "get_endpoint"] logger = logging.getLogger(__name__) resource_endpoints = { "daemo...
1.96875
2
open_vsdcli/vsd_enterprise.py
maxiterr/openvsd
9
12779110
from open_vsdcli.vsd_common import * @vsdcli.command(name='enterprise-list') @click.option('--filter', metavar='<filter>', help='Filter for name, description, lastUpdatedDate, ' 'creationDate, externalID') @click.pass_context def enterprise_list(ctx, filter): """Show all enterpris...
2.109375
2
settings.py
nukui-s/sscomdetection
0
12779111
from string import Template const_base = "data/const/degree_order_{}_{}.pkl" #LRF settings N = 500 minc = 100 maxc = 100 mu = 0.3 k = 5 #k = 10 #maxk = 20 maxk = 50 t1 = 2 t2 = 1 name_tmp = Template("LRF_${N}_${k}_${maxk}_${minc}_${maxc}_${mu}") lrf_data_label = name_tmp.substitute(N=N, k=k, maxk=maxk, minc=minc, ma...
1.960938
2
neo/test/rawiotest/test_spike2rawio.py
deeptimittal12/python-neo
1
12779112
<filename>neo/test/rawiotest/test_spike2rawio.py import unittest from neo.rawio.spike2rawio import Spike2RawIO from neo.test.rawiotest.common_rawio_test import BaseTestRawIO class TestSpike2RawIO(BaseTestRawIO, unittest.TestCase, ): rawioclass = Spike2RawIO files_to_download = [ 'File_spike2_1.smr',...
2.25
2
src/merge_sort.py
Darren-Haynes/Data_Structures
0
12779113
"""Implement merge sort algorithm.""" from random import randint, shuffle from timeit import timeit def merge_sort(nums): """Merge list by merge sort.""" half = int(len(nums) // 2) if len(nums) == 1: return nums if len(nums) == 2: if nums[0] > nums[1]: nums[0], nums[1] = ...
4.09375
4
rd_average.py
WyohKnott/image-comparison-sources
4
12779114
#!/usr/bin/python3 # Copyright 2017-2018 <NAME> # # 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 conditions and the followin...
1.546875
2
ext_path/path.py
ruanhailiang/pyutils
0
12779115
import os import shutil def copy_file_path(source_path, target_path): """复制源文件目录下的所有目录到另一个文件目录下""" for e, _, _ in os.walk(source_path): path_name = os.path.splitdrive(e)[1] file_path = os.path.join(target_path, path_name[len(source_path)-1:]) if not os.path.exists(file_path): ...
3.390625
3
calplus/v1/__init__.py
nghiadt16/CALplus
0
12779116
<filename>calplus/v1/__init__.py def public_endpoint(wsgidriver, conf): # Example: # from calplus.v1.network import network # ... # return [ # ('/path', # network.Resource()) # ] return []
1.679688
2
src/tanuki/data_store/index/index.py
M-J-Murray/tanuki
0
12779117
from __future__ import annotations from abc import abstractmethod, abstractproperty from typing import Any, Generic, TYPE_CHECKING, TypeVar, Union import numpy as np if TYPE_CHECKING: from tanuki.data_store.column_alias import ColumnAlias from tanuki.data_store.index.pandas_index import PandasIndex C = Ty...
2.5625
3
tests/clip_ebagoola.py
intrepid-geophysics/intrepid-protobuf-py
1
12779118
#! /usr/bin/env python3 import logging import sys logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, format='%(asctime)s(%(relativeCreated)6d)[%(threadName)s]%(message)s') # example of an airborne survey where some of the flight lines get too close to each other # when gridded, the output contains "tares" th...
2.015625
2
src/server/game_mode.py
Tommimon/cunegonda-online
0
12779119
# si occupa della gestione delle regole e dei dati privati del server from server.global_var import GlobalVar from replicated.game_state import Fase from server.player_private import PlayerPrivate from server.deck import Deck, Card from threading import Timer from tcp_basics import safe_recv_var from socket import tim...
2.4375
2
students/api_view.py
mayankgujrathi/LabExamManager
0
12779120
<filename>students/api_view.py from json import loads from django.http import HttpRequest, JsonResponse from django.views.decorators.http import require_http_methods from .decorators import student_required from .models import StudentTask, StudentTaskImage from admins.models import Task from django.db.utils import Int...
2.671875
3
mysite/spiders/xmlfeed.py
easy-test/template-python
1
12779121
<reponame>easy-test/template-python<filename>mysite/spiders/xmlfeed.py from scrapy.spiders import XMLFeedSpider class XmlfeedSpider(XMLFeedSpider): name = 'xmlfeed' allowed_domains = ['example.com'] start_urls = ['http://example.com/feed.xml'] iterator = 'iternodes' # you can change this; see the docs...
2.671875
3
plots/lasium_paper/plot_accuracy_based_on_gan.py
siavash-khodadadeh/MetaLearning-TF2.0
102
12779122
<gh_stars>100-1000 import cv2 import matplotlib.pyplot as plt from matplotlib.offsetbox import OffsetImage, AnnotationBbox import numpy as np def plot_img(img_name, location, index, zoom=0.1): plt.scatter(index, accs[epochs.index(index)] + 1, color='#0D7377', linewidths=0.5, marker='v') plt.plot((index, locat...
2.03125
2
setup.py
moonbot/shotgun-cache-server
11
12779123
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup import versioneer versioneer.VCS = 'git' versioneer.versionfile_source = 'shotgunCache/_version.py' versioneer.versionfile_build = 'shotgunCache/_version.py' versioneer.tag_pre...
1.546875
2
data.py
bajcmartinez/CarND-Behavioral-Cloning-P3
0
12779124
<reponame>bajcmartinez/CarND-Behavioral-Cloning-P3 import cv2 import pandas as pd import numpy as np import sklearn import matplotlib matplotlib.use('PS') import matplotlib.pyplot as plt class Data: def __init__(self, batch_size=512): """ Initializes the data structure and reads the CSV :p...
2.953125
3
utils.py
byaka/CapybaraMail
0
12779125
<filename>utils.py # -*- coding: utf-8 -*- import sys from importMail import ImportMail_MBox IS_TTY=sys.stdout.isatty() consoleColor={ # predefined colors 'fail':'\x1b[91m', 'ok':'\x1b[92m', 'warning':'\x1b[93m', 'okblue':'\x1b[94m', 'header':'\x1b[95m', # colors 'black':'\x1b[30m', 'red':'...
2.265625
2
make_eval_script.py
dptam/neural_wfst
0
12779126
import os import sys if __name__ == "__main__": train_file = sys.argv[1] dev_file = sys.argv[2] test_folder = sys.argv[3] folder = sys.argv[4] param_file = sys.argv[5] partition = sys.argv[6] bash_script = os.path.join(folder, "parallel_eval_model.sh") with open(bash_script, 'w+') as ...
1.929688
2
python/mlp/centroidal/none.py
daeunSong/multicontact-locomotion-planning
31
12779127
from mlp.utils.requirements import Requirements as CentroidalInputsNone from mlp.utils.requirements import Requirements as CentroidalOutputsNone def generate_centroidal_none(cfg, cs, cs_initGuess=None, fullBody=None, viewer=None, first_iter = True): print("Centroidal trajectory not computed !")
1.820313
2
majority_report/views.py
jdelasoie/majority-report-vue
0
12779128
<gh_stars>0 from django.contrib.auth.models import User from django.shortcuts import render from rest_framework import viewsets def index(request): return render(request, 'index.html')
1.34375
1
data/input_pipeline.py
TropComplique/tracking-by-colorizing
1
12779129
import tensorflow.compat.v1 as tf """ I assume that each file represents a video. All videos have minimal dimension equal to 256 and fps equal to 6. Median video length is ~738 frames. """ NUM_FRAMES = 4 # must be greater or equal to 2 SIZE = 256 # must be less or equal to 256 class Pipeline: def __init__(...
2.765625
3
apps/funcionario/migrations/0011_funcionario_imagem.py
diegocostacmp/gestao_rh
0
12779130
<gh_stars>0 # Generated by Django 2.1.1 on 2020-02-24 14:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("funcionario", "0010_funcionario_de_ferias"), ] operations = [ migrations.AddField( model_name="funcionario", ...
1.367188
1
config/plugins/pbh.py
sg893052/sonic-utilities
0
12779131
""" This CLI plugin was auto-generated by using 'sonic-cli-gen' utility, BUT it was manually modified to meet the PBH HLD requirements. PBH HLD - https://github.com/Azure/SONiC/pull/773 CLI Auto-generation tool HLD - https://github.com/Azure/SONiC/pull/78 """ import click import json import ipaddress import re import...
1.664063
2
PCA_baseline_pipeline.py
GilianPonte/MachineLearning
0
12779132
import sklearn import pandas as pd import seaborn as sns import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import classification_report from sklearn.datasets import load_breast_cancer from sklearn.model_selection import train_test_split from sklearn.datasets import load_breast_cancer from sklearn...
2.734375
3
primeInterval.py
mayanksahu33/HackerEarth-1
0
12779133
""" Find and Print All The Prime Numbers Between L and R (Both L and R Inclusive) """ def SieveOfEratosthenes(low,up): if low == 1: low = 2 prime = [True for i in range(up + 1)] p = 2 while (p * p <= up): if (prime[p] == True): for i in range(p * 2, up + 1, p): ...
3.9375
4
prada_bayes_opt/visualization.py
ntienvu/ICDM2017_FBO
4
12779134
# -*- coding: utf-8 -*- """ Created on Sat Feb 27 23:22:32 2016 @author: Vu """ from __future__ import division import numpy as np #import mayavi.mlab as mlab #from scipy.stats import norm #import matplotlib as plt from mpl_toolkits.mplot3d import Axes3D from prada_bayes_opt import PradaBayOptFn #from p...
1.976563
2
PowerManagementToggle.py
favhwdg/PowerUsageSetBotNvidia
1
12779135
import os from pyautogui import * import pyautogui import time import keyboard import random import win32api, win32con #This program was written in a few hours, its purpose is to set the computer's power usage. # Disclaimer: This is an awful way to do it, even the cmds, a better way would be NViAPI but I d...
3.015625
3
WebMirror/management/rss_parser_funcs/feed_parse_extractKitchennovelCom.py
fake-name/ReadableWebProxy
193
12779136
def extractKitchennovelCom(item): ''' Parser for 'kitchennovel.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('Strange World Alchemist Chef', 'Strange World Alchemist Chef'...
2.34375
2
QuickDemos/TabsVSpaces.py
dannystiv/CMPT-120L-201-22S
1
12779137
if true: if False: if True: print("Wooo")
2.359375
2
stonklib.py
jebjoya/jebstonks
0
12779138
<gh_stars>0 import os import requests import datetime from datetime import date import pandas as pd from requests.api import options import yfinance as yf import numpy as np def skipDate(d, weekends): if weekends and d.weekday() in [5,6]: return True if d in [date(2021,1,1),date(2021,1,18),date(2021,2,...
2.96875
3
wazimap_ng/datasets/models/geography.py
BarisSari/wazimap-ng
0
12779139
<reponame>BarisSari/wazimap-ng<gh_stars>0 from django.db import models from django.contrib.postgres.indexes import GinIndex from treebeard.mp_tree import MP_Node from treebeard.ns_tree import NS_NodeManager, NS_NodeQuerySet from django.contrib.postgres.indexes import GinIndex from django.contrib.postgres.search impor...
2.3125
2
src/fetch_job_schedule.py
aws-samples/aws-iot-ota-deployment-tool
28
12779140
import boto3 import datetime import argparse import logging import sys from aws_interfaces.s3_interface import S3Interface from boto3.dynamodb.conditions import Key, Attr parser = argparse.ArgumentParser() parser.add_argument("-r", "--region", action="store", required=True, dest="region", help="the region for uploadi...
1.9375
2
curie/null_oob_util.py
mike0615/curie
4
12779141
# # Copyright (c) 2016 Nutanix Inc. All rights reserved. # """ Provides stub Out-of-Band management util for cases with no OoB support. """ from curie.curie_error_pb2 import CurieError from curie.exception import CurieException from curie.oob_management_util import OobInterfaceType from curie.oob_management_util impor...
1.851563
2
servicesCalculator.py
LincT/PythonExamples
0
12779142
<filename>servicesCalculator.py # GUI with checkboxes for itemized service charges. # gives total when button clicked. # procedural generation to reduce code and generate menu. # update values in self.services dictionary to add/update/remove services. import tkinter __author__ = 'LincT, https://github.com/LincT/Python...
3.21875
3
Tensorflow_InAction_Google/code/005/tensorflow/001.mnist_input_data_train_validation_test.py
lsieun/learn-AI
1
12779143
<reponame>lsieun/learn-AI from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets(train_dir="./path/to/MNIST_data/",one_hot=True) print("Training data size: ", mnist.train.num_examples) print("Validating data size: ", mnist.validation.num_examples) print("Testing data size: ", mni...
3.3125
3
syncstream/mproc.py
cainmagi/sync-stream
0
12779144
#!python # -*- coding: UTF-8 -*- ''' ################################################################ # Multiprocessing based synchronization. # @ Sync-stream # Produced by # <NAME> @ <EMAIL>, # <EMAIL>. # Requirements: (Pay attention to version) # python 3.6+ # The base module for the message synchroniz...
2.859375
3
quantum/tests/unit/_test_extension_portbindings.py
cuiwow/quantum
1
12779145
<reponame>cuiwow/quantum<filename>quantum/tests/unit/_test_extension_portbindings.py # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 NEC Corporation # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the Li...
2.234375
2
opennem/core/parsers/aemo/facility_closures.py
paulculmsee/opennem
22
12779146
""" OpenNEM AEMO facility closure dates parser. """ import logging from datetime import datetime from pathlib import Path from typing import List, Optional, Union from openpyxl import load_workbook from pydantic import ValidationError from pydantic.class_validators import validator from opennem.core.normalizers imp...
2.546875
3
tests/asp/cautious/test14.bug.multiaggregates.gringo.cautious.asp.test.py
bernardocuteri/wasp
19
12779147
<reponame>bernardocuteri/wasp input = """ 8 2 2 3 0 0 8 2 4 5 0 0 2 6 4 0 3 5 4 3 2 2 7 4 0 2 5 4 3 2 1 8 2 1 6 7 0 8 ok 2 a(1) 3 a(2) 4 a(3) 5 a(4) 6 aggrGT3 7 aggrGT2 0 B+ 0 B- 1 0 1 """ output = """ {aggrGT2, ok} """
1.945313
2
camnet/environment.py
rccrdo/python-camera-net
1
12779148
<reponame>rccrdo/python-camera-net # Copyright (c) 2013 <NAME>, <EMAIL>.lucchese at gmail.com # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. # # Permission is granted to anyone to use ...
2.34375
2
src/mail.py
ccrsxx/autobsi
6
12779149
import os import ssl import smtplib from typing import Callable from email.mime.text import MIMEText from email.mime.image import MIMEImage from email.mime.multipart import MIMEMultipart def send_mail(subject: str, log_path: str, img_path: str, get: Callable): sender = get('email') api_key = get('api_key') ...
2.640625
3
src/mybot_pkg/scripts/line_follower_sim.py
leytpapas/thesis_project
0
12779150
<filename>src/mybot_pkg/scripts/line_follower_sim.py #!/usr/bin/env python import rospy import cv2 import numpy as np from cv_bridge import CvBridge, CvBridgeError from geometry_msgs.msg import Twist from sensor_msgs.msg import Image from rgb_hsv import BGR_HSV class LineFollower(object): def __init__(self, rgb_t...
2.546875
3