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 |
|---|---|---|---|---|---|---|
enEngine.py | keshava/kampa | 1 | 54000 | <reponame>keshava/kampa
# -*- coding: utf-8 -*-
"""
Copyright 2016 <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 License at
httpwww.apache.orglicensesLICENSE-2.0
Unless... | 1.695313 | 2 |
setup.py | biocompibens/annotaread | 12 | 54001 | <reponame>biocompibens/annotaread<gh_stars>10-100
#!/usr/bin/env python
from distutils.core import setup
setup(name = "alfa",
py_modules = ["alfa"],
version = "1.1.1",
description = "A simple software to get a quick overview of features composing NGS dataset(s).",
author = "<NAME>",
auth... | 1.5 | 2 |
python/rational-numbers/rational_numbers.py | sci-c0/exercism-learning | 0 | 54002 | from __future__ import division
class Rational:
def __init__(self, numer, denom):
assert denom != 0, "ValueError: The denominator of the Rational Number cannot be 0"
gcd = self._gcd(abs(numer), abs(denom))
numer = numer // gcd
denom = denom // gcd
numer_sign = numer // ab... | 3.234375 | 3 |
test/test_gradcam_guided_backprop.py | giladcohen/darkon | 254 | 54003 | # Copyright 2017 Neosapience, Inc.
#
# 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 wri... | 2.390625 | 2 |
repyt/repyt.py | di/repyt | 4 | 54004 | import os
import pwd
import sys
import argparse
import subprocess
try:
# Location of run_with_reloader in the latest version of Werkzeug
from werkzeug._reloader import run_with_reloader
except ImportError:
# Old location of run_with_reloader
from werkzeug.serving import run_with_reloader
def get_comm... | 2.40625 | 2 |
core/yasg_auto_schema.py | HiroshiFuu/django-rest-drf-yasg-boilerplate | 0 | 54005 | <gh_stars>0
from drf_yasg.inspectors import SwaggerAutoSchema
from drf_yasg.utils import swagger_settings
from core.yasg_inspector import ExampleSerializerInspector
class NameAsOperationIDAutoSchema(SwaggerAutoSchema):
def get_operation_id(self, operation_keys):
operation_id = super(NameAsOperationIDAuto... | 1.859375 | 2 |
utils.py | priyavrat-misra/cifar10 | 2 | 54006 | import torch
from collections import namedtuple
from itertools import product
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
def get_num_correct(preds, labels):
"""
calculates the number of correct predictions.
Args:
preds: the predictions tensor with shape (batch_size, ... | 2.828125 | 3 |
microfreshener/core/importer/jsontype.py | di-unipi-socc/micro-tosca | 0 | 54007 | <reponame>di-unipi-socc/micro-tosca
# Relationship instance name
JSON_RELATIONSHIP_INTERACT_WITH = "interaction"
JSON_RUN_TIME = "runtime"
JSON_DEPLOYMENT_TIME = "deploymenttime"
JSON_NODE_DATABASE = "datastore"
JSON_NODE_SERVICE= "service"
JSON_NODE_MESSAGE_BROKER = "messagebroker"
JSON_NODE_MESSAGE_ROUTER = "messag... | 1.273438 | 1 |
api/message/__init__.py | fhzhang/staticwebA | 0 | 54008 | <reponame>fhzhang/staticwebA
import logging
import requests
import json
import azure.functions as func
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
res = requests.get("https://61n.azurewebsites.net/get")
return func.HttpResponse... | 2.53125 | 3 |
process_folder.py | WilliamCSA04/sigver_wiwd | 0 | 54009 | <reponame>WilliamCSA04/sigver_wiwd
""" This example extract features for all signatures in a folder,
using the CNN trained on the GPDS dataset. Results are saved in a matlab
format.
Usage: python process_folder.py <signatures_path> <save_path>
<model_path> [canvas_size]
... | 2.828125 | 3 |
prometheus_aioredis_client/task_manager.py | belousovalex/prometheus_aioredis_client | 3 | 54010 | import asyncio
import logging
logger = logging.getLogger(__name__)
class TaskManager(object):
"""
Manage all running tasks and refresh gauge values.
"""
def __init__(self, refresh_period=30, refresh_enable=True, loop=None):
self._loop = loop or asyncio.get_event_loop()
self.tasks = [... | 2.578125 | 3 |
globa_micrograph2np.py | bioinsilico/EM_FILTER | 0 | 54011 | import numpy as np
import sys
def micrograph2np(width,shift):
r = int(width/shift-1)
#I = np.load("../DATA_SETS/004773_ProtRelionRefine3D/kino.micrograph.numpy.npy")
I = np.load("../DATA_SETS/004773_ProtRelionRefine3D/full_micrograph.stack_0001.numpy.npy")
I = (I-I.mean())/I.std()
N = int(I.shape[0]/sh... | 2.890625 | 3 |
otpparser.py | barsnadcat/otpparser | 0 | 54012 | # python3
import re
report = open("финансы 31.10.2017 по 20.11.2017", 'r')
lines = report.readlines()
foundHeader = False
cardName = ""
operationDateTime = ""
for line in lines:
if not foundHeader:
if line.find('Фінансові трансакції за рахунком') != -1:
foundHeader = True
else:
if line.find('Блокування по к... | 2.890625 | 3 |
inference.py | MuhammadHadiofficial/DECAPS | 1 | 54013 | import os
import warnings
import torch.backends.cudnn as cudnn
warnings.filterwarnings("ignore")
from torch.utils.data import DataLoader
from decaps import CapsuleNet
from torch.optim import Adam
import numpy as np
from config import options
import torch
import torch.nn.functional as F
from utils.eval_utils import bina... | 1.921875 | 2 |
setup.py | Personal-Assistant-Project/ProjectHelper | 2 | 54014 | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(name='personal_assistant',
version='0.0.1',
author='<NAME>, <NAME>, <NAME>',
author_email='<EMAIL>, <EMAIL>, <EMAIL>',
d... | 1.40625 | 1 |
examples/int/ex3.py | mcorne/python-by-example | 0 | 54015 | <reponame>mcorne/python-by-example<filename>examples/int/ex3.py
print(int('ffff', 16))
| 1.484375 | 1 |
python/get_dinucleotides.py | kadepettie/mike_tools | 2 | 54016 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Take a list of genome positions and return the dinucleotides around it.
For each position, will generate a list of + strand dinucleotides and - strand
dinucleotides.
Created: 2017-07-27 12:02
Last modified: 2017-10-18 00:17
"""
from __future__ import print_fun... | 3.078125 | 3 |
test/props.py | roks/snap-python | 0 | 54017 | <filename>test/props.py
import snap
G9 = snap.GenRndGnm(snap.PNGraph, 10000, 1000)
CntV = snap.TIntPrV()
snap.GetWccSzCnt(G9, CntV)
for p in CntV:
print "size %d: count %d" % (p.GetVal1(), p.GetVal2())
snap.GetOutDegCnt(G9, CntV)
for p in CntV:
print "degree %d: count %d" % (p.GetVal1(), p.GetVal2())
G10 = ... | 1.90625 | 2 |
harp2/make_kmeans/make_input_controller.py | canesche/kmeans | 0 | 54018 | from veriloggen import *
# Component that receives the input buffer BEGIN
def make_input_controller(external_data_width):
m = Module('input_controller')
# sinais básicos para o funcionamento do circuito
clk = m.Input('clk')
rst = m.Input('rst')
start = m.Input('start')
done_rd_data... | 2.96875 | 3 |
cannula/helpers.py | rmyers/cannula | 9 | 54019 | <filename>cannula/helpers.py
import os
import pkgutil
import sys
def get_root_path(import_name):
"""Returns the path to a package or cwd if that cannot be found.
Inspired by [flask](https://github.com/pallets/flask/blob/master/flask/helpers.py)
"""
# Module already imported and has a file attribute. ... | 2.875 | 3 |
tests/core/test_injection.py | keelerm84/antidote | 0 | 54020 | <reponame>keelerm84/antidote<gh_stars>0
import typing
import pytest
from antidote._internal.argspec import Arguments
from antidote.core import DependencyContainer, inject
from antidote.exceptions import DependencyNotFoundError
class Service:
pass
class AnotherService:
pass
@pytest.mark.parametrize(
... | 2.40625 | 2 |
advent2020/day11.py | askrepps/advent-of-code-2020 | 0 | 54021 | <filename>advent2020/day11.py<gh_stars>0
# MIT License
#
# Copyright (c) 2020 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the ri... | 2.40625 | 2 |
reports/brokers/databridge/scanner.py | ITVaan/reports.brokers.bridge | 0 | 54022 | # -*- coding: utf-8 -*-
from gevent import monkey, sleep, spawn
monkey.patch_all()
import logging.config
from datetime import datetime
from gevent.event import Event
from restkit import ResourceError
from retrying import retry
from reports.brokers.databridge.base_worker import BaseWorker
from reports.brokers.databr... | 1.6875 | 2 |
zufall/lib/funktionen/funktionen.py | HBOMAT/AglaUndZufall | 0 | 54023 | <reponame>HBOMAT/AglaUndZufall
#!/usr/bin/python
# -*- coding utf-8 -*-
#
# zufall - Funktionen
#
#
# This file is part of zu... | 1.742188 | 2 |
setup.py | patrickleweryharris/pintools | 10 | 54024 | <gh_stars>1-10
import re
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
version = re.search('^__version__ *= *"(.*)"',
open('pintools/pintools.py').read(), re.M).group(1)
setuptools.setup(
name="pintools",
version=version,
author="<NAME>",
de... | 1.539063 | 2 |
tarea_78/aprende a programar/animacion.py | zumaia/theEgg | 0 | 54025 | <filename>tarea_78/aprende a programar/animacion.py<gh_stars>0
import pygame, sys, time
from pygame.locals import *
# Establece pygame
pygame.init()
# Establece la ventana
ANCHOVENTANA = 400
ALTOVENTANA = 400
windowSurface = pygame.display.set_mode((ANCHOVENTANA, ALTOVENTANA), 0, 32)
pygame.display.set_capt... | 2.78125 | 3 |
src/v2/core/server.py | Strangemother/project-conceptnet-graphing | 0 | 54026 | """Using flask to expose the main entry point as it makes it easier to
expose an input thread.
Individual threads will boot manually or attached through manual setup
"""
from multiprocessing import Process, Queue
import flask
from flask import Flask
from core.run import run_core, thread_run
from log import lo... | 3.1875 | 3 |
python/art/sorter.py | DoumanAsh/collectionScripts | 7 | 54027 | """ Sorting algorithms """
def insert_sort(list_num):
""" Insertion sort
Start from second element
Save it alongside with it's index
Run from previous element to first one
While checking if value should be moved
In the end, put saved value after last moved index
... | 4.09375 | 4 |
src/hogpylib/__main__.py | shubhamwagh/HOG_python | 0 | 54028 | import sys
from skimage import color, data
import matplotlib.pyplot as plt
from hogpylib.hog import HistogramOfGradients
def main(args=None):
from skimage.feature import hog
PIXELS_PER_CELL = (8, 8)
CELLS_PER_BLOCK = (2, 2)
NUMBER_OF_BINS = ORIENTATIONS = 9 # NUMBER_OF_BINS
VISUALISE = True
... | 2.78125 | 3 |
core_python/tkinter/pfagui.py | caoghui/python | 0 | 54029 | <gh_stars>0
#!/usr/bin/env python
from functools import partial as pto
from tkinter import Tk, Button, X
#from tkMessageBox import showinfo, showwarning, showerror
from tkinter.messagebox import showinfo, showwarning, showerror
WARN = 'warn'
CRIT = 'crit'
REGU = 'regu'
SIGNS = {
'do not enter': CRIT,
'rai... | 2.703125 | 3 |
trajminer/tests/test_segmentation.py | ybj94/trajminer | 37 | 54030 | from trajminer import TrajectoryData
from trajminer.preprocessing import TrajectorySegmenter
data = TrajectoryData(attributes=['poi', 'hour', 'rating'],
data=[[['Bakery', 8, 8.6], ['Work', 9, 8.9],
['Restaurant', 12, 7.7], ['Bank', 12, 5.6],
... | 2.421875 | 2 |
app/forms.py | yahuishuo/alpha-flask | 0 | 54031 | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField, ValidationError
from wtforms.validators import DataRequired, Length, Email, Regexp, EqualTo, URL, Optional
from models.profile import User
class LoginForm(FlaskForm):
username = StringField()
password =... | 2.984375 | 3 |
setup.py | DavideAlwaysMe/link-shortcut | 1 | 54032 | <reponame>DavideAlwaysMe/link-shortcut
import os
from setuptools import setup
setup(
name = "link",
version = "0.1",
author = "<NAME>",
author_email = "<EMAIL>",
license = "MIT",
url = "https://github.com/DavideAlwaysMe/link-shortcut",
packages=['link'],
scripts = ['link/link.py'],
... | 1.4375 | 1 |
OBSFTP/obsadapter/ObjectOperationMore.py | huaweicloud-obs/obsftp | 8 | 54033 | # -*- coding: utf-8 -*-
import obs
import os,sys,time,datetime
import logging
class _ListAll(object):
def __init__(self, marker=''):
self.marker = marker
self.is_Truncated = True
self.entity = []
def _listresult(self):
raise NotImplemented
def __iter__(self):
re... | 2.46875 | 2 |
docs/examples/Classifying_Using_HMM.py | io8ex/Stone-Soup | 0 | 54034 | #!/usr/bin/env python
# coding: utf-8
"""
Classification Using Hidden Markov Model
========================================
This is a demonstration using the implemented Hidden Markov model to classify multiple targets.
We will attempt to classify 3 targets in an undefined region.
Our sensor will be all-seeing, and p... | 4.125 | 4 |
py/main.py | HGARgG-0710/pycalc | 1 | 54035 | from resources import analyze_str, calculate, CommandHandler, History
from os import system, path, chdir
if __name__ == '__main__':
# * Lately thought of system for auto-updating pycalc :)
print("Checking for possible updates...")
chdir(f"{path.dirname(path.dirname(__file__))}")
system("git pull")
... | 3.109375 | 3 |
aoc-2021/day5.py | flanggut/advent-of-code | 0 | 54036 | <gh_stars>0
import aoc
import numpy as np
def drawlinetogrid(grid, begin, end):
diff = end - begin
numpoints = np.max(np.abs(diff))
if numpoints == 0:
return
diff = diff / numpoints
for i in range(0, numpoints + 1):
coord = (begin + i * diff).astype(int)
grid[coord[0], coor... | 3.46875 | 3 |
airdialogue/prepro/standardize_data_lib.py | josephch405/airdialogue | 0 | 54037 | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 2.6875 | 3 |
python/learn_visualization.py | tingjianlau/Caffe-commons | 0 | 54038 | import numpy as np
import matplotlib.pyplot as plt
#%matplotlib inline
import caffe
caffe_root= '../'
import os,sys
os.chdir(caffe_root)
sys.path.insert(0,caffe_root+'python')
sys.path.append('usr/local/lib/python2.7/site-packages/')
im = caffe.io.load_image('examples/images/cat.jpg')
print im.shape
plt.imshow(im)
plt.... | 2.40625 | 2 |
pesto/backend/celery/tasks.py | saromanov/pesto | 0 | 54039 | import datetime
from .celery import celery
from backend.news import hot_topics
from backend.cache import sadd
from backend.utils import time_now_formatted
@celery.task(bind=True)
def store_hot_topics(a):
sadd(time_now_formatted('PESTO_SYSTEM_HOT_TOPICS'), hot_topics()) | 1.945313 | 2 |
actions/migrations/0002_auto_20200907_1450.py | khicks01/assistant-bot-kyle | 0 | 54040 | # Generated by Django 3.1.1 on 2020-09-07 19:50
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('actions', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='slackpost',
name='time_stamp',
),
... | 1.484375 | 1 |
practical/plot_output.py | peterukk/ecrad | 20 | 54041 | <reponame>peterukk/ecrad
#!/usr/bin/env python3
def warn(*args, **kwargs):
pass
import os, warnings
warnings.warn = warn
from ecradplot import plot as eplt
def main(input_srcfile, output_srcfile, dstdir):
"""
Plot radiation fields (fluxes, CRE, and heating rates)
"""
import os
if n... | 2.78125 | 3 |
survivethevoid/characters/_base_character.py | LMikeH/SurviveTheVoid | 0 | 54042 | <gh_stars>0
import pygame
class _BaseCharacter(pygame.sprite.Sprite):
def __init__(self, screen, x, y, angle):
self.x = x
self.y = y
self.theta = angle
self.screen = screen | 3 | 3 |
car.py | Pscodium/python-gas-economy-project | 0 | 54043 | kilometer = float(input('Digite quantos KM você irá percorrer: '))
price_gas = float(input('Digite o preço da gasolina na sua região: R$'))
cars_consumption = [5, 6, 7, 8, 9, 10, 11, 12, 13]
for i in range(9):
total = (kilometer/cars_consumption[i])*price_gas
print(f'Se seu carro tem a autonomia de {cars_con... | 3.78125 | 4 |
setup.py | JustBennnn/minecraftstats | 2 | 54044 | from setuptools import setup
setup(
name="minecraftstats",
version="1.1.6",
author="JustBen",
author_email="<EMAIL>",
description="A python library allowing the user to get stats from Hypixel in Minecraft.",
keywords="minecraft api-wrapper mojang mojang-api".split(),
python_requires=">=3.7"... | 1.453125 | 1 |
openmoltools/tests/test_schrodinger.py | ajsilveira/openmoltools | 47 | 54045 | #!/usr/bin/env python
"""Test functions in openmoltools.schrodinger."""
import unittest
from openmoltools.schrodinger import *
@unittest.skipIf(not is_schrodinger_suite_installed(), "This test requires Schrodinger's suite")
def test_structconvert():
"""Test run_structconvert() function."""
benzene_path = u... | 2.59375 | 3 |
haweb/libs/drf/api_views.py | edilio/tobeawebproperty | 0 | 54046 | <filename>haweb/libs/drf/api_views.py
from __future__ import unicode_literals
import warnings
from django.http import Http404
from django.conf import settings
from rest_framework import viewsets, mixins, status, serializers
from rest_framework.response import Response
from .error_responses import ErrorResponse
DE... | 2.140625 | 2 |
chapt1/1_6_2_plot.py | KTD-prototype/DLfromZERO | 0 | 54047 | <reponame>KTD-prototype/DLfromZERO
import numpy as np
import matplotlib.pyplot as plt
# prepare data
x = np.arange(0, 6, 0.1) # prepare data from 0 to 6 at resolution:0.1
y1 = np.sin(x)
y2 = np.cos(x)
# plot a graph
plt.plot(x, y1, label="sin")
plt.plot(x, y2, linestyle="--", label="cos") # plot at broken line
plt.... | 3.265625 | 3 |
tools/one-offs/content-analysis.py | DrDos0016/z2 | 3 | 54048 | import os
import sys
import zipfile
import django
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings")
django.setup()
from museum_site.models import * # noqa: E402
from museum_site.constants import * # noqa: E402
def main(... | 2.296875 | 2 |
tensor2tensor/models/multimodel.py | winnerineast/tensor2tensor | 0 | 54049 | <gh_stars>0
# Copyright 2017 Google Inc.
#
# 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 ... | 1.726563 | 2 |
controllers/itemcontrollers/strand/stranditemcontroller.py | dongniu/cadnano2 | 17 | 54050 | <gh_stars>10-100
# The MIT License
#
# Copyright (c) 2011 Wyss Institute at Harvard University
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitat... | 1.679688 | 2 |
pynadjust/pynadjust_classes.py | tengkunuddin/PynAdjust | 7 | 54051 | # pynadjust module for classes used across adj, apu and xyz files
import geodepy.convert as gc
class Station(object):
def __init__(self, name=None, description=None, con=None, lat=None, lon=None, ohgt=None, ehgt=None,
sd_e=None, sd_n=None, sd_u=None, hpu=None, vpu=None, smaj=None, smin=None, brg... | 2.46875 | 2 |
webscrape.py | rendlny/YokaidexWebscraper | 0 | 54052 | import urllib.request
from bs4 import BeautifulSoup
from assets import data
from assets import functions
from models.BaffleBoard import BaffleBoard
page = functions.scrape_url(data.WEB_LINK)
tableHead = page.find('span', {"id": "Yo-kai_Watch_3"})
table = tableHead.find_parent().find_next_sibling()
tableRows = table.f... | 2.703125 | 3 |
03_SweynTooth/libs/scapy/contrib/automotive/gm/gmlanutils.py | Charmve/BLE-Security-Att-Def | 149 | 54053 | #! /usr/bin/env python
# This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) <NAME> <<EMAIL>>
# Copyright (C) <NAME> <<EMAIL>>
# This program is published under a GPLv2 license
# scapy.contrib.description = GMLAN Utilities
# scapy.contrib.status = loads
import t... | 2.390625 | 2 |
fnfi/cluster.py | kcleal/fnfi | 3 | 54054 | <filename>fnfi/cluster.py<gh_stars>1-10
from __future__ import absolute_import
import datetime
import itertools
import os
import multiprocessing
import time
import numpy as np
import random
from collections import defaultdict
import click
import networkx as nx
import pysam
import sys
import pickle
from . import graph_f... | 2.390625 | 2 |
12_Intermediate Data Visualization with Seaborn/03_Additional Plot Types/06_Binning data.py | mohd-faizy/DataScience-With-Python | 5 | 54055 | '''
06 - Binning data
When the data on the x axis is a continuous value, it can
be useful to break it into different bins in order to get
a better visualization of the changes in the data.
For this exercise, we will look at the relationship between
tuition and the Undergraduate population abbreviated as UG in ... | 3.890625 | 4 |
genesis/objects/to_mask.py | leifdenby/uclales-extractor | 2 | 54056 | """
Create a 3D mask from labelled objects
"""
import os
import xarray as xr
def create_mask_from_objects(objects):
return objects != 0
if __name__ == "__main__":
import argparse
argparser = argparse.ArgumentParser(description=__doc__)
argparser.add_argument("object_file", type=str)
args = a... | 2.875 | 3 |
app/main/views.py | Calebu6214/Get-newsapi | 0 | 54057 | from app.article import Articles
from flask import render_template,request,redirect,url_for
from . import main
from ..request import get_article,get_news
from app.request import search_article
# Views
@main.route('/')
def index():
'''
View root page function that returns the index page and its data
'''
... | 2.96875 | 3 |
tests/test_check_files_checksums_logging.py | adisbladis/geostore | 25 | 54058 | <reponame>adisbladis/geostore<filename>tests/test_check_files_checksums_logging.py
import sys
from os import environ
from unittest.mock import patch
from pynamodb.exceptions import DoesNotExist
from pytest import mark, raises
from pytest_subtests import SubTests
from geostore.api_keys import MESSAGE_KEY
from geostore... | 1.742188 | 2 |
src/dbconnector/dbconnector.py | dubovyk/Quoterly | 0 | 54059 | import sqlite3
import time
class sqliteConnector:
def __init__(self, dbpath):
self.__dbpath = dbpath
self.__connection = sqlite3.connect(self.__dbpath) # initialize 'connection' (actually, open file)
self.__cursor = self.__connection.cursor()
def add_user(self, username, usermail, us... | 3.515625 | 4 |
tests/components/sensibo/test_button.py | mib1185/core | 0 | 54060 | <filename>tests/components/sensibo/test_button.py
"""The test for the sensibo button platform."""
from __future__ import annotations
from datetime import datetime, timedelta
from unittest.mock import patch
from freezegun.api import FrozenDateTimeFactory
from pysensibo.model import SensiboData
from pytest import Monke... | 2.28125 | 2 |
tests/test_integration/test_pytfa.py | ginkgobioworks/geckopy | 5 | 54061 | <gh_stars>1-10
# Copyright 2021 <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 License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wr... | 1.96875 | 2 |
ex3.py | joao-barabba/Exercicios_Python | 0 | 54062 | <filename>ex3.py
#Escreva um programa que calcule o preço a pagar pela energia elétrica.
#Pergunte a quantidadeconsumida em KWH e o tipo de instalação residencial (R) ou (C) para comercial. Calcule preço pela tabela.
#Residencial <=500 KWh R$0,8 >500 R$0,95
#Comercial <=1000 KWh R$1,10 >1000 R$1,30
instalacao=inp... | 4.0625 | 4 |
final/160401069/sunucu.py | hasan-se/blm304 | 1 | 54063 | <filename>final/160401069/sunucu.py<gh_stars>1-10
#<NAME> - 160401069
import socket
import sys
import datetime
import pickle
host = "127.0.0.1"
port = 142
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((host, port))
print("Baglama Basarili")
except :
print("Baglanti hata... | 2.265625 | 2 |
ovos_utils/lang/phonemes.py | NeonJarbas/ovos_utils | 5 | 54064 | <filename>ovos_utils/lang/phonemes.py
try:
from phoneme_guesser import guess_phonemes as _guess_phonemes, \
get_phonemes as _get_phonemes
def guess_phonemes(word, lang="en-us"):
return _guess_phonemes(word, lang)
def get_phonemes(name, lang="en-us"):
return _get_phonemes(name, la... | 2.484375 | 2 |
src/frontend/frontend.py | SmBe19/Todoistant | 0 | 54065 | #!/usr/bin/env python3
import base64
import os
import sys
import datetime
import dotenv
import requests
from flask import Flask, render_template, session, redirect, url_for, request, flash
sys.path.append(os.path.abspath('src'))
from utils import utc_to_local
from client import Client
import runner
os.chdir(os.pat... | 2.125 | 2 |
clb_nb_utils/oauth.py | HumanBrainProject/clb-nb-utils | 1 | 54066 | <filename>clb_nb_utils/oauth.py
'''This module gets fresh access tokens from the Jupyterhub Service to refresh access tokens.
See https://github.com/HumanBrainProject/jupyterhub-access-token-service
'''
import os
import requests
JUPYTERHUB_API_TOKEN = os.getenv("JUPYTERHUB_API_TOKEN")
# @TODO fix this
JUPYTERHUB_SE... | 2.328125 | 2 |
DSA Learning Series/Easy Problems to Get Started/Factors Finding (DIFACTRS)/factors_finding.py | Ekalaivanpj/codechef | 4 | 54067 | <reponame>Ekalaivanpj/codechef
N = int(input())
c=1
res=[]
for i in range (1,int((N+2)/2)):
if N%i == 0:
res.append(i)
c+=1
res.append(N)
print(c)
print(*res)
| 3.453125 | 3 |
blockchain/server.py | mattmacari/opug-blockchain | 0 | 54068 | from flask import Flask, jsonify, request
from blockchain.chain import BlockChain
from argparse import ArgumentParser
app = Flask(__name__)
blockchain = BlockChain()
@app.route('/chain', methods=['GET'])
def get_chain():
result = {
'id': blockchain.chain_id,
'chain': [blk.to_json() for blk in ... | 2.828125 | 3 |
rc_velo_vol.py | VincentCheungM/rc_velo_volt | 0 | 54069 | #! *-* coding: utf-8 *-*
#!/usr/bin/env python
"""
A simple scraper for recording the power supply of velodyne LiDAR,
by getting the `diag.json` files.
@author <NAME>
@file rc_velo_vol.py
"""
import argparse
import math
import time
import requests
import json
import logging
import os
from volt_temp import Volt_temp
... | 3.1875 | 3 |
library_monitor/monitor.py | Berailitz/library_monitor | 1 | 54070 | <reponame>Berailitz/library_monitor
"""Monitor book state in BUPT's library, send notice if available."""
import json
import logging
from typing import List, Dict
import requests
from .config import BOOK_PAGE_REFERER, BOOK_STATE_API, DAILY_REPORT_TEMPLATE, MESSAGE_TEMPLATE, NOTICE_COUNTER, TARGET_STATE
from .models im... | 2.359375 | 2 |
adaptive/tests/utils.py | RobertArbon/adaptive | 0 | 54071 | <reponame>RobertArbon/adaptive<filename>adaptive/tests/utils.py
from typing import Optional
from scipy.stats import ttest_1samp
import numpy as np
def is_equivalent(sample: np.ndarray, target: float, window: float, alpha: Optional[float] = 0.05) -> bool:
# https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5502906/
... | 2.203125 | 2 |
qcportal/manager_client.py | bennybp/QCPortal | 0 | 54072 | <gh_stars>0
from typing import Optional, List, Dict, Any
from .client_base import PortalClientBase
from .managers import (
ManagerName,
ManagerActivationBody,
ManagerUpdateBody,
ManagerStatusEnum,
)
from .metadata_models import TaskReturnMetadata
from .records import AllResultTypes
from .tasks import T... | 2.078125 | 2 |
src/modules/encoder.py | facebookresearch/image-to-set | 20 | 54073 | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from torchvision.models import resnet50, resnet101, resnext101_32x8d
import torch
import torch.nn as nn
import random
import numpy as np
clas... | 2.3125 | 2 |
setup.py | sandipan1/rl_dobot | 2 | 54074 | from setuptools import setup
setup(name='rl_dobot',
version='0.1',
) | 0.898438 | 1 |
controllers/disease.py | rommelsotto/eden | 27 | 54075 | # -*- coding: utf-8 -*-
"""
Disease Case Tracking and Contact Tracing
"""
module = request.controller
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
# -----------------------------------------------------------------------------
def index():
"Module's Home Page"... | 1.992188 | 2 |
src/compas_vibro/structure/_old_vibro_structure.py | Design-Machine-Group/compas_vibro | 2 | 54076 | <gh_stars>1-10
import json
import math
from ast import literal_eval
import numpy as np
from compas_vibro.datastructures import VibroMesh
from compas_vibro.vibro import calculate_radiation_matrix_np
from compas_vibro.vibro import calculate_pressure_np
from compas_vibro.vibro import calculate_rayleigh_rad_power_np
fr... | 1.710938 | 2 |
django_cradmin/templatetags/cradmin_icon_tags.py | appressoas/django_cradmin | 11 | 54077 | from django import template
import logging
from django.conf import settings
from django.template.defaultfilters import stringfilter
from django_cradmin import css_icon_map
register = template.Library()
log = logging.getLogger(__name__)
@register.simple_tag
@stringfilter
def cradmin_icon(iconkey):
"""
Retu... | 2.078125 | 2 |
Darlington/phase1/python Basic 1/day 3 solution/qtn10.py | CodedLadiesInnovateTech/-python-challenge-solutions | 6 | 54078 | <filename>Darlington/phase1/python Basic 1/day 3 solution/qtn10.py
#program to get string which is n
word = input('Enter numbers \n')
texts = list(word)
print(f'{texts}')
numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
integer = ""
for i in texts:
if i in numbers:
integer += i
print(integer)
| 4.15625 | 4 |
rs_datasets/youchoose.py | inpefess/rs_datasets | 20 | 54079 | from os.path import join, exists
import datatable as dt
from rs_datasets.data_loader import download_dataset
from rs_datasets.generic_dataset import Dataset, safe
class YooChoose(Dataset):
def __init__(self, path: str = None):
"""
:param path: folder which is used to download dataset to
... | 2.734375 | 3 |
svm_smo.py | shubhamkriitr/SVM-USING-SMO | 0 | 54080 | <reponame>shubhamkriitr/SVM-USING-SMO
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 18 22:43:13 2018
@author: shubham
"""
import numpy as np
import matplotlib.pyplot as plt
# tolerance
TOL = 0.0001
def linear_kernel (x1, x2):
return np.dot(x1,x2)
def quad_pol_kernel(x1, x2):
c = np.d... | 2.75 | 3 |
efficientnet/initializers.py | krikru/efficientnet | 0 | 54081 | <reponame>krikru/efficientnet
# Copyright 2019 The TensorFlow Authors, <NAME>. 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/LICE... | 3.125 | 3 |
card_games/games/ers.py | parul-l/Card-Games | 0 | 54082 | from ..cards import Card, Deck
from scipy.stats import bernoulli
from random import randint, shuffle
class Pile(object) :
def __init__(self):
self.cards = []
self.owner = None
def __getitem__(self, index):
if index < len(self.cards) :
return self.cards[-1 - index]
... | 3.046875 | 3 |
src/rightsize/rightsizedag.py | wpbrown/azmeta-rightsize-iaas | 1 | 54083 | from dagster import pipeline, ModeDefinition
from .resources import query_vm_resources
from .utilization import (
query_cpu_utilization, normalize_cpu_utilization,
query_mem_utilization, normalize_mem_utilization,
query_disk_utilization, normalize_disk_utilization,
default_azure_monitor_context
)
from .... | 2.125 | 2 |
yolox/models/losses/__init__.py | DDGRCF/YOLOX_OBB | 39 | 54084 | <reponame>DDGRCF/YOLOX_OBB
from .common_losses import *
from .poly_iou_loss import PolyIoULoss, PolyGIOULoss
from .kld_loss import KLDLoss
| 0.90625 | 1 |
egas/assocreader.py | agapow/egas | 0 | 54085 | """
Read in and validate associations.
"""
### IMPORTS
import csv
import re
### CONSTANTS & DEFINES
FIRST_CAP_RE = re.compile ('(.)([A-Z][a-z]+)')
OTHER_CAP_RE = re.compile ('([a-z0-9])([A-Z])')
UNDERSCORE_RE = re.compile ('_+')
DATA_FLD_NAMES = (
'snp_id',
'snp_locn_chr',
'snp_locn_posn',
'snp_base_w... | 2.828125 | 3 |
rajk_appman/urls.py | rajk-apps/rajk-appman | 0 | 54086 | <gh_stars>0
from django.urls import path, include
from . import views
app_name = "rajk-appman"
urlpatterns = [
path("", views.home, name="home"),
path("user_page", views.user_page, name="user_page"),
]
| 1.570313 | 2 |
examples/01_particle_filter.py | michalnand/libs_robotics | 0 | 54087 | <reponame>michalnand/libs_robotics
import numpy
import cv2
import LibsRobotics
#fourcc = cv2.VideoWriter_fourcc(*'XVID')
#writer = cv2.VideoWriter("particle_filter.avi", fourcc, 25.0, (512, 512))
def render(map, robot_x, robot_y, estimated_x, estimated_y, particles_x, particles_y):
height = map.shape[0]
w... | 2.5 | 2 |
PythonCraft/dev_version_PythonCraft.py | CCC-CS-github/ursina_ks3 | 2 | 54088 | <reponame>CCC-CS-github/ursina_ks3<gh_stars>1-10
"""
private dev for the PythonCraft code -- i.e. in case
I break the original, PythonCraft.py.
Also -- I want the original kept to approx. 30 lines.
"""
# Import the ursina module, and its First Person character.
from ursina import *
# Import the Perlin Noise module for ... | 2.734375 | 3 |
prologix_usb.py | rohankumardubey/pylt | 0 | 54089 | #!/usr/local/bin/python
from __future__ import print_function
import sys
import time
import serial
import pylt
pusb = dict()
ver = "Prologix GPIB-USB Controller version 6.95"
hwset = (
"addr",
"auto",
"eoi",
"eos",
"eot_enable",
"eot_char",
"read_tmo_ms"
)
def def_set(setting):
setting["auto"] = 0... | 2.40625 | 2 |
autorun/autorun/varecof.py | sjklipp/autoio | 0 | 54090 | <filename>autorun/autorun/varecof.py
""" Generate the information necessary to product the vrctst input files
"""
# import os
# import autofile
# import automol
# import varecof_io
# from phydat import phycon
# from autorun._run import run_script
# from autorun._run import from_input_string
#
#
# # Default names of in... | 2.359375 | 2 |
adet/modeling/blendmask/__init__.py | manusheoran/AdelaiDet_DA | 2,597 | 54091 | <reponame>manusheoran/AdelaiDet_DA
from .basis_module import build_basis_module
from .blendmask import BlendMask
| 0.863281 | 1 |
Chapter 14/code/ocr.py | shivampotdar/Artificial-Intelligence-with-Python | 387 | 54092 | <gh_stars>100-1000
import numpy as np
import neurolab as nl
# Define the input file
input_file = 'letter.data'
# Define the number of datapoints to
# be loaded from the input file
num_datapoints = 50
# String containing all the distinct characters
orig_labels = 'omandig'
# Compute the number of distinct characters... | 3.21875 | 3 |
PROG1_python/coursemology/Mission61-Task+List.py | dodieboy/Np_class | 0 | 54093 | <reponame>dodieboy/Np_class
#Programming I
#######################
# Mission 6.1 #
# Task List #
#######################
#Background
#==========
#After his success in the driverless vehicle, Tom
#ventures into private investigation services. To keep
#track of his progress on the cases, he like to
#c... | 4.34375 | 4 |
plico/rpc/zmq_remote_procedure_call.py | lbusoni/plico | 0 | 54094 | import time
import sys
import zmq
import pickle
from plico.utils.decorator import cacheResult, override, returnsNone
from plico.utils.logger import Logger
from plico.utils.barrier import Barrier, FunctionPredicate, BarrierTimeout
from plico.utils.constants import Constants
from plico.rpc.abstract_remote_procedure_call ... | 2.046875 | 2 |
Python/kraken/core/maths/euler.py | FabricExile/Kraken | 7 | 54095 | <reponame>FabricExile/Kraken
"""Kraken - maths.euler module.
Classes:
Euler -- Euler rotation.
"""
import math
from kraken.core.kraken_system import ks
from kraken.core.maths.math_object import MathObject
from kraken.core.maths.mat33 import Mat33
from kraken.core.maths.rotation_order import RotationOrder
rotationO... | 2.65625 | 3 |
configmerge.py | blubberdiblub/configmerge | 0 | 54096 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from typing import (
Any,
Mapping,
MutableMapping,
MutableSequence,
Sequence,
Text,
)
import click
import pathlib
from numbers import Integral, Real
from frozendict import FrozenOrderedDict
def load(f) -> MutableMapping:
p = pathlib.PureP... | 2.34375 | 2 |
stravenkovac/common_data.py | Katzeminze/Stravenkovac | 0 | 54097 | <gh_stars>0
pdf_path_month_hour = "C:/Users/Nyrobtseva/Documents/Python_Parser_stravenky/Month hour registration_07_2020_David_Tampier.pdf"
csv_path_month_hour = "month_hours.csv" # should be changed to smth better
pdf_path_travel_costs = "C:/Users/Nyrobtseva/Documents/Python_Parser_stravenky/cz_travelexpenses_DavidT... | 1.125 | 1 |
research/cv/u2net/src/data_loader.py | mindspore-ai/models | 77 | 54098 | <gh_stars>10-100
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | 1.984375 | 2 |
day_5/Lined_list.py | rajatbansal01/DSA-PYTHON | 0 | 54099 | class Node:
def __init__(self,data):
self.data = data
self.next = None
class LinkedList:
def __init__(self):
self.head=None
def print_llist(self):
temp = self.head
while temp:
print(temp.data)
temp=temp.next
lli... | 4.03125 | 4 |