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
bika/lims/permissions.py
hocinebendou/bika.gsoc
0
15600
""" All permissions are defined here. They are also defined in permissions.zcml. The two files must be kept in sync. bika.lims.__init__ imports * from this file, so bika.lims.PermName or bika.lims.permissions.PermName are both valid. """ from Products.CMFCore.permissions import AddPortalContent #...
1.5625
2
python/venv/lib/python2.7/site-packages/openstack/tests/unit/telemetry/v2/test_sample.py
sjsucohort6/openstack
0
15601
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
1.914063
2
data_convert/convert_text_to_tree.py
wlof-2/Text2Relation
0
15602
<gh_stars>0 #!/usr/bin/env python # -*- coding:utf-8 -*- import os import json from collections import Counter, defaultdict from data_convert.format.text2tree import Entity_Type, Text2Tree from data_convert.task_format.event_extraction import Event, DyIEPP, Conll04 from data_convert.utils import read_file, check_output...
2.125
2
arachnado/utils/spiders.py
wigginzz/arachnado
2
15603
<reponame>wigginzz/arachnado from scrapy.utils.misc import walk_modules from scrapy.utils.spider import iter_spider_classes def get_spider_cls(url, spider_packages, default): """ Return spider class based on provided url. :param url: if it looks like `spider://spidername` it tries to load spider ...
3.1875
3
Social_Encoders.py
Haroon96/GraphRec-WWW19
0
15604
<reponame>Haroon96/GraphRec-WWW19 import torch import torch.nn as nn from torch.nn import init import torch.nn.functional as F class Social_Encoder(nn.Module): def __init__(self, features, embed_dim, social_adj_lists, aggregator, base_model=None, cuda="cpu"): super(Social_Encoder, self).__init__() ...
2.1875
2
deephub/utils/__main__.py
deeplab-ai/deephub
8
15605
<reponame>deeplab-ai/deephub<filename>deephub/utils/__main__.py import click import time from deephub.common.io import resolve_glob_pattern from deephub.models.feeders.tfrecords.meta import generate_fileinfo, get_fileinfo, TFRecordValidationError, \ TFRecordInfoMissingError @click.group() def cli(): """ ...
2.28125
2
utils_mit_im.py
putama/visualcomposition
0
15606
<filename>utils_mit_im.py import numpy as np import cPickle import os from scipy.io import loadmat import time import h5py import json import copy import bz2 def unique_rows(a): b = np.ascontiguousarray(a).view(np.dtype((np.void, a.dtype.itemsize * a.shape[1]))) _, idx = np.unique(b, return_index=True) return a[...
2.078125
2
python_teste/python_aulas/aula_94.py
BrunoDantasMoreira/projectsPython
1
15607
<reponame>BrunoDantasMoreira/projectsPython dict = {} lista = [] soma = 0 while True: dict['nome'] = str(input('Nome: ')).capitalize() dict['sexo'] = str(input('Sexo: ')).strip().upper()[0] while dict['sexo'] not in 'MF': print('ERRO! Por favor, digite apenas M ou F') dict['sexo'] = str(inpu...
3.8125
4
nlp/layers/linears.py
zhihao-chen/NLP-experiments
4
15608
# -*- coding: utf8 -*- """ ====================================== Project Name: NLP File Name: linears Author: czh Create Date: 2021/11/15 -------------------------------------- Change Activity: ====================================== """ import math import torch import torch.nn as nn import torch....
2.53125
3
components/siren.py
TalaoDAO/ecole42
1
15609
import requests def company(SIREN): r = requests.get('https://entreprise.data.gouv.fr/api/sirene/v2/siren/'+SIREN+'') json_object = r.json() settings = dict() if json_object['sirene']['status'] == 404: return None if json_object['sirene']['data']['siege_social']['nom_raison_sociale'...
2.609375
3
Week 2/medt_opdracht_9.py
zowie93/ISCRIPT
0
15610
""" Opdracht 9 - Loonbrief https://dodona.ugent.be/nl/exercises/990750894/ """ # functie voor start amount def get_start_amount(): # return start amount return int(input("Start bedrag: ")) # functie voor salaris def get_salary(): # array van salaris maken salary = [] # count op nul zetten c...
3.59375
4
4.1.1-simple-object-tracking-video.py
CleverYh/opencv_py
2
15611
<reponame>CleverYh/opencv_py # coding: utf-8 from cv2 import cv2 import numpy as np cap = cv2.VideoCapture(0) while(1): # Take each frame _, frame = cap.read() # Convert BGR to HSV hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) # define range of blue color in HSV lower_blue = np.array([110,50...
3.625
4
src/peering/azext_peering/custom.py
michimune/azure-cli-extensions
1
15612
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
2.078125
2
votes/migrations/0004_team.py
aiventimptner/horizon
0
15613
<filename>votes/migrations/0004_team.py # Generated by Django 3.1.4 on 2020-12-30 00:27 from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('votes', '0003_aut...
1.625
2
Python/Day 21/score.py
Aswinpkrishnan94/Fabulous-Python
0
15614
<reponame>Aswinpkrishnan94/Fabulous-Python from turtle import Turtle FONT = ("Arial", 10, "normal") ALIGN = "center" class Score(Turtle): def __init__(self): super().__init__() self.score = 0 self.color("White") self.penup() self.goto(0, 270) self.update() s...
3.859375
4
tests/integration/testdata/buildcmd/PyLayerMake/layer.py
renanmontebelo/aws-sam-cli
2,959
15615
import numpy def layer_method(): return {"pi": "{0:.2f}".format(numpy.pi)}
2.765625
3
bcbio/qc/coverage.py
markdunning/bcbio-nextgen
0
15616
"""Coverage based QC calculations. """ import glob import os import subprocess from bcbio.bam import ref, readstats, utils from bcbio.distributed import transaction from bcbio.heterogeneity import chromhacks import bcbio.pipeline.datadict as dd from bcbio.provenance import do from bcbio.variation import coverage as co...
1.914063
2
shrike-examples/contoso/utils/arg_utils.py
lynochka/azure-ml-problem-sets
3
15617
<reponame>lynochka/azure-ml-problem-sets """ Utility functions for argument parsing """ import argparse def str2bool(val): """ Resolving boolean arguments if they are not given in the standard format Arguments: val (bool or string): boolean argument type Returns: bool: the desired va...
3.15625
3
tests/test_learner.py
luksurious/faster-teaching
2
15618
from concepts.letter_addition import LetterAddition from learners.sim_memoryless_learner import SimMemorylessLearner def test_see_example(): concept = LetterAddition(6) learner = SimMemorylessLearner(concept, list(range(0, 7))) learner.see_example(((0, 1), 10))
2.578125
3
piper/jde.py
miketarpey/piper
0
15619
import logging import pandas as pd from datetime import datetime from typing import ( Any, Callable, Dict, Hashable, Iterable, List, NamedTuple, Optional, Pattern, Set, Tuple, Union, ) logger = logging.getLogger(__name__) # add_jde_batch() {{{1...
3.09375
3
codes/utils.py
epfml/byzantine-robust-noniid-optimizer
7
15620
import os import shutil import logging class BColors(object): HEADER = "\033[95m" OK_BLUE = "\033[94m" OK_CYAN = "\033[96m" OK_GREEN = "\033[92m" WARNING = "\033[93m" FAIL = "\033[91m" END_C = "\033[0m" BOLD = "\033[1m" UNDERLINE = "\033[4m" def touch(fname: str, times=None, crea...
2.453125
2
setup.py
robertjanes/drawbot
0
15621
#!/usr/bin/env python from __future__ import division, absolute_import, print_function from setuptools import setup import os import re import shutil _versionRE = re.compile(r'__version__\s*=\s*\"([^\"]+)\"') # read the version number for the settings file with open('drawBot/drawBotSettings.py', "r") as settings: ...
2.078125
2
src/homework/i_dictionaries_sets/dictionary.py
acc-cosc-1336-spring-2022/acc-cosc-1336-spring-2022-WillCapo
0
15622
def get_p_distance(list1, list2): count = 0 i = 0 while i < len(list1): if (list1[i] != list2[i]): count += .1 i += 1 return count def get_p_distance_matrix(list1, list2, list3, list4): dna1 = get_p_distance(list1, list1), get_p_distance(list1, list2), get_p_distance(lis...
3.171875
3
watertap/examples/flowsheets/case_studies/municipal_treatment/municipal_treatment.py
avdudchenko/watertap
4
15623
<gh_stars>1-10 ############################################################################### # WaterTAP Copyright (c) 2021, The Regents of the University of California, # through Lawrence Berkeley National Laboratory, Oak Ridge National # Laboratory, National Renewable Energy Laboratory, and National Energy # Technol...
1.804688
2
lib/googlecloudsdk/sql/tools/instances/delete.py
IsaacHuang/google-cloud-sdk
0
15624
# Copyright 2013 Google Inc. All Rights Reserved. """Deletes a Cloud SQL instance.""" from googlecloudapis.apitools.base import py as apitools_base from googlecloudsdk.calliope import base from googlecloudsdk.calliope import exceptions from googlecloudsdk.core import log from googlecloudsdk.core.util import console_io...
2.234375
2
nsapiwrapper/exceptions.py
DolphDev/nsapiwrapper
0
15625
<filename>nsapiwrapper/exceptions.py """Exceptions for this library""" class NSBaseError(Exception): """Base Error for all custom exceptions""" pass class RateLimitReached(NSBaseError): """Rate Limit was reached""" class NSServerBaseException(NSBaseError): """Exceptions that the server returns""" ...
2.453125
2
src.py
edbezci/mapOverlayHumanoid
0
15626
# lines 1-4 imports the necessary libraries import pygame import os import random import math import sys import hlp import intro import dsb # this is the last module with the description files ''' declaring some global variables beacause in Python, we can set global variables that can be used in future functions se...
3.484375
3
iologik/e2210.py
shannon-jia/iologik
0
15627
import aiohttp import asyncio import async_timeout import logging from collections import namedtuple, deque from .events import Events from html.parser import HTMLParser log = logging.getLogger(__name__) class Parser(HTMLParser): def handle_starttag(self, tag, attrs): log.debug("Encountered a start tag:...
2.46875
2
apps/cmdb/verify/operate.py
yanshicheng/super-ops
0
15628
from ..models import Classify, Fields, Asset, AssetBind, ClassifyBind from django.db.models import Q from collections import OrderedDict from django.forms.models import model_to_dict class OperateInstance: @staticmethod def get_classify(id): """通过ID 查找指定分类表""" return Classify.objects.filter(id...
2.265625
2
glass/mirror.py
fwcd/glass
2
15629
<filename>glass/mirror.py import subprocess from pathlib import Path from urllib.parse import urlparse def mirror_repo(repo_url, target_dir): repo_dir = Path(str(target_dir) + urlparse(repo_url).path) repo_dir.parent.mkdir(parents=True, exist_ok=True) if repo_dir.exists(): print(f'Updating from {r...
2.8125
3
modeling/__init__.py
WinstonHuTiger/BOEMD-UNet
2
15630
import os import torch from modeling.unet import * from modeling.bAttenUnet import MDecoderUNet, MMultiBAUNet, MMultiBUNet def build_model(args, nchannels, nclass, model='unet'): if model == 'unet': return UNet( n_channels=nchannels, n_classes=nclass, bilinear=True, ...
2.296875
2
A.py
JK-Incorporated/EYN-DOS
0
15631
<filename>A.py import os from os import listdir from os.path import isfile, join dir_path = os.path.dirname(os.path.realpath(__file__)) filesys = [f for f in listdir(dir_path) if isfile(join(dir_path, f))] def get_dir_size(path=dir_path): total = 0 with os.scandir(dir_path) as it: for entry in it: ...
3.203125
3
api_site/src/api_x/application/entry/bankcard_views.py
webee/pay
1
15632
<reponame>webee/pay # coding=utf-8 from __future__ import unicode_literals from api_x.utils import response from api_x.utils.entry_auth import verify_request from flask import request from . import application_mod as mod from .. import dba from .. import bankcard from api_x.utils.parser import to_bool from pytoolbox.u...
2.1875
2
httpd/httpd.py
protocollabs/dmprd
1
15633
<reponame>protocollabs/dmprd<gh_stars>1-10 import asyncio import os try: from aiohttp import web except ImportError: web = None class Httpd(object): def __init__(self): if not web: print('httpd is specified in conf but aiohttp not available') return self.app = web...
2.5
2
SImple-Number.py
TonikaHristova/Loops
0
15634
<filename>SImple-Number.py import math num = int(input()) is_prime = True if num < 2: print("Not prime") for i in range(2, int(math.sqrt(num)+1)): if num / i == 0: is_prime = False print(is_prime)
4.09375
4
badgify/apps.py
BrendanBerkley/django-badgify
0
15635
<filename>badgify/apps.py from django.apps import AppConfig class BadgifyConfig(AppConfig): name = 'badgify' verbose_name = 'Badgify' def ready(self): super(BadgifyConfig, self).ready() self.module.autodiscover()
1.789063
2
test/test_i18n.py
timgates42/uliweb
202
15636
<gh_stars>100-1000 from uliweb.i18n import ugettext_lazy as _ def test_1(): """ >>> x = _('Hello') >>> print repr(x) ugettext_lazy('Hello') """ def test_1(): """ >>> x = _('Hello {0}') >>> print x.format('name') Hello name """
2.203125
2
KeyBoardControlImageCaptue.py
Prashant-1305/Tello-Drone
0
15637
import KeyPressModule as kp from djitellopy import tello import time import cv2 global img kp.init() skynet = tello.Tello() skynet.connect() print(skynet.get_battery()) skynet.streamon() def getKeyboardInput(): lr, fb, ud, yv = 0, 0, 0, 0 speed = 50 if kp.getKey("LEFT"): lr = -speed elif kp.getKey(...
2.6875
3
cnns/foolbox/foolbox_2_3_0/tests/test_model_zoo.py
anonymous-user-commits/perturb-net
12
15638
from foolbox import zoo import numpy as np import foolbox import sys import pytest from foolbox.zoo.model_loader import ModelLoader from os.path import join, dirname @pytest.fixture(autouse=True) def unload_foolbox_model_module(): # reload foolbox_model from scratch for every run # to ensure atomic tests with...
1.960938
2
tests/unit/nistbeacon/test_nistbeacon.py
urda/py_nist_beacon
11
15639
""" Copyright 2015-2017 <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 writing, software di...
1.867188
2
aae/auto_pose/visualization/render_pose.py
shbe-aau/multi-pose-estimation
4
15640
import cv2 import numpy as np import os from auto_pose.meshrenderer import meshrenderer from auto_pose.ae.utils import lazy_property class PoseVisualizer: def __init__(self, mp_pose_estimator, downsample=1, vertex_scale=False): self.downsample = downsample self.vertex_scale = [mp_pose_estimator...
2.21875
2
client/nodes/common/docker_subsriber.py
CanboYe/BusEdge
2
15641
<reponame>CanboYe/BusEdge<filename>client/nodes/common/docker_subsriber.py<gh_stars>1-10 # SPDX-FileCopyrightText: 2021 Carnegie Mellon University # # SPDX-License-Identifier: Apache-2.0 import cv2 import numpy as np import rospy from gabriel_protocol import gabriel_pb2 from std_msgs.msg import UInt8MultiArray def r...
2.265625
2
datx/base_station.py
ipipdotnet/datx-python
39
15642
# -*- coding: utf-8 -*- """ :copyright: ©2018 by IPIP.net """ from .district import District class BaseStation(District): pass
1.148438
1
cogs/user.py
billydevyt/RoboBilly
6
15643
""" User module """ import discord import random import asyncio from discord.ext import commands from discord.ext.commands import has_permissions, MissingPermissions, BadArgument import requests, json, pyfiglet from datetime import timedelta, datetime class User(commands.Cog): api_key = "<KEY>" base_url = "...
2.96875
3
wsu/tools/simx/simx/python/simx/protomap/util.py
tinyos-io/tinyos-3.x-contrib
1
15644
def sync_read(socket, size): """ Perform a (temporary) blocking read. The amount read may be smaller than the amount requested if a timeout occurs. """ timeout = socket.gettimeout() socket.settimeout(None) try: return socket.recv(size) finally: socket.settimeout(time...
3.25
3
mergeKsortedlist.py
ZhouLihua/leetcode
2
15645
#Definition for singly-linked list. class ListNode(object): def __init__(self, x): self.val = x self.next = None import sys class Solution(object): def mergeKLists(self, lists): """ :type lists: List[ListNode] :rtype: ListNode """ temp = ListNode(-1) ...
3.84375
4
f5/bigip/tm/vcmp/test/unit/test_virtual_disk.py
nghia-tran/f5-common-python
272
15646
<reponame>nghia-tran/f5-common-python # Copyright 2017 F5 Networks 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 b...
1.914063
2
tinylinks/admin.py
lavindiuss/django-shorter
0
15647
"""Admin sites for the ``django-tinylinks`` app.""" from django.contrib import admin from django.template.defaultfilters import truncatechars from django.utils.translation import ugettext_lazy as _ from django.template.loader import render_to_string from tinylinks.forms import TinylinkAdminForm from tinylinks.models ...
2.171875
2
wk11frontend.py
alvaro-root/pa2_2021
0
15648
import requests import json def main(): host = "http://localhost:5006" urlpattern = "/user/" response = requests.post(f"{host}{urlpattern}", json={'key1': 'random value'}) if 199 < response.status_code < 300: for k, v in response.headers.items(): print(f"{k} -> {v}") prin...
3.140625
3
software/python/XilinxKcu1500Pgp3/__init__.py
ejangelico/cryo-on-epix-hr-dev
1
15649
#!/usr/bin/env python from XilinxKcu1500Pgp3.XilinxKcu1500Pgp3 import *
0.882813
1
files/files.py
StevenKangWei/tools
15
15650
#!/usr/bin/python import os import glob import traceback import datetime import dandan from flask import Flask from flask import abort from flask import send_file from flask import send_from_directory from flask import render_template from werkzeug.routing import BaseConverter import config __VERSI...
2.453125
2
jdcloud_sdk/services/iotcore/models/DeviceVO.py
Tanc009/jdcloud-sdk-python
14
15651
# coding=utf8 # Copyright 2018 JDCLOUD.COM # # 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 ...
1.78125
2
satyrus/sat/types/__init__.py
lucasvg/Satyrus3-FinalProject-EspTopsOTM
0
15652
from .array import Array from .string import String from .problem import Constraint, Loop from .main import SatType, Var, Number from .expr import Expr
1.609375
2
magma/backend/util.py
Kuree/magma
0
15653
<reponame>Kuree/magma<filename>magma/backend/util.py import os __magma_codegen_debug_info = False if os.environ.get("MAGMA_CODEGEN_DEBUG_INFO", False): __magma_codegen_debug_info = True def set_codegen_debug_info(val): global __magma_codegen_debug_info __magma_codegen_debug_info = val def get_codegen_...
1.726563
2
src/backend/main.py
tuimac/servertools
0
15654
#!/usr/bin/env python3 from subprocess import Popen, PIPE, DEVNULL, run import socket import sys import traceback import argparse import time import logging import os logger = logging.getLogger("django") def startProcess(command, port): try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ...
2.5625
3
pyble/const/characteristic/sensor_location.py
bgromov/PyBLEWrapper
14
15655
<reponame>bgromov/PyBLEWrapper<gh_stars>10-100 NAME="Sensor Location" UUID=0x2A5D
1.15625
1
active-learning/seq_data.py
ansunsujoe/ml-research
0
15656
<reponame>ansunsujoe/ml-research import random from tqdm import tqdm def random_seq(): return [str(random.randint(1, 9)) for x in range(random.randint(2, 15))] if __name__ == "__main__": with open("sequences-1-train.txt", "w") as f: for i in tqdm(range(5000)): f.write(",".join(random_seq()...
2.453125
2
datatest/main.py
ajhynes7/datatest
277
15657
"""Datatest main program""" import sys as _sys from unittest import TestProgram as _TestProgram from unittest import defaultTestLoader as _defaultTestLoader try: from unittest.signals import installHandler except ImportError: installHandler = None from datatest import DataTestRunner __unittest = True __datat...
2.28125
2
zvmsdk/vmops.py
jasealpers/python-zvm-sdk
9
15658
<gh_stars>1-10 # Copyright 2017 IBM Corp. # # 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.890625
2
Q146.py
Linchin/python_leetcode_git
0
15659
<reponame>Linchin/python_leetcode_git """ Q146 LRU Cache Medium Author: <NAME> Date: 08/06/2019 Question: Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - Get the value (will always be positive) of the key if the key exists...
3.84375
4
bin/genparams.py
neonkingfr/VizBench
7
15660
# This script reads *VizParams.list files that define Vizlet parameters # and generates .h files for them, making runtime access to them much faster. # This allows new parameters to be added just by editing one file. import sys import os import re types={"bool":"BOOL","int":"INT","double":"DBL","string":"STR"} realt...
2.828125
3
notebooks/session_4/s3-sobelAndmatplotlib.py
bigmpc/cv-spring-2021
3
15661
<reponame>bigmpc/cv-spring-2021 import cv2 import numpy as np import matplotlib.pyplot as plt #Read the image as grayscale: image = cv2.imread('building.jpg', 0) #Compute the gradient approximations using the Sobel operator: dx = cv2.Sobel(image, cv2.CV_32F, 1, 0) dy = cv2.Sobel(image, cv2.CV_32F, 0, 1) #...
2.921875
3
reporter-cli/sql-pdf/python/src/reporterprimary/__init__.py
rgolubtsov/reporter-multilang
3
15662
<filename>reporter-cli/sql-pdf/python/src/reporterprimary/__init__.py<gh_stars>1-10 # -*- coding: utf-8 -*- # reporter-cli/sql-pdf/python/src/reporterprimary/__init__.py # ============================================================================= # Reporter Multilang. Version 0.5.9 # ================================...
1.132813
1
bem/teq_planet.py
DanielAndreasen/bem
0
15663
import numpy as np from uncertainties import umath as um def getTeqpl(Teffst, aR, ecc, A=0, f=1/4.): """Return the planet equilibrium temperature. Relation adapted from equation 4 page 4 in http://www.mpia.de/homes/ppvi/chapter/madhusudhan.pdf and https://en.wikipedia.org/wiki/Stefan%E2%80%93Boltzmann_law...
3.25
3
poppy/data_preprocess.py
phanxuanphucnd/BertTextClassification
1
15664
import pandas as pd import re import os from tqdm import tqdm ## Cleaning train raw dataset train = open('./data/raw/train.crash').readlines() train_ids = [] train_texts = [] train_labels = [] for id, line in tqdm(enumerate(train)): line = line.strip() if line.startswith("train_"): train_ids.append...
2.59375
3
websaw/core/app.py
valq7711/websaw
1
15665
<filename>websaw/core/app.py<gh_stars>1-10 import functools from types import SimpleNamespace from typing import List from . import globs from .context import BaseContext from .exceptions import FixtureProcessError from .reloader import Reloader from .static_registry import static_registry def _dummy_exception_handl...
2.015625
2
observations/r/chest_sizes.py
hajime9652/observations
199
15666
<reponame>hajime9652/observations # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import csv import numpy as np import os import sys from observations.util import maybe_download_and_extract def chest_sizes(path): """Chest measure...
3.25
3
setup.py
google/ads-api-reports-fetcher
4
15667
import pathlib from setuptools import setup, find_packages HERE = pathlib.Path(__file__).parent README = (HERE / "README.md").read_text() setup(name="google-ads-api-report-fetcher", version="0.1", description="Library for fetching reports from Google Ads API and saving them locally / BigQuery.", lo...
1.65625
2
scan_service/scan_service/utils/stats.py
kkkkv/tgnms
12
15668
<gh_stars>10-100 #!/usr/bin/env python3 # Copyright 2004-present Facebook. All Rights Reserved. import asyncio import logging import time from collections import defaultdict from typing import DefaultDict, Dict, List from tglib.clients.prometheus_client import PrometheusClient, consts from tglib.exceptions import Cli...
2.265625
2
multithread_pipeline.py
kapitsa2811/smartOCR
0
15669
import glob import os from io import StringIO from threading import Thread import logging from logger import TimeHandler from costants import THREADS, INFERENCE_GRAPH from pipeline import pipeline logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) logger.addHandler(TimeHandler().handler) ...
2.265625
2
src/keys_server/GMO/GMOKeysLookup.py
OasisLMF/gem
0
15670
<filename>src/keys_server/GMO/GMOKeysLookup.py # -*- coding: utf-8 -*- # Python 2 standard library imports import csv import io import logging import os # Python 2 non-standard library imports import pandas as pd # Imports from Oasis core repos + subpackages or modules within keys_server from oasislmf.utils.coverage...
2.375
2
pandemic_eval.py
aypan17/value_learning
0
15671
import time import sys import json import argparse from tqdm import trange from typing import Any, Callable, Dict, List, Optional, Tuple, Union import torch import numpy as np from scipy.spatial.distance import jensenshannon import gym import matplotlib.pyplot as plt from matplotlib.axes import Axes fr...
2.203125
2
WagerBrain/odds.py
sedemmler/WagerBrain
83
15672
<reponame>sedemmler/WagerBrain<filename>WagerBrain/odds.py from fractions import Fraction from math import gcd import numpy as np """ Convert the style of gambling odds to Function Name (Decimal, American, Fractional). TO DO: Fix edge case related to Fraction module that causes weird rounding / slightly off output ...
3.5
4
GANs/jsigan/ops.py
JonathanLehner/nnabla-examples
0
15673
<filename>GANs/jsigan/ops.py # Copyright (c) 2017 Sony 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 License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
1.796875
2
neptune/internal/hardware/gpu/gpu_monitor.py
neptune-ml/neptune-client
13
15674
<gh_stars>10-100 # # Copyright (c) 2019, Neptune Labs Sp. z o.o. # # 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 appl...
1.6875
2
tests/redis_map.py
jaredlunde/redis_structures
2
15675
<reponame>jaredlunde/redis_structures #!/usr/bin/python3 -S # -*- coding: utf-8 -*- """ `Redis Map Tests` --·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·-- 2015 <NAME> © The MIT License (MIT) http://github.com/jaredlunde """ import datetime import time import pickle import unitt...
2.484375
2
examples/parser_example.py
pibico/beacontools
139
15676
<gh_stars>100-1000 # -*- coding: utf-8 -*- from beacontools import parse_packet # Eddystone UID packet uid_packet = b"\x02\x01\x06\x03\x03\xaa\xfe\x17\x16\xaa\xfe\x00\xe3\x12\x34\x56\x78\x90\x12" \ b"\x34\x67\x89\x01\x00\x00\x00\x00\x00\x01\x00\x00" uid_frame = parse_packet(uid_packet) print("Namespace: ...
2.375
2
mlsurvey/sl/workflows/multiple_learning_workflow.py
jlaumonier/mlsurvey
0
15677
<gh_stars>0 from kedro.io import DataCatalog, MemoryDataSet from kedro.pipeline import Pipeline from kedro.runner import SequentialRunner import mlsurvey as mls from mlsurvey.workflows.learning_workflow import LearningWorkflow class MultipleLearningWorkflow(LearningWorkflow): def run(self): """ ...
2.25
2
backend/apps/cmdb/migrations/0001_initial.py
renmcc/SA2
4
15678
<reponame>renmcc/SA2<filename>backend/apps/cmdb/migrations/0001_initial.py # Generated by Django 2.2.12 on 2020-06-15 16:55 import datetime from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('project', '0...
1.796875
2
sphecius/ciphers/base.py
douglasdaly/sphecius
1
15679
# -*- coding: utf-8 -*- """ base.py Base Cipher Object class @author: <NAME> @date: 1/12/2017 """ # # Imports # from abc import ABCMeta, abstractmethod from ..alphabets import English # # Classes # class Cipher(object, metaclass=ABCMeta): """ Base Cipher Class """ def __init__(self, alpha...
3.6875
4
setup.py
codewars/python-unittest
4
15680
from setuptools import setup setup( name="codewars_unittest", version="0.1.0", packages=["codewars_unittest"], license="MIT", description="unittest runner with Codewars output", install_requires=[], url="https://github.com/Codewars/python-unittest", )
1.1875
1
code/python/FactSetFunds/v1/fds/sdk/FactSetFunds/model/classifications.py
factset/enterprise-sdk
6
15681
<filename>code/python/FactSetFunds/v1/fds/sdk/FactSetFunds/model/classifications.py """ FactSet Funds API FactSet Mutual Funds data offers over 50 fund- and share class-specific data points for mutual funds listed in the United States. <p>FactSet Mutual Funds Reference provides fund-specific reference informat...
1.914063
2
tests/test_drc.py
atait/lymask
3
15682
<reponame>atait/lymask<gh_stars>1-10 import os, sys import subprocess import xmltodict import lymask from lymask import batch_drc_main from conftest import test_dir drc_file = os.path.join(test_dir, 'tech', 'lymask_example_tech', 'drc', 'default.yml') layout_file = os.path.join(test_dir, '2_drc_src.oas') outfile = os...
1.84375
2
graphviz/parameters/formatters.py
boeddeker/graphviz
1
15683
<filename>graphviz/parameters/formatters.py """Rendering formatter parameter handling.""" import typing from . import base __all__ = ['FORMATTERS', 'verify_formatter', 'Formatter'] FORMATTERS = {'cairo', 'core', 'gd', 'gdiplus', 'gdwbmp', 'xlib'}...
2.53125
3
reward/utils/device.py
lgvaz/torchrl
5
15684
import torch CONFIG = {"device": torch.device("cuda" if torch.cuda.is_available() else "cpu")} def get(): return CONFIG["device"] def set_device(device): CONFIG["device"] = device
2.5625
3
Source/Functions/RPSLS.Python.Api/NextMove/next_move.py
ivan-b-ivanov/RockPaperScissorsLizardSpock
0
15685
import logging import random import os import json from typing import Tuple, List import requests def predict(player_name: str) -> str: next_move = _predict_next_move(*_get_player_games(player_name)) return _convert_game_to_json(next_move) R_rock, P_paper, S_scissors, V_spock, L_lizard = ('R', ...
2.828125
3
examples/trials/nas_cifar10/src/cifar10/nni_child_cifar10.py
runauto/nni
2
15686
<reponame>runauto/nni from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import shutil import logging import tensorflow as tf from src.cifar10.data_utils import read_data from src.cifar10.general_child import GeneralChild import src.cifar10_flags from ...
1.953125
2
apps/oper/apps.py
dryprojects/MyBlog
2
15687
from django.apps import AppConfig class OperConfig(AppConfig): name = 'oper' verbose_name = '用户操作管理' def ready(self): from oper import signals
1.546875
2
stella/core/interpreter/lexer.py
xabinapal/stella
0
15688
# -*- coding: utf-8 -*- import io import collections from stella.core.utils import RewindableIterator from stella.core.interpreter.productions import Token __all__ = ['Tokenizer', 'Lexer'] ################################################################################ ### Tokenizer ################################...
2.65625
3
tensorflow_v1/10_-_Sequence-to-sequence/03_-_Dynamic_attention_with_par-inject.py
mtanti/deeplearningtutorial
5
15689
import matplotlib.pyplot as plt import numpy as np import tensorflow as tf tf.logging.set_verbosity(tf.logging.ERROR) max_epochs = 6000 init_stddev = 0.0001 source_embedding_size = 2 target_embedding_size = 2 source_state_size = 2 preattention_size = 2 target_state_size = 2 max_seq_len = 10 source_tokens = [ ...
2.3125
2
lnd/utils.py
gsmadi/lightningpy
0
15690
import codecs def encode_macaroon(macaroon): encoded_macaroon = codecs.encode(macaroon, 'hex') return encoded_macaroon def read_file(file_path): opened_file = open(file_path, 'rb').read() return opened_file
2.953125
3
ctapipe/image/muon/ring_fitter.py
chaimain/ctapipe
53
15691
import numpy as np from ctapipe.core import Component from ctapipe.containers import MuonRingContainer from .fitting import kundu_chaudhuri_circle_fit, taubin_circle_fit import traitlets as traits # the fit methods do not expose the same interface, so we # force the same interface onto them, here. # we also modify th...
2.40625
2
Main.py
dalwindercheema/FWPython
2
15692
<filename>Main.py import pandas as pd from os import listdir import numpy from sklearn.model_selection import StratifiedKFold from FS_ALO import WFS from FW_ALO import WFW from WFSWFW_ALO import WFSWFW import matplotlib.pyplot as plt def main_CV(): path='./datasets' direc=sorted(listdir(path)) ...
2.515625
3
demo/demo/models.py
dracarysX/django-rest-query
2
15693
#! /usr/bin/env python # -*-coding: utf-8 -*- __author__ = 'dracarysX' from django.db import models class Publisher(models.Model): id = models.AutoField(primary_key=True) name = models.CharField(max_length=100) class Meta: db_table = 'Publisher' def __str__(self): return 'Publisher:...
2.671875
3
feedback-api/src/api/services/feedback/feedback_camunda_service.py
josekudiyirippil/queue-management
30
15694
<filename>feedback-api/src/api/services/feedback/feedback_camunda_service.py # Copyright © 2019 Province of British Columbia # # 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...
2.53125
3
dezede/urls.py
dezede/dezede
15
15695
from django.conf import settings from django.conf.urls import * from django.conf.urls.static import static from django.contrib import admin from django.contrib.sitemaps.views import sitemap from django.views.decorators.cache import cache_page from django.views.generic import TemplateView from ajax_select import urls as...
1.640625
2
database/chemtrack/contacts.py
mshobair/invitro_cheminformatics
0
15696
<gh_stars>0 import datetime from database.database_schemas import Schemas from sqlalchemy import Column, Integer, String, DateTime from database.base import Base class Contacts(Base): """Maps to contacts table in chemprop databases.""" __tablename__ = 'contacts' __table_args__ = {'schema': Schemas.qsar...
2.453125
2
otter/generate/autograder.py
drjbarker/otter-grader
0
15697
<gh_stars>0 """ Gradescope autograder configuration generator for Otter Generate """ import os import json import shutil # import subprocess import zipfile import tempfile import pathlib import pkg_resources import yaml from glob import glob from subprocess import PIPE from jinja2 import Template from .token import ...
2.40625
2
setup.py
m-aciek/python-sdk
0
15698
<filename>setup.py #!/usr/bin/env python import os import re import codecs from setuptools import setup, find_packages ground = os.path.abspath(os.path.dirname(__file__)) def read(filename): with codecs.open(os.path.join(ground, filename), 'rb', 'utf-8') as file: return file.read() metadata = read(os....
1.90625
2
big-picture-spectra/big-picture-spectra.py
aibhleog/plotting-playground
0
15699
''' This script makes an image very similar to Figure 2 of Hutchison et al. 2019 (https://arxiv.org/pdf/1905.08812.pdf). Undoubtedly, there are likely simpler ways to make this figure -- this is how I chose to code it up. Because the figure in the paper uses some proprietary data, the code below will generate fake dat...
2.6875
3