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
perses/tests/test_atom_mapping.py
schallerdavid/perses
99
37400
<reponame>schallerdavid/perses import os import pytest import unittest from perses.rjmc.atom_mapping import AtomMapper, AtomMapping, InvalidMappingException from openff.toolkit.topology import Molecule ################################################################################ # LOGGER ##########################...
2.28125
2
app/api.py
amelie-fri/munch-api
2
37401
from flask import Flask, request, jsonify from flask_restful import Resource, Api from TeiParser import Family from dataManager import parentManager import os # path to "_data/N" folder path_N = os.path.join("_data", "N") # create the parent manager pm_N = parentManager(path_N) # create the Flask application app = Fl...
2.71875
3
globals/__init__.py
anmartinezs/pyseg
1
37402
<reponame>anmartinezs/pyseg __author__ = 'martinez' import vtk import numpy as np from variables import * from utils import *
1.039063
1
LeetCode/Linked List/23. Merge k Sorted Lists/solution.py
Ceruleanacg/Crack-Interview
17
37403
# Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def mergeKLists(self, lists: list): """ :type lists: List[ListNode] :rtype: ListNode """ if len(lists) == 0: return None...
4
4
Code/Python/ImageProcessing/RadialTransform/bSpline_test.py
Nailim/shuttler
0
37404
# this resizes __1.jpt to x it's original size & it turns it grayscale import cv import numpy import bSpline if __name__ == "__main__": # this is not a module scale = 10 # load image #cv_img = cv.LoadImage("__1.jpg", cv.CV_LOAD_IMAGE_GRAYSCALE) # CV_LOAD_IMAGE_GRAYSCALE cv_img = cv.LoadImage("__1.jpg", cv.C...
3.234375
3
crawler/crawling/items.py
zookeeperss/scrapy-cluster
0
37405
# -*- coding: utf-8 -*- # Define here the models for your scraped items from scrapy import Item, Field class RawResponseItem(Item): appid = Field() crawlid = Field() url = Field() response_url = Field() status_code = Field() status_msg = Field() headers = Field() body = Field() li...
2.34375
2
examples/c/cdecl.py
rakati/ppci-mirror
161
37406
""" Implement alike logic as is done on www.cdecl.org Try for example: $ cdelc.py 'char **a;' """ import argparse import io from ppci.api import get_current_arch from ppci.lang.c import CLexer, CParser, COptions, CContext, CSemantics from ppci.lang.c.nodes import types, declarations from ppci.lang.c.preprocessor im...
2.75
3
minder_lastreview.py
hodea/hodea-review-minder
0
37407
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Mon Feb 26 19:38:29 2018 @author: Daniel """ import argparse import os from minder_config import minder_cfg from minder_database import minder_db from minder_htmlreport import minder_report import time import hashlib import uuid class get_lastreview: def...
2.140625
2
build/lib/NaMAZU/onnx_api/__init__.py
NMZ0429/NaMAZU
5
37408
__all__ = ["MiDASInference", "U2NetInference", "RealESRGANInference"] from .midas import MiDASInference from .segmentation import U2NetInference from .real_esr import RealESRGANInference
1.007813
1
practice/aboutfunctions.py
mrElnekave/Hallow-Valley
0
37409
def create_path(path:str): """ :param path:path is the relative path from the pixel images folder :return: return the relative path from roots of project """ return current_path + path #a function name is before the parameters and after the def #function parameters: the values that the function kn...
3.4375
3
tex2ebook.py
rzoller/tex2ebook
13
37410
# run with --help to see available options import os, sys, tempfile, shutil, re from optparse import OptionParser log_dir = os.path.abspath('_log') def get_working_dir(texfile, log): if log: # create a subdirectory in _log if not os.path.exists(log_dir): os.makedirs(log_dir) subdir = os.path.join(log_dir,...
2.640625
3
pyfritzhome/devicetypes/fritzhomedevicethermostat.py
Gezzo42/python-fritzhome
0
37411
<gh_stars>0 # -*- coding: utf-8 -*- import logging from .fritzhomedevicebase import FritzhomeDeviceBase from .fritzhomedevicefeatures import FritzhomeDeviceFeatures _LOGGER = logging.getLogger(__name__) class FritzhomeDeviceThermostat(FritzhomeDeviceBase): """The Fritzhome Device class.""" actual_temperat...
2.25
2
UI/mainUI.py
steenzout/python-storj-gui
0
37412
# -*- coding: utf-8 -*- import logging import threading import storj.exception as sjexc from PyQt4 import QtCore, QtGui from .qt_interfaces.dashboard_ui import Ui_MainMenu from .bucket_edition import BucketEditingUI from .client_config import ClientConfigurationUI from .engine import StorjEngine from .file_download...
1.84375
2
biocircuits/reg.py
justinbois/biocircuits
3
37413
def rep_hill(x, n): """Dimensionless production rate for a gene repressed by x. Parameters ---------- x : float or NumPy array Concentration of repressor. n : float Hill coefficient. Returns ------- output : NumPy array or float 1 / (1 + x**n) """ return...
2.96875
3
fourpisky/log_config.py
4pisky/fourpisky-core
2
37414
<gh_stars>1-10 import logging from fourpisky.reports import EmailHandler from fourpisky.local import contacts full_date_fmt = "%y-%m-%d (%a) %H:%M:%S" short_date_fmt = "%H:%M:%S" verbose_formatter = logging.Formatter( '%(asctime)s:%(name)s:%(levelname)s:%(message)s', # '%(asctime)s:%(levelname)s:%(me...
2.125
2
Python Advanced/Advanced/Tuples and Sets/Lab/Task05.py
IvanTodorovBG/SoftUni
1
37415
<gh_stars>1-10 n = int(input()) vip_guest = set() regular_guest = set() for _ in range(n): reservation_code = input() if reservation_code[0].isdigit(): vip_guest.add(reservation_code) else: regular_guest.add(reservation_code) command = input() while command != "END": if command[0]....
3.34375
3
pyz3r/exceptions.py
mgius/pyz3r
0
37416
<filename>pyz3r/exceptions.py class alttprException(Exception): pass class alttprFailedToRetrieve(Exception): pass class alttprFailedToGenerate(Exception): pass
1.320313
1
exercicios-Python/desaf109/pythonteste.py
marcelo-py/Exercicios-Python
0
37417
from desaf109 import moeda p = float(input('Digite um preço: R$')) print('A metade de {} é {}'.format(moeda.moeda(p), moeda.metade(p, True))) print('O dobro de {} é {}'.format(moeda.moeda(p), moeda.dobro(p, True))) print('Se adcionarmos 10% fica {}'.format(moeda.aumentar(p, 10, True))) print('Se tirarmos 13% fica {}'....
3.609375
4
src/curt/curt/modules/vision/vision_processor_service.py
sanyaade-teachings/cep
108
37418
""" Copyright (C) Cortic Technology Corp. - All Rights Reserved Written by <NAME> <<EMAIL>>, 2021 """ # need to advertise different processor type, eg CPU, GPU, TPU import traceback import logging from curt.base_service import BaseService class VisionProcessorService(BaseService): def __init__(self): ...
2.203125
2
src_py/hat/gateway/devices/modbus/__init__.py
hat-open/hat-gateway
2
37419
"""Modbus devices"""
1.109375
1
lamp/neuralnets.py
bdevl/PGMCPC
3
37420
import lamp.modules import torch import numpy as np from lamp.utils import get_activation_function class FeedforwardNeuralNetwork(lamp.modules.BaseModule): def __init__(self, dim_in, dim_out, architecture, dropout, outf=None, dtype = None, device = None): super(FeedforwardNeuralNetwork, self).__init__()...
2.515625
3
PythonExercicios/ex010.py
VitorFRodrigues/Python-curso
0
37421
<gh_stars>0 n = float(input('Quanto dinheiro você tem na carteira? R$')) print('Com R${:.2f} você pode comprar US${:.2f}.'.format(n, n/3.27))
3.546875
4
tests/data/expected_tabulated.py
CozyDoomer/pypistats
1
37422
<gh_stars>1-10 EXPECTED_TABULATED_HTML = """ <table> <thead> <tr> <th>category</th> <th>date</th> <th>downloads</th> </tr> </thead> <tbody> <tr> <td align="left">2.6</td> <td align="left">2018-08-15</td> <td alig...
1.4375
1
pressio4py/apps/burgers1d.py
Pressio/pressio4py
4
37423
import numpy as np import math from scipy.sparse import csr_matrix, diags from scipy import linalg import time try: from numba import jit, njit numbaOn = True except ModuleNotFoundError: numbaOn = False if numbaOn: @njit(["void(float64[:], f8, float64[:], float64[:], f8, f8)"]) def velocityImplNumba(u, t, ...
2.328125
2
src/model/model.py
Alexei95/FasTrCaps
2
37424
import math import pathlib import sys import torch import torch.nn as nn PROJECT_DIR = pathlib.Path(__file__).absolute().parent.parent.parent # main directory, the parent of src if str(PROJECT_DIR) not in sys.path: sys.path.append(str(PROJECT_DIR)) from src.model.ConvLayer import ConvLayer from src.m...
2.046875
2
whyis/blueprint/entity/get_entity.py
aswallace/whyis
31
37425
from flask import current_app, request, Response, make_response from rdflib import ConjunctiveGraph from werkzeug.exceptions import abort from depot.middleware import FileServeApp from .entity_blueprint import entity_blueprint from whyis.data_extensions import DATA_EXTENSIONS from whyis.data_formats import DATA_FORMAT...
1.984375
2
tests/test_pipeline.py
phvu/cebes-python
0
37426
# Copyright 2016 The Cebes Authors. All Rights Reserved. # # Licensed under the Apache License, version 2.0 (the "License"). # You may not use this work except in compliance with the License, # which is available at www.apache.org/licenses/LICENSE-2.0 # # This software is distributed on an "AS IS" basis, WITHOUT WARRAN...
2.21875
2
Chapter04/currency_converter/core/currency.py
ariwells2001/Python-Programming-Blueprints
72
37427
from enum import Enum class Currency(Enum): AUD = 'Australia Dollar' BGN = 'Bulgaria Lev' BRL = 'Brazil Real' CAD = 'Canada Dollar' CHF = 'Switzerland Franc' CNY = 'China Yuan/Renminbi' CZK = 'Czech Koruna' DKK = 'Denmark Krone' GBP = 'Great Britain Pound' HKD = 'Hong Kong Doll...
3.265625
3
kgtk/cli/wikidata_nodes_import.py
bhatiadivij/kgtk
0
37428
""" Import wikidata nodes into KGTK file """ def parser(): return { 'help': 'Import wikidata nodes into KGTK file' } def add_arguments(parser): """ Parse arguments Args: parser (argparse.ArgumentParser) """ parser.add_argument("-i", action="store", type=str, dest="wikidat...
2.71875
3
training/train_nav.py
catalina17/EmbodiedQA
289
37429
import time import argparse from datetime import datetime import logging import numpy as np import os import torch import torch.nn.functional as F import torch.multiprocessing as mp from models import NavCnnModel, NavCnnRnnModel, NavCnnRnnMultModel, NavPlannerControllerModel from data import EqaDataLoader from metrics ...
1.898438
2
yarll/scripts/list_exps.py
hknozturk/yarll
62
37430
import os import json import argparse from pathlib import Path import pandas as pd import dateutil parser = argparse.ArgumentParser() parser.add_argument("directory", type=Path help="Path to the directory.") def main(): args = parser.parse_args() dirs = sorted([d for d in os.listdir(args.directory) if os.pa...
2.65625
3
src/malign/alignment.py
tresoldi/malign
0
37431
""" Module for the Alignment class. The `Alignment` class is a simple data class that holds aligned sequences and their score. It was originally a dictionary passed back and forth among functions, for which a data class is a good replacement. """ from dataclasses import dataclass from typing import Sequence, Hashable...
3.90625
4
0236_Lowest_Common_Ancestor_of_a_Binary_Tree.py
coldmanck/leetcode-python
4
37432
<reponame>coldmanck/leetcode-python # Runtime: 84 ms, faster than 22.95% of Python3 online submissions for Lowest Common Ancestor of a Binary Tree. # Memory Usage: 23.1 MB, less than 91.67% of Python3 online submissions for Lowest Common Ancestor of a Binary Tree. # Definition for a binary tree node. # class TreeNode:...
3.625
4
src/main/python/scrumtools/github.py
TU-Berlin-DIMA/scrum-tools
1
37433
""" Copyright 2010-2014 DIMA Research Group, TU Berlin 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.929688
2
cubam/MajorityModel.py
welinder/cubam
20
37434
from BinaryModel import * from numpy.random import rand class MajorityModel(BinaryModel): def __init__(self, filename=None): self.mdlPrm = { 'addNoise' : False, } self.wkrIds = {} self.imgIds = {} if filename: self.load_data(filename) else: ...
2.84375
3
visprotocol/server/test_multi_LED.py
ClandininLab/vis-protocol
0
37435
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- from flystim.screen import Screen, SubScreen from flystim.draw import draw_screens from flystim.stim_server import StimServer from flystim.dlpc350 import make_dlpc350_objects from math import pi import matplotlib.pyplot as plt def main(): # LCR USB command...
2.25
2
UserInterfaces.py
StudentCV/TableSoccerCV
10
37436
<reponame>StudentCV/TableSoccerCV #Copyright 2016 StudentCV #Copyright and related rights are licensed under the #Solderpad Hardware License, Version 0.51 (the “License”); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at http://solderpad.org/licenses/SHL-0.51. #...
2.53125
3
data/external/repositories/115375/hail-seizure-master/train.py
Keesiu/meta-kaggle
0
37437
<reponame>Keesiu/meta-kaggle<gh_stars>0 #!/usr/bin/env python3 import python.utils as utils import os import joblib import pickle import pdb def main(settingsfname, verbose=False, store_models=True, store_features=False, save_training_detailed=False, load_pickled=False, parallel=0): settings =...
1.96875
2
tests/scraper/models.py
teolemon/django-dynamic-scraper
0
37438
from django.db import models from dynamic_scraper.models import Scraper, SchedulerRuntime from scrapy.contrib.djangoitem import DjangoItem class EventWebsite(models.Model): name = models.CharField(max_length=200) scraper = models.ForeignKey(Scraper, blank=True, null=True, on_delete=models.SET_NULL) url = ...
2.234375
2
users/models.py
lizooo/webpage
1
37439
<filename>users/models.py from django.db import models # Create your models here. from django.db import models from datetime import datetime class User(models.Model): name = models.CharField(max_length=100) surname = models.CharField(max_length=100) email = models.EmailField(unique=True) password = ...
2.671875
3
doctable/textmodels/parsetreedoc.py
devincornell/sqlitedocuments
1
37440
from typing import Any from .basedoc import BaseDoc from .parsetree import ParseTree class ParseTreeDoc(list): ''' Represents a document composed of sequence of parsetrees. ''' @property def tokens(self): return (t for pt in self for t in pt) def as_dict(self): ''' Convert docume...
2.78125
3
corehq/motech/openmrs/finders.py
rochakchauhan/commcare-hq
0
37441
""" PatientFinders are used to find OpenMRS patients that correspond to CommCare cases if none of the patient identifiers listed in OpenmrsCaseConfig.match_on_ids have successfully matched a patient. See `README.md`__ for more context. """ import logging from collections import namedtuple from functools import partial...
2.5625
3
Chapter05/examine_tar_file_content.py
add54/ADMIN_SYS_PYTHON
116
37442
<filename>Chapter05/examine_tar_file_content.py import tarfile tar_file = tarfile.open("work.tar.gz", "r:gz") print(tar_file.getnames())
2.84375
3
main/__init__.py
graingert/LiteBot
0
37443
from main import status, tps, server_commands, scoreboard def setup(bot): bot.add_cog(status.Status(bot), True) bot.add_cog(tps.Tps(bot), True) bot.add_cog(server_commands.ServerCommands(bot), True) bot.add_cog(scoreboard.ScoreBoard(bot), True)
2
2
rsatools/rp.py
SteelShredder/rsa-tools
0
37444
from .decrypt import decrypt as d from .encrypt import encrypt as e from .generatekeys import genkeys as g def pg(e, bit): dp = open("rsakeys/d", "w+") ep = open("rsakeys/e", "w+") np = open("rsakeys/n", "w+") a, b, c = g(e,bit) np.write(str(a)) ep.write(str(b)) dp.write(str(c)) dp.close...
2.546875
3
thrift/gen-py/hello/UserExchange.py
amitsaha/playground
4
37445
# # Autogenerated by Thrift Compiler (0.9.1) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport ...
2
2
api/db/db.py
bcgov/data-stream
1
37446
from mongoengine import connect from config import Config from db.models.subscriptions import Subscriptions class Db: Subscriptions = None def __init__(self, createClient=True): config = Config() self.db = {} self.Subscriptions = Subscriptions self.createClient = createClient ...
2.671875
3
src/hg/makeDb/scripts/cd8Escape/process_epitopes.py
andypohl/kent
171
37447
import os import re import gzip import argparse import pandas as pd import numpy as np from collections import defaultdict def get_args(): """ Parse command line arguments """ parser = argparse.ArgumentParser(description="Method to create track for escape mutations") parser.add_argument("-xlsx",...
2.84375
3
plugins/dnshome_de_srvc.py
ppetr/ddupdate
0
37448
<filename>plugins/dnshome_de_srvc.py """ ddupdate plugin updating data on dnshome.de. See: ddupdate(8) See: https://www.dnshome.de/ """ from typing import AnyStr from logging import Logger from ddupdate.ddplugin import ServicePlugin, ServiceError from ddupdate.ddplugin import http_basic_auth_setup, get_response, IpA...
2.359375
2
debug.py
codingjerk/ztd.blunders-web
0
37449
#!/usr/bin/env python from app import app app.run(host = '0.0.0.0', port = 8089, debug = True, threaded = False, processes = 1)
1.5625
2
tests/test_ms_sql_server.py
changrunner/zeppos_microsoft_sql_server
0
37450
import unittest from zeppos_microsoft_sql_server.ms_sql_server import MsSqlServer import pandas as pd import pyodbc import os class TestTheProjectMethods(unittest.TestCase): def test_constructor_methods(self): self.assertEqual("<class 'zeppos_microsoft_sql_server.ms_sql_server.MsSqlServer'>", str(type(MsSq...
2.828125
3
test22.py
spatole12/ssw555tmashishningrohnitshivani2019Spring
0
37451
import unittest import io import sys from main import Gedcom class TestProject(unittest.TestCase): def test_us22_unique_id(self): # Redirect stdout for unit test capturedOutput = io.StringIO() sys.stdout = capturedOutput FILENAME="My-Family-27-Jan-2019-275.ged" ...
2.671875
3
rest_framework_social_oauth2/settings.py
hrahmadi71/django-rest-framework-social-oauth2
613
37452
from django.conf import settings DRFSO2_PROPRIETARY_BACKEND_NAME = getattr(settings, 'DRFSO2_PROPRIETARY_BACKEND_NAME', "Django") DRFSO2_URL_NAMESPACE = getattr(settings, 'DRFSO2_URL_NAMESPACE', "")
1.601563
2
txircd/modules/core/bans_gline.py
guyguy2001/txircd
19
37453
from twisted.plugin import IPlugin from twisted.words.protocols import irc from txircd.config import ConfigValidationError from txircd.module_interface import Command, ICommand, IModuleData, ModuleData from txircd.modules.xlinebase import XLineBase from txircd.utils import durationToSeconds, ircLower, now from zope.int...
1.90625
2
errandpy/utility.py
DIAOZHUO/errandpy
0
37454
import matplotlib.pyplot as plt import numpy import errandpy """ logファイルのFitting Parameter: a,b,c,dを返します normalized_paramの時正規化したパラメーターを返します """ def real_a(a, delta, min): return (a + 1) * delta + min def real_b(b, delta): return b * delta def get_z0FromLogFile(path, isLega...
2.890625
3
API_AUTH_TEST.py
DaTiC0/cPanel-Python
0
37455
<reponame>DaTiC0/cPanel-Python<gh_stars>0 # from logging import error import requests import urllib.parse as uparse import config import logging # Enabling debugging at http.client level (requests->urllib3->http.client) # you will see the REQUEST, including HEADERS and DATA, and RESPONSE with HEADERS but without DAT...
2.8125
3
myutils/pandas_util.py
stas00/fastai-misc
1
37456
<filename>myutils/pandas_util.py<gh_stars>1-10 # from https://github.com/ohmeow/pandas_examples # import sys # sys.path.append('/home/stas/fast.ai') # from myutils.pandas_util import advanced_describe import pandas as pd ######################### Data Examination ############################ # - made changes to un...
3
3
tensorflow/compiler/plugin/poplar/poplar.bzl
chenzhengda/tensorflow
74
37457
load( "//tensorflow/core/platform:rules_cc.bzl", "cc_library", ) def poplar_cc_library(**kwargs): """ Wrapper for inserting poplar specific build options. """ if not "copts" in kwargs: kwargs["copts"] = [] copts = kwargs["copts"] copts.append("-Werror=return-type") cc_library(**kwargs)
1.726563
2
easy/9.Palindrome_Number.py
Leesoar/leetcode
2
37458
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Question: Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers be palindromes? (ie, -1) If you are thinking of converting the integer to string, note the restriction of using extra space. You could also t...
4.1875
4
scripts/lottery_prints.py
chibitrader/smartcotractlottery
0
37459
from brownie import Lottery, accounts, config, network from web3 import Web3 def printStuff(): account = accounts[0] lottery = Lottery.deploy( config["networks"][network.show_active()]["eth_usd_price_feed"], config["networks"][network.show_active()]["gbp_usd_price_feed"], {"from": acco...
2.484375
2
_build/jupyter_execute/curriculum-notebooks/Languages/FrenchVerbCodingConjugation/french-verb-conjugation.py
BryceHaley/curriculum-jbook
1
37460
<filename>_build/jupyter_execute/curriculum-notebooks/Languages/FrenchVerbCodingConjugation/french-verb-conjugation.py ![Callysto.ca Banner](https://github.com/callysto/curriculum-notebooks/blob/master/callysto-notebook-banner-top.jpg?raw=true) <a href="https://hub.callysto.ca/jupyter/hub/user-redirect/git-pull?repo=h...
2.53125
3
item_engine/textbase/generate_tests.py
GabrielAmare/ItemEngine
0
37461
<gh_stars>0 import os from typing import List, Iterator from item_engine.textbase import make_characters __all__ = ["generate_tests"] def generate_tests(pckg: str, inputs: List[str], __test__: str = '__test__', spec: str = 'spec', __test_pr...
2.5625
3
sonnet/python/modules/block_matrix_test.py
imraviagrawal/sonnet
1
37462
<filename>sonnet/python/modules/block_matrix_test.py # Copyright 2017 The Sonnet Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lic...
2.765625
3
Real_Time_Scripts/config_push_file.py
channa006/Basic_Python_Scripts
0
37463
from netmiko import ConnectHandler import os template = """logging host 192.168.20.5 transport tcp port 514 logging trap 6 interface loopback 30 description "{rtr} loopback interface\"""" username = 'test' password = "<PASSWORD>" # step 1 # fetch the hostname of the router for the template for n in range(1, 5): ...
2.5
2
runs.py
petch/elsticity2019
1
37464
<filename>runs.py from ahm import * from dfm import * set_log_level(LogLevel.WARNING) def run(N, n, h, k, c, g, f, ls='mumps', pc='default', do_write=True): t1 = Timer() m = int(N/n) l = int(m/2) fp, fm, fd, fb = fibers(N, N, l, h, n, k*n, do_write) tp, tm, td, tb = fibers(N, N, 0, 0, n, k*n, do_w...
2.015625
2
src/p21_CoorAnalyse.py
leekwunfung817/ComputerVision-technique-ObjectRegister
1
37465
<filename>src/p21_CoorAnalyse.py import cv2 import math import func_any import func_apis import sys py_name = sys.argv[0] app_name = py_name.replace('.pyc','').replace('.py','') exec('import '+app_name) exec('config = '+app_name+'.config') import func_colorArea import json # history var['movingCoor'] { # ID { lost...
2.125
2
src/day11/__init__.py
CreatingNull/AoC-2021
0
37466
<filename>src/day11/__init__.py """--- Day 11: Dumbo Octopus ---""" from pathlib import Path from numpy import all as all_ from numpy import array from numpy import byte from numpy import where from aoc import open_utf8 def __execute_step(data: array, bounds: [[]]) -> int: """Recursive function to simulate a si...
3.03125
3
tests/test_record_parsing.py
jodal/python-netsgiro
0
37467
from datetime import date import pytest import netsgiro import netsgiro.records def test_transmission_start(): record = netsgiro.records.TransmissionStart.from_string( 'NY00001055555555100008100008080000000000' '0000000000000000000000000000000000000000' ) assert record.service_code == n...
2.28125
2
day_1/day1.py
secworks/advent_of_code_2017
0
37468
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #======================================================================= # # day_1.py # -------- # Solution for Advent of code 2017, day 1. # http://adventofcode.com/2017/day/1 # # Status: Done. # # <NAME> 2017 # #===========================================================...
2.921875
3
floodsystem/station.py
knived/ia-flood-risk-project
0
37469
# Copyright (C) 2018 <NAME> # # SPDX-License-Identifier: MIT """This module provides a model for a monitoring station, and tools for manipulating/modifying station data """ class MonitoringStation: """This class represents a river level monitoring station""" def __init__(self, station_id, measure_id, label,...
3.09375
3
sokoapp/contests/admin.py
Mercy-Nekesa/sokoapp
1
37470
from django.contrib import admin from .models import TimePeriod class TimePeriodAdminBase(object): list_display = ('name', 'period_start', 'period_end',) class TimePeriodAdmin(TimePeriodAdminBase, admin.ModelAdmin): pass admin.site.register(TimePeriod, TimePeriodAdmin)
1.65625
2
dataset/dataset_seq2seq.py
tianyilt/PQ-NET
95
37471
<reponame>tianyilt/PQ-NET from torch.utils.data import Dataset import torch import os import json from dataset.data_utils import collect_data_id, load_from_hdf5_seq # Seq2Seq dataset ###################################################### class Seq2SeqDataset(Dataset): def __init__(self, phase, data_root, class_na...
2.390625
2
codes/qtm/base.py
vutuanhai237/QuantumTomographyProject
0
37472
import qiskit import qtm.progress_bar import qtm.constant import qtm.qfim import qtm.noise import qtm.optimizer import qtm.fubini_study import numpy as np import types, typing def measure(qc: qiskit.QuantumCircuit, qubits, cbits=[]): """Measuring the quantu circuit which fully measurement gates Args: ...
2.40625
2
marqeta/response_models/kyc_response.py
marqeta/marqeta-python
21
37473
from datetime import datetime, date from marqeta.response_models.result import Result from marqeta.response_models.kyc_question import KycQuestion from marqeta.response_models import datetime_object import json import re class KycResponse(object): def __init__(self, json_response): self.json_response = js...
2.15625
2
pyexlatex/presentation/beamer/templates/control/tocsection.py
whoopnip/py-ex-latex
4
37474
<filename>pyexlatex/presentation/beamer/templates/control/tocsection.py from pyexlatex.models.template import Template from pyexlatex.presentation import Frame from pyexlatex.presentation.beamer.control.atbeginsection import AtBeginSection from pyexlatex.models.toc import TableOfContents class TableOfContentsAtBeginS...
1.789063
2
pbc/df/ft_ao.py
gmwang18/pyscf
0
37475
<reponame>gmwang18/pyscf #!/usr/bin/env python # # Author: <NAME> <<EMAIL>> # ''' Analytic Fourier transformation AO-pair value for PBC ''' import ctypes import numpy import scipy.linalg from pyscf import lib from pyscf import gto from pyscf.gto.ft_ao import ft_ao as mol_ft_ao libpbc = lib.load_library('libpbc') # ...
2.140625
2
asyncpushbullet/websocket_server.py
rharder/pushbullet.py
12
37476
#!/usr/bin/env python3 """ Easy to use Websocket Server. Source: https://github.com/rharder/handy June 2018 - Updated for aiohttp v3.3 August 2018 - Updated for Python 3.7, made WebServer support multiple routes on one port """ import asyncio import logging import weakref from functools import partial from typing imp...
3.046875
3
update/checkplay.py
dalton-lee/AutoUpdate
1
37477
#!/usr/bin/env python #coding=utf-8 import os import sys import json import time import urllib2 import platform import ConfigParser UPDATE_CONFIG = 0 def checkplay(remotedir,workdir): global UPDATE_CONFIG if not remotedir.endswith('/'): remotedir = remotedir + '/' orgcode = UPD...
2.15625
2
backend/app/app/models/__init__.py
benlau6/fastapi-fullstack
1
37478
from .team import Team, TeamRead, TeamCreate, TeamUpdate # , TeamReadWithHeroes from .hero import Hero, HeroRead, HeroCreate, HeroUpdate # , HeroReadWithTeam from typing import List, Optional class TeamReadWithHeroes(TeamRead): heroes: List[HeroRead] = [] class HeroReadWithTeam(HeroRead): team...
2.484375
2
mltools/train/__init__.py
msc5/ml-tools
0
37479
<filename>mltools/train/__init__.py from .train import * from .logger import Logger
1.171875
1
course_contents/exercice_templates/npplt.py
maganoegi/python_course_autumn_2021
0
37480
<gh_stars>0 import numpy as np import matplotlib.pyplot as plt import random if __name__ == '__main__': ones = np.ones(30, dtype=np.uint8) print(ones) doubled = [x * 2 for x in ones] doubled = ones * 2 print(doubled) negatives = ones - doubled print(negatives) y = np.random.rand(...
3.4375
3
order/models.py
akashbindal91/django_ecommerce_practice
0
37481
<filename>order/models.py from django.db import models # Create your models here. class Order(models.Model): """ docstring """ token = models.CharField(max_length=250, blank=True) total = models.DecimalField( verbose_name="GBP Order Total", max_digits=10, decimal_places=2) emailAddres...
2.59375
3
tests/test_RecordsDB.py
SamWolski/LabWeaver-analysis
0
37482
import pytest import os import LabWeaver_analysis as lw_ana DB_DIR = os.path.abspath("tests/assets/db") @pytest.fixture def existing_records_db(): db_path = os.path.join(DB_DIR, "records_existing.db") return lw_ana.RecordsDB(db_path) def test_fetch(existing_records_db): fetched_record = existing_records_db.fi...
2.109375
2
src/hooks.py
nsaphra/layer-tagger
0
37483
<filename>src/hooks.py # -*- coding: utf-8 -*- import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from os.path import join, isfile import data class TaggerHook: def __init__(self, analyzer, key, module, output_vocab, save_prefix, hidden_size=None, dropout=0.5):...
2.359375
2
django_libretto/__init__.py
ze-phyr-us/django-libretto
0
37484
from . import decorators, forms, http, models, template, url
1.070313
1
program-4/4a)Extracting substring.py
sumukhmg/PYTHON-LAB-SET-PROGRAMS
12
37485
a = input("Enter the string:") b = a.find("@") c = a.find("#") print("The original string is:",a) print("The substring between @ and # is:",a[b+1:c])
4.0625
4
tests/test_ui_systemtray.py
scottwernervt/clipmanager
12
37486
<gh_stars>10-100 import pytest from clipmanager.ui.systemtray import SystemTrayIcon @pytest.fixture() def systemtray(): tray = SystemTrayIcon() tray.show() return tray class TestSystemTrayIcon: def test_is_visible(self, systemtray): assert systemtray.isVisible()
1.867188
2
OverlapSep/lda_classify.py
PingjunChen/ChromosomeSeg
0
37487
<filename>OverlapSep/lda_classify.py<gh_stars>0 # -*- coding: utf-8 -*- import os, sys import json import numpy as np import pickle from sklearn.metrics import accuracy_score from sklearn.preprocessing import normalize from sklearn import svm from sklearn.metrics import confusion_matrix import matplotlib.pyplot as plt...
2.515625
3
01_getting_started_with_python/src/_solutions/fahrenheit_to_celsius.py
hello-world-academy/beiersdorf_05-06-2019
1
37488
def fahrenheit_to_celsius(F): ''' Function to compute Celsius from Fahrenheit ''' K = fahrenheit_to_kelvin(F) C = kelvin_to_celsius(K) return C
3.546875
4
treegen.py
murawaki/dialect-latgeo
3
37489
# -*- coding: utf-8 -*- import numpy as np import random import sys from collections import Counter import json from argparse import ArgumentParser from rand_utils import rand_partition def build_tree(num_leaves = 10, rootdate = 1000): """ Starting from a three-node tree, split a randomly chosen branch to in...
3.046875
3
tools/generator/__init__.py
Dev00355/fundamental-tools-copy-from-sap
0
37490
# SPDX-FileCopyrightText: 2014 SAP SE <NAME> <<EMAIL>> # # SPDX-License-Identifier: Apache-2.0 # -*- coding: utf-8 -*- from .business_objects import catalog, rfm_sets VERSION = "0.2" # T002, T002C all_languages = { # iso2 "ar": "AR - عربي", "bg": "BG - Български", "ca": "CA - Català", "cs": "CS ...
1.3125
1
src/fft_from_image/Sequences.py
szymag/ZFN
2
37491
<gh_stars>1-10 from src.fft_from_image.ChainGeneration import ChainGeneration import numpy as np class ThueMorse(ChainGeneration): def __init__(self, repeat, tm_num): ChainGeneration.__init__(self, repeat) self.tm_num = tm_num @staticmethod def tm_construct(seq): return [(i + 1) %...
2.640625
3
etf_data_loader.py
xSakix/etf_data
0
37492
import pandas as pd import numpy as np import os import sys def load_data(assets, start_date, end_date): df_open = load_data_from_file('etf_data_open.csv', assets, start_date, end_date) df_close = load_data_from_file('etf_data_close.csv', assets, start_date, end_date) df_high = load_data_from_file('etf_da...
2.796875
3
test/sysinfo_test.py
peitur/docker-util
1
37493
<filename>test/sysinfo_test.py #!/usr/bin/python3 import sys,os,re sys.path.append( "../lib" ) sys.path.append( "./lib" ) import Controller import unittest from pprint import pprint class SysinfoTest( unittest.TestCase ): def test_configuration( self ): pass def test_information( self ): ...
2.1875
2
gmmp/management/commands/write_weights_to_dict.py
digideskio/gmmp
4
37494
import csv from pprint import pprint from django.core.management.base import BaseCommand class Command(BaseCommand): def handle(self, *args, **options): with open(args[0]) as csvfile: reader = csv.DictReader(csvfile) weights = [] for row in reader: row['...
2.421875
2
src/trends.py
didier-devel/confinement
1
37495
import pandas as pd import numpy as np from matplotlib import pyplot as plt import os from datetime import datetime, date, timedelta from sklearn.linear_model import LinearRegression import scipy import math import sys import locator file_path = os.path.dirname(os.path.realpath(__file__)) proj_path = os.path.abspath(...
2.578125
3
tests/test_sorted_feed.py
andyet/thoonk.py
63
37496
import thoonk from thoonk.feeds import SortedFeed import unittest from ConfigParser import ConfigParser class TestLeaf(unittest.TestCase): def setUp(self): conf = ConfigParser() conf.read('test.cfg') if conf.sections() == ['Test']: self.ps = thoonk.Thoonk(host=conf.get('Te...
2.53125
3
dolo/tests/test_solvers.py
christophe-gouel/dolo
0
37497
import unittest import numpy as np from dolo.numeric.ncpsolve import ncpsolve, smooth def josephy(x): # Computes the function value F(x) of the NCP-example by Josephy. n=len(x) Fx=np.zeros(n) Fx[0]=3*x[0]**2+2*x[0]*x[1]+2*x[1]**2+x[2]+3*x[3]-6 Fx[1]=2*x[0]**2+x[0]+x[1]**2+3*x[2]+2*x[3]-2 F...
2.765625
3
Solution_6.py
LukeFarrell/Google_Foo_Bar
0
37498
<gh_stars>0 #Absorbing Markov Matrix Problem from fractions import Fraction def answer6(m): #Initialize Matrix Y = [[0 for x in range(len(m))] for x in range(len(m))] terminal = [] nonTerminal = [] #Keep track of absorbing states for i in range(len(m)): s = float(sum(m[i])) ...
3.09375
3
banditpylib/learners/mnl_bandit_learner/ts_test.py
Alanthink/banditpylib
20
37499
from unittest.mock import MagicMock import google.protobuf.text_format as text_format import numpy as np from banditpylib.bandits import CvarReward from banditpylib.data_pb2 import Actions, Context from .ts import ThompsonSampling class TestThompsonSampling: """Test thompson sampling policy""" def test_simple_...
2.5
2