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
scripts/google_client.py
hypothe/dialogflow_ros
0
28100
#!/usr/bin/env python # from google.cloud import speech from google.cloud import speech_v1p1beta1 as speech from google.cloud.speech_v1p1beta1 import enums from google.cloud.speech_v1p1beta1 import types from google.api_core.exceptions import InvalidArgument, OutOfRange import pyaudio import Queue import rospy import ...
2.71875
3
huaweicloud-sdk-as/huaweicloudsdkas/v1/model/callback_life_cycle_hook_option.py
wuchen-huawei/huaweicloud-sdk-python-v3
1
28101
# coding: utf-8 import pprint import re import six class CallbackLifeCycleHookOption: """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and ...
2.4375
2
gui.py
TheAlienBee/Search_and_Apply
0
28102
import tkinter as tk #tkinter is our gui lib. import webbrowser #webbrowser allows us to open user's default web browser. good for clicking on links. import jsonlines import io import genCoverLetter as gcl from Search_and_Apply.Search_and_Apply.spiders.IndeedSpider import searchFor from Search_and_Apply.Search_...
2.703125
3
followthemoney/model.py
dschulz-pnnl/followthemoney
0
28103
<reponame>dschulz-pnnl/followthemoney<gh_stars>0 import os import yaml from followthemoney.types import registry from followthemoney.schema import Schema from followthemoney.mapping import QueryMapping from followthemoney.proxy import EntityProxy from followthemoney.exc import InvalidModel, InvalidData class Model(o...
2.25
2
constants.py
supro200/sdwan-auto-upgrade
2
28104
<reponame>supro200/sdwan-auto-upgrade JUMPHOST = "jumphost" VMANAGE = "10.121.6.35" AZURE_STORAGE_ACCOUNT = "azure-storage-account"
0.839844
1
api_v1/urls.py
yogoh31/Repath-App-Backend
0
28105
<filename>api_v1/urls.py from django.urls import path from rest_framework_simplejwt.views import ( TokenObtainPairView, TokenRefreshView, ) from .views import ( RegisterView, UserDetail, LocationList, LocationDetail, FavoritePlaceList, FavoritePlaceDetail, ObstacleList, Obstacle...
2.046875
2
vp_suite/models/precipitation_nowcasting/ef_conv_lstm.py
AIS-Bonn/vp-suite
3
28106
from collections import OrderedDict from vp_suite.model_blocks import ConvLSTM from vp_suite.models.precipitation_nowcasting.ef_blocks import Encoder_Forecaster class EF_ConvLSTM(Encoder_Forecaster): r""" This is a reimplementation of the Encoder-Forecaster model based on ConvLSTMs, as introduced in "Con...
2.34375
2
dataPreparation/src/so_helper.py
boneyag/msr-2022
0
28107
<gh_stars>0 from bs4 import BeautifulSoup from bs4 import SoupStrainer import sys def get_paragraphs(post_content): paragraphs = list() only_p_tags = SoupStrainer(["p", "h1", "h2", "h3", "h4", "h5", "h6", "li", ]) soup = BeautifulSoup(post_content, "lxml", parse_only=only_p_tags) for paragraph in soup: #repl...
3.140625
3
src/xiyanghong.py
1332927388/-
0
28108
<gh_stars>0 from iFinDPy import * import datetime as dt import time import datetime import pandas as pd import statsmodels.api as sm import numpy as np import talib def initialize(account): account.a_periods=10 # 持有日期上限 account.b_periods=3 # 持有日期上限 account.hold={} # 记录持有天数情况 account.holdSl...
2.015625
2
nbpkg/pkginspect/nbpkgdescr.py
kiaderouiche/nbpkgquery
1
28109
# -*- coding: utf-8 -*- ''' nbpkg defspec ''' NBPKG_MAGIC_NUMBER = b'\x1f\x8b' NBPKG_HEADER_MAGIC_NUMBER = '\037\213' NBPKGINFO_MIN_NUMBER = 1000 NBPKGINFO_MAX_NUMBER = 1146 # data types definition NBPKG_DATA_TYPE_NULL = 0 NBPKG_DATA_TYPE_CHAR = 1 NBPKG_DATA_TYPE_INT8 = 2 NBPKG_DATA_TYPE_INT16 = 3 NBPKG_DATA_TYPE_IN...
1.320313
1
utils/speakerid.py
JaejinCho/espnet
4
28110
<filename>utils/speakerid.py import torch import torch.nn as nn import math import torch.utils.model_zoo as model_zoo import numpy as np from scipy.fftpack import dct, idct from scipy import linalg as la import torch.nn.functional as F import logging def conv3x3(in_planes, out_planes, stride=1): """3x3 convolution...
2.4375
2
import_data.py
plug8955/python-mysql-excel
0
28111
from openpyxl import load_workbook import mysql.connector # Excel workbook = load_workbook('imported.xlsx') sheet = workbook.active values = [] for row in sheet.iter_rows(min_row=2, values_only=True): print(row) values.append(row) # Database db = mysql.connector.connect( host='localhost', port=3306,...
2.734375
3
pytorch_pfn_extras/nn/modules/lazy.py
kmaehashi/pytorch-pfn-extras
0
28112
# mypy: ignore-errors import inspect from typing import Tuple import warnings import torch class LazyInitializationMixin: """A mixin for modules that lazily initialize buffers and parameters. Unlike regular modules, subclasses of this module can initialize buffers and parameters outside of the constru...
2.59375
3
tensorflow/python/keras/distribute/mnist_multi_worker.py
6paklata/tensorflow
2
28113
<filename>tensorflow/python/keras/distribute/mnist_multi_worker.py<gh_stars>1-10 # Copyright 2019 The TensorFlow 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 ...
1.828125
2
src/misc/decorator.py
JunManYuanLong/PyComs
0
28114
#!/usr/bin/python # -*- coding: utf-8 -*- from copy import deepcopy from functools import wraps from flask import request from src.misc.render import json_detail_render from config.settings import YML_JSON, logger import datetime,json def transfer(column): def dec(func): @wraps(func) ...
2.5
2
modules/tools/open_space_visualization/open_space_roi_visualizer.py
jzjonah/apollo
22,688
28115
#!/usr/bin/env python3 ############################################################################### # Copyright 2018 The Apollo 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...
2.25
2
build.py
MolGL/MolGL
2
28116
<reponame>MolGL/MolGL<filename>build.py #!/usr/bin/env python # -*- coding: utf-8 -*- # ———————————————————————————————————————————————————————————————————————————— # Copyright © 2014 - 2016, Sequømics Research, All rights reserved. # Copyright © 2014 - 2016, Sequømics Corporation. All rights reserved. # —————————————...
1.164063
1
adapted_network.py
Hong-Ming/Adaptive_Network_Slimming
0
28117
import sys sys.path.append('./train_model') import torch import torch.nn as nn import torch.nn.functional as F import torchvision import torchvision.transforms as transforms import numpy as np import os import argparse parser = argparse.ArgumentParser(description='Adaptive Network Slimming') parser.add_argument('-n...
2.375
2
mcetl/user/access.py
materials-commons/pymcetl
0
28118
from flask import request from ..utils.mcexceptions import AccessNotAllowedException from . import apikeydb from ..database.DB import DbConnection _user_access_matrix = {} _admins = [] def check(user, owner, project_id="Unknown"): if not allowed(user, owner, project_id): raise AccessNotAllowedException(p...
2.40625
2
arxivtimes_indicator/server/__init__.py
chakki-works/arXivTimesIndicator
34
28119
from .server import Application
1.195313
1
national-rail/stations_and_services_scraper/config/aws_config.py
weizhi-luo/commute
0
28120
"""Represent AWS config settings""" import json from typing import Iterable, Mapping import boto3 from datetime import datetime, timedelta from data_model import OriginAndCallingPointNames from .config import ConfigSettings class AwsAppConfigSettings(ConfigSettings): """Represent a collection of config settings...
2.546875
3
src/tests/test_loading.py
danmysak/ipa-parser
0
28121
<reponame>danmysak/ipa-parser from timeit import timeit from unittest import TestCase from ..ipaparser import IPA, load __all__ = [ 'TestLoading', ] FACTOR = 10.0 def is_much_larger(a: float, b: float) -> bool: return a > b * FACTOR def are_roughly_equal(a: float, b: float) -> bool: return not is_muc...
2.953125
3
src/v2/log.py
Strangemother/project-conceptnet-graphing
0
28122
import logging logging.basicConfig(level=logging.DEBUG) def log(*a): logging.info(' '.join(map(str, a))) warn = logging.warn
2.40625
2
Newbies/namedtuple.py
Fernal73/LearnPython3
1
28123
#!/usr/bin/env python3 """Named tuple example.""" from collections import namedtuple Car = namedtuple('Car', 'color mileage') # Our new "Car" class works as expected: MY_CAR = Car('red', 3812.4) print(MY_CAR.color) print(MY_CAR.mileage) # We get a nice string repr for free: print(MY_CAR) try: MY_CAR.color = 'bl...
3.921875
4
tests/components/blebox/test_config_flow.py
pcaston/core
1
28124
"""Test Open Peer Power config flow for BleBox devices.""" from unittest.mock import DEFAULT, AsyncMock, PropertyMock, patch import blebox_uniapi import pytest from openpeerpower import config_entries, data_entry_flow from openpeerpower.components.blebox import config_flow from openpeerpower.setup import async_setup...
2.34375
2
train.py
turbohiro/IDCard_detection
0
28125
<reponame>turbohiro/IDCard_detection import numpy as np import matplotlib.pyplot as plt import os import cv2 import glob import seaborn as sns from PIL import Image import glob import tensorflow as tf import model os.environ['CUDA_VISIBLE_DEVICES']='0' dataDir = '/data/jupyter/libin713/sample_IDCard' def read_and_dec...
2.515625
3
zeus/brewery/models.py
sdivakarrajesh/Zeus
0
28126
<reponame>sdivakarrajesh/Zeus<gh_stars>0 from django.db import models # Create your models here. class DrinkType(models.Model): created = models.DateTimeField(auto_now_add=True, blank=True, null=True) updated = models.DateTimeField(auto_now=True, blank=True, null=True) title = models.CharField(max_length...
2.546875
3
src/IntraCodec.py
Joao-Nogueira-gh/video-compressin
0
28127
## @class IntraCodec # Module designed for encoding and decoding YUV videos using the intra-frame method # That is considering adjacent pixels in the same frame and encoding their errors # @author <NAME> 89005 # @author <NAME> 89262 import numpy as np import math from Golomb import * from Bitstream import * class In...
3.03125
3
main.py
kylecorry31/lifx_effects
0
28128
<filename>main.py from effects.keyboard_effect import KeyboardEffect from utils.lights import get_lights from effects.candle_effect import CandleEffect from effects.phasma_hunt_effect import PhasmaHuntEffect from effects.audio_spectrum_effect import AudioSpectrumEffect from effects.audio_amplitude_effect import AudioAm...
2.09375
2
arts_localisation/beam_models/__init__.py
loostrum/arts_localisation
1
28129
#!/usr/bin/env python from .beamformer import BeamFormer from .compound_beam import CompoundBeam from .sb_generator import SBGenerator from .simulate_sb_pattern import SBPattern __all__ = ['BeamFormer', 'CompoundBeam', 'SBPattern', 'SBGenerator']
1.03125
1
gfauto/gfauto/test_util.py
KishkinJ10/graphicsfuzz
519
28130
# -*- coding: utf-8 -*- # Copyright 2019 The GraphicsFuzz Project Authors # # 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 requi...
2.109375
2
core.py
iBug/OmniAE
0
28131
# LOL. Hope you're not fooled by the name of this file import sys import os from configparser import ConfigParser # Note: All classes here have N801 (CapWords naming convention) disabled. # They're intended to be singletons class Object(object): def __init__(self, _default=None, **kwargs): self.__dict...
2.25
2
tests/test_transforms.py
KIT-MBS/nnicotine
2
28132
from collections import OrderedDict from pytest import approx def test_RandomDrop(): sample = None raise def test_TrimToTarget(): raise def test_ComputeCouplings(): raise def test_ToCategorical(): raise def test_ToTensor_sample(): raise def test_ToTensor_label(): raise def test_ToDis...
1.9375
2
table_creation/queryinfo.py
ashleyeah/spotifyu
0
28133
<reponame>ashleyeah/spotifyu import spotipy from spotipy.oauth2 import SpotifyClientCredentials import mysql.connector auth_manager = SpotifyClientCredentials('<KEY>', 'b51d135ad7104add8f71933197e9cc14') sp = spotipy.Spotify(auth_manager=auth_manager) cnx = mysql.connector.connect(user='root', password='<PASSWORD>', ...
3.015625
3
tests/data23/recipe-491264.py
JohannesBuchner/pystrict3
1
28134
import socket class DNSQuery: def __init__(self, data): self.data=data self.dominio='' tipo = (ord(data[2]) >> 3) & 15 # Opcode bits if tipo == 0: # Standard query ini=12 lon=ord(data[ini]) while lon != 0: self.dominio+=data[ini+1:ini+lon+1]+'.' ...
2.8125
3
calculator.py
anon-cand/nexpreval
0
28135
<filename>calculator.py import os import logging from pathlib import Path from operations import catalogue from parsers import XMLSpecParser class ExpressionCalculator: """ Processes all expression files with given extension in source directory Assumes that all files with given extension are expression fi...
3.40625
3
tinkup.py
jeromedontdev/tinkup
2
28136
<filename>tinkup.py from cgitb import text import queue from random import seed import serial import serial.tools.list_ports from signal import signal, SIGINT import sys import threading import time import tkinter from tkinter import END, W, PhotoImage, filedialog as fd, scrolledtext as sd global fw_filename fw_filena...
2.28125
2
backend/src/analytics/admin.py
codingforentrepreneurs/Geolocator-2
34
28137
<gh_stars>10-100 from django.contrib import admin # Register your models here. from .models import UserSession admin.site.register(UserSession)
1.109375
1
calculators/loan_calculator.py
wanderindev/financial-calculator-backend
2
28138
from math import ceil from numpy_financial import nper, pmt, rate from typing import List, Tuple from .calculator import Calculator # noinspection PyTypeChecker class LoanCalculator(Calculator): def __init__(self, **kwargs): super(LoanCalculator, self).__init__(**kwargs) self.loan = ...
2.75
3
pydundas/tests/rest/test_project.py
autonopy/pydundas
4
28139
import unittest from pydundas import Api class TestProject(unittest.TestCase): def test_no_syntax_error(self): self.assertIsNotNone(Api(None).project())
2.359375
2
odoo/custom/src/private/nxpo_budget_revision_monitoring_project/report/budget_monitor_revision_report.py
Saran440/nxpo
0
28140
<reponame>Saran440/nxpo<filename>odoo/custom/src/private/nxpo_budget_revision_monitoring_project/report/budget_monitor_revision_report.py # Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import fields, models class BudgetMonitorRevisi...
1.515625
2
src/ClusterManager/cluster_manager.py
nautilusshell/QianJiangYuan
0
28141
<filename>src/ClusterManager/cluster_manager.py #!/usr/bin/python # -*- coding: UTF-8 -*- import json import os import time import argparse import uuid import subprocess import sys import datetime import yaml from jinja2 import Environment, FileSystemLoader, Template import base64 import re import thread import th...
2
2
netmiko/ssh_exception.py
dalekirkman1/netmiko
1
28142
from paramiko.ssh_exception import SSHException from paramiko.ssh_exception import AuthenticationException class NetmikoTimeoutException(SSHException): """SSH session timed trying to connect to the device.""" pass class NetmikoAuthenticationException(AuthenticationException): """SSH authentication exce...
2.796875
3
src/REUTER.py
Qinaty/POA-spiders
0
28143
import time from bs4 import BeautifulSoup from base import * from db_info import * # 构建映射url->article _url2atc = dict() month = dict({'Jan':1, 'Feb':2, 'Mar':3, 'Apr':4, 'May':5, 'Jun':6, 'Jul':7, 'Aug':8, 'Sep':9, 'Oct':10, 'Nov':11, 'Dec':12}) class REUTERURLManager(BaseURLManager): ...
2.90625
3
core/management_utils.py
crydotsnake/djangogirls
446
28144
import djclick as click from django.conf import settings from django.utils.translation import gettext_lazy as _ from .forms import AddOrganizerForm from .slack_client import slack # "Get organizers info" functions used in 'new_event' and 'copy_event' management commands. def get_main_organizer(): """ We're ...
2.609375
3
conference/forms/__init__.py
zevaverbach/epcon
0
28145
<filename>conference/forms/__init__.py from .forms import * # noqa from .talks import * # noqa
1.0625
1
siggregator/siggregator.py
packmad/Siggregator
3
28146
<gh_stars>1-10 #!/usr/bin/env python3 import hashlib import json import magic import os import re import subprocess import sys import yara import ordlookup import pefile import ssdeep import tlsh from multiprocessing import Pool from os.path import isdir, isfile, join, basename, abspath, dirname, realpath from pathli...
2.078125
2
rakesh_factorial.py
vinaymavi/alivenet-python-training-
0
28147
<reponame>vinaymavi/alivenet-python-training- #Write a program which can compute the factorial of a given numbers. #The results should be printed in a comma-separated sequence on a single line number=int(input("Please Enter factorial Number: ")) j=1 fact = 1 for i in range(number,0,-1): fact =fact*i print(fact)
3.90625
4
.old/core/conf/_settings.py
Zadigo/Emails
0
28148
import datetime import json import os import secrets from importlib import import_module # PATH = 'C:\\Users\\Zadigo\\Documents\\Apps\\zemailer\\app\\core\\settings.json' PATH = os.path.join(os.getcwd(), 'app', 'core', 'conf', 'settings.json') def deserialize(func): """A decorator that deserializes objects store...
2.703125
3
tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/setup.py
hito0512/Vitis-AI
848
28149
# Copyright 2019 The TensorFlow 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/licenses/LICENSE-2.0 # # Unless required by applica...
1.703125
2
perses/samplers/__init__.py
schallerdavid/perses
99
28150
from perses.samplers.samplers import *
1.078125
1
main.py
ROHITH-Singh/DataScience-Scrappping
0
28151
<gh_stars>0 import requests import pymongo from pymongo import MongoClient import json from bs4 import BeautifulSoup cluster= MongoClient("mongodb+srv://admin:<EMAIL>/Novelore?retryWrites=true&w=majority") db=cluster["Novelore"] collection=db["mangadex-scrap"] url="https://mangadex.org" data=list() r=reques...
2.90625
3
Leetcode/Stacks,_Queues/1_-_Easy/933._Number_of_Recent_Calls.py
Khalid-Sultan/Algorithms-Prep
1
28152
from collections import deque class RecentCounter: def __init__(self): self.buffer = deque() def ping(self, t: int) -> int: while self.buffer and self.buffer[-1]<t-3000: self.buffer.pop() self.buffer.appendleft(t) return len(self.buffer) #Your RecentCounter object wi...
3.375
3
ssqueezepy/viz_toolkit.py
hydrogeoscience/ssqueezepy
3
28153
<filename>ssqueezepy/viz_toolkit.py # -*- coding: utf-8 -*- """Convenience visual methods""" import numpy as np import matplotlib.pyplot as plt def imshow(data, title=None, show=1, cmap=None, norm=None, complex=None, abs=0, w=None, h=None, ridge=0, ticks=1, yticks=None, aspect='auto', **kw): kw['interp...
2.25
2
tests/tests.py
mghorbani2357/Necrypt
1
28154
from unittest import TestCase from necrypt import Necrypt import os class TestNecrypt(TestCase): def test_unique_encryption(self): n = Necrypt(1024) plain = 'Text' self.assertNotEqual(n.encrypt(plain), n.encrypt(plain)) def test_encrypt_decrypt(self): n = Necrypt(1024) ...
3.0625
3
days/01-03-datetimes/code/calc_dts.py
greywidget/100daysofcode-with-python-course
0
28155
<reponame>greywidget/100daysofcode-with-python-course from datetime import date, timedelta start_100days = date(2017, 3, 30) pybites_founded = date(2016, 12, 19) pycon_date = date(2018, 5, 8) def get_hundred_days_end_date(): """Return a string of yyyy-mm-dd""" end_date = start_100days + timedelta(days=100) ...
3.8125
4
openprocurement/audit/monitoring/views/monitoring.py
ProzorroUKR/openprocurement.audit.api
1
28156
<reponame>ProzorroUKR/openprocurement.audit.api<filename>openprocurement/audit/monitoring/views/monitoring.py from logging import getLogger from pyramid.security import ACLAllowed from openprocurement.audit.api.constants import ( MONITORING_TIME, ELIMINATION_PERIOD_TIME, ELIMINATION_PERIOD_NO_VIOLATIONS_T...
1.585938
2
tests/utilities/test_spectrum_utils.py
jason-neal/companion_simulations
1
28157
import os import numpy as np import pytest from spectrum_overload import Spectrum from mingle.utilities.spectrum_utils import load_spectrum, select_observation @pytest.mark.parametrize("fname", ["HD30501-1-mixavg-tellcorr_1.fits", "HD30501-1-mixavg-h2otellcorr_1.fits"]) def test_load_spectrum(fname): fname = os...
2.359375
2
bots/raspador_template/raspador_template_pilot.py
xyla-io/raspador
0
28158
<gh_stars>0 from raspador import Pilot, UserInteractor, BrowserInteractor from typing import Dict, List class RaspadorTemplatePilot(Pilot): config: Dict[str, any] sign_in_wait = 3.0 def __init__(self, config: Dict[str, any], user: UserInteractor, browser: BrowserInteractor): self.config = config super()...
2.4375
2
umychart_python/umychart_complier_testcase.py
tokenchain/HQChart
4
28159
# 开源项目 https://github.com/jones2000/HQChart import sys import codecs import webbrowser from umychart_complier_jscomplier import JSComplier, SymbolOption, HQ_DATA_TYPE from umychart_complier_jscomplier import ScriptIndexConsole, ScriptIndexItem, SymbolOption, RequestOption, HQ_DATA_TYPE, ArgumentItem from umycha...
2.765625
3
einguteswerkzeug/helpers/__init__.py
s3h10r/einguteswerkzeug
6
28160
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ some helper funcs """ import json import logging import os import site import subprocess import sys import tempfile import exifread from PIL import Image PACKAGE_NAME = "einguteswerkzeug" # --- configure logging log = logging.getLogger(__name__) log.setLevel(logging...
2.421875
2
ParadoxTrading/EngineExt/Futures/InterDayOnlineMarketSupply.py
gsamarakoon/ParadoxTrading
95
28161
<filename>ParadoxTrading/EngineExt/Futures/InterDayOnlineMarketSupply.py import logging import typing from datetime import datetime from ParadoxTrading.Engine import MarketSupplyAbstract, ReturnMarket, ReturnSettlement from ParadoxTrading.Fetch import FetchAbstract from ParadoxTrading.Utils import DataStruct class I...
2.390625
2
bdd/contact_stepts.py
SvetlanaPopova/python_1
0
28162
__author__ = 'User' from pytest_bdd import given, when, then from model.contact import Contact import random @given('a contact list') def contact_list(db): return db.get_contact_list() @given('a contact with <firstname>, <lastname>, <address> and <mobilephone>') def new_contact(firstname, lastname, address, mobi...
2.59375
3
tests/models/input/types/test_file_input.py
TheLabbingProject/django_analyses
1
28163
<gh_stars>1-10 from django.core.exceptions import ValidationError from django.test import TestCase from django_analyses.models.input.types.input_types import InputTypes from tests.factories.input.types.file_input import FileInputFactory class FileInputTestCase(TestCase): """ Tests for the :class:`~django_anal...
2.6875
3
videoarchiver.py
yannisHD/StreamRecorder
0
28164
<reponame>yannisHD/StreamRecorder #!/usr/bin/python """A concise tool for archiving video as it is recorded. """ import os, time, argparse import subprocess32 as subprocess from socket import gethostname import dvrutils def read_archive_config(fName): with open(fName, 'r') as f: flines = f.readlines() ...
2.875
3
test_nlp_util.py
kenttw/2021-bitbrain-shopee
0
28165
<reponame>kenttw/2021-bitbrain-shopee<filename>test_nlp_util.py import nlp_util def testGC(): raw_address = 'isn s.h. & rekan, somba opu 76' result = nlp_util.genCC(raw_address) print(result) assert result def test_getPair(): # label, raw = "hanief sembilan mtr -h", "kuripan hanief semb mtr -h, g...
2.4375
2
mlprimitives/adapters/keras.py
Hector-hedb12/MLPrimitives
0
28166
<filename>mlprimitives/adapters/keras.py # -*- coding: utf-8 -*- import logging import tempfile import keras import numpy as np from mlprimitives.utils import import_object LOGGER = logging.getLogger(__name__) class Sequential(object): """A Wrapper around Sequential Keras models with a simpler interface.""" ...
2.5625
3
src/django_perf_rec/settings.py
adamchainz/django-perf-rec
147
28167
import sys from typing import Any from django.conf import settings if sys.version_info >= (3, 8): from typing import Literal ModeType = Literal["once", "none", "all"] else: ModeType = str class Settings: defaults = {"HIDE_COLUMNS": True, "MODE": "once"} def get_setting(self, key: str) -> Any:...
2.34375
2
server_parse/server_parse.py
MrFlynn/mc-playerstat-webhook
0
28168
<reponame>MrFlynn/mc-playerstat-webhook import os import json class ServerParse: def __init__(self, directory: str) -> None: """Initializes class. Stores root directory to server and loads whitelist and server name. :param directory: directory containing all server files (configurations ...
2.90625
3
mpst_ts/codegen/generator/node/node_v2/node_strategy.py
stscript-cgo/STScript
0
28169
<gh_stars>0 import os from ...utils import CodeGenerationStrategy from ....endpoint import Endpoint from .....utils import TemplateGenerator class NodeStrategy(CodeGenerationStrategy, target='node'): def __init__(self): super().__init__() self.output_dir = 'sandbox/node' ...
2.125
2
dump-pkg/src/dumpshmamp/collectors/docker.py
sha1n/macos-devenv-dump-poc
0
28170
from dumpshmamp.collectors.files import try_copyfile, file_path, mkdir from shminspector.util.cmd import try_capture_output, is_command def collect_docker_files(user_home_dir_path, target_dir_path, ctx): if is_command("docker"): ctx.logger.info("Collecting Docker information...") mkdir(target_dir...
2.328125
2
itamar/find_box.py
ijda3/TrabalhoVisaoEquipe2
0
28171
import cv2 import numpy as np # Normal routines img = cv2.imread('image3.png') scale_percent = 30 # percent of original size width = int(img.shape[1] * scale_percent / 100) height = int(img.shape[0] * scale_percent / 100) dim = (width, height) # resize image img = cv2.resize(img, dim, interpolation = cv2.INTER_AREA...
3.28125
3
P0023.py
sebastianaldi17/ProjectEuler
0
28172
<reponame>sebastianaldi17/ProjectEuler<gh_stars>0 # Non-abundant sums # https://projecteuler.net/problem=23 # This actually took 5 seconds to process. # Maybe a faster solution is present? from math import sqrt from collections import defaultdict def divisors(n): div = 0 for i in range(1, int(sqrt(n)) + 1): ...
3.0625
3
api/scpca_portal/config/production.py
AlexsLemonade/scpca-portal
0
28173
import os import sentry_sdk from sentry_sdk.integrations.django import DjangoIntegration from scpca_portal.config.common import Common class Production(Common): INSTALLED_APPS = Common.INSTALLED_APPS SECRET_KEY = os.getenv("DJANGO_SECRET_KEY") # Site # https://docs.djangoproject.com/en/2.0/ref/setti...
2.0625
2
CPP-PyTorch-Ext/test_validation.py
AmirOfir/GCK3x3ConvLayer
0
28174
import gc import math import numpy as np import torch import torch.nn.functional as F import timeit import time from gck_layer import GCK3x3Layer kernel_dim = 3 def tensors_equal(a,b): b = torch.allclose(a, b, atol=0.01) if (b): print('same: True') else: print('Same: False (diff:', ((a-b)....
2.359375
2
now_playing_graph/stats.py
macbre/now-playing-graph
0
28175
""" Prepare some stats from timelines """ # https://docs.python.org/3.7/library/collections.html#collections.Counter from collections import Counter def get_timeline_stats(timeline): """ :type timeline list[now_playing_graph.timeline.TimelineEntry] :rtype: dict """ top_artists = Counter() top_...
3.34375
3
limnoria-plugins/SupportNotifications/plugin.py
chevah/ircbot-plugins
0
28176
<filename>limnoria-plugins/SupportNotifications/plugin.py<gh_stars>0 """ Use GMail API to check an Inbox for new emails. To generate the initial credentials you will need to execute this module from python with first argument to a patch containing your API client details and the second argument to the file where to st...
2.453125
2
qusetta/_version.py
qcware/qusetta
3
28177
"""Defines the version number and details of ``qusetta``.""" __all__ = ( '__version__', '__author__', '__authoremail__', '__license__', '__sourceurl__', '__description__' ) __version__ = "0.0.0" __author__ = "<NAME>" __authoremail__ = "<EMAIL>" __license__ = "MIT License" __sourceurl__ = "https://github.com/...
0.96875
1
LobbyService/test/test_get_lobbies.py
Devin0xFFFFFF/singed-feathers
1
28178
<reponame>Devin0xFFFFFF/singed-feathers<gh_stars>1-10 import pytest from mock import Mock, patch from service import get_lobbies @patch('service.lobby_service_common.get_public_lobbies') def test_get_lobbies(get_public_lobbies_mock): get_public_lobbies_mock.return_value = {} response = get_lobbies.lambda_ha...
2.03125
2
truncande/cli.py
Ricyteach/truncande
0
28179
<gh_stars>0 import pathlib import click from . import candeout @click.group() @click.argument("ifile", type=click.Path(exists=True, dir_okay=False), required=True) @click.argument( "ofile", type=click.Path(exists=False, dir_okay=False, writable=True), required=False, ) @click.pass_context def main(ctx, ...
2.3125
2
conference/decorators.py
ethancarlsson/epcon
40
28180
import functools from django.contrib import messages from django.urls import reverse from django.shortcuts import redirect def full_profile_required(func): @functools.wraps(func) def wrapper(request, *args, **kwargs): if (request.user and request.user.id # FIXME test mocks mess with ...
2.21875
2
flaskdynamo_v1_completeWithCardsTwoPage_API_Version_json_req_type (copy)/2paginator.py
A9K5/Python_Flask
0
28181
<gh_stars>0 from flask import Flask, render_template, request, redirect, jsonify from flask_cors import CORS, cross_origin from datetime import datetime from flask import Blueprint from flask_paginate import Pagination, get_page_parameter import botocore import boto3 import decimal import logging import time import a...
2.15625
2
snap_scripts/old_scripts/tem_iem_older_scripts_april2018/tem_inputs_iem/min_max_deltas_tem_iem.py
ua-snap/downscale
5
28182
<gh_stars>1-10 from downscale import DeltaDownscale class DeltaDownscaleMM( DeltaDownscale ): def _calc_anomalies( self ): print('calculating anomalies') def downscale( self, *args, **kwargs ): print( 'downscaling...' ) # FOR RUN OF THE MIN / MAX TAS DATA: # 1. COMPUTE DELTAS FIRST ANND WRITE TO NETCDF # 2. U...
2.59375
3
mldftdat/dft/utils.py
mir-group/CiderPress
10
28183
import numpy as np from mldftdat.pyscf_utils import * from mldftdat.workflow_utils import safe_mem_cap_mb from pyscf.dft.numint import eval_ao, make_mask from mldftdat.density import LDA_FACTOR,\ contract21_deriv, contract21, GG_AMIN def dtauw(rho_data): return - get_gradient_magnitud...
1.976563
2
api/apps/boxes/apps.py
polart/vagrant-registry
8
28184
from django.apps import AppConfig class BoxesConfig(AppConfig): name = 'apps.boxes' def ready(self): import apps.boxes.signals
1.445313
1
generalexercise/05.py
haxuyennt38/python-learning
0
28185
<reponame>haxuyennt38/python-learning ##Write a program to input from the input file a familiar greeting of any length, each word on a line. Output the greeting file you just received on a single line, the words separated by a space #Mo file voi mode='r' de doc file with open('05_ip.txt', 'r') as fileInp: #Dung ham re...
4.28125
4
pyzem/dvid/dvidio.py
janelia-flyem/pyzem
2
28186
<filename>pyzem/dvid/dvidio.py<gh_stars>1-10 from __future__ import print_function from __future__ import absolute_import import os import sys from optparse import OptionParser import json import requests from pyzem.dvid import dvidenv import datetime def compute_age(d): age = -1 if 'timestamp' in d: ...
2.4375
2
tf src/app_tf.py
aj-naik/Emotion-Recognistion
0
28187
<filename>tf src/app_tf.py import tkinter as tk from tkinter import * import cv2 from PIL import Image, ImageTk import numpy as np import tensorflow as tf from tensorflow.keras import layers from tensorflow import keras emotion_model = keras.Sequential( [ layers.Conv2D(32, kernel_size=(3,3), activation='r...
2.9375
3
ostap/logger/mute.py
TatianaOvsiannikova/ostap
14
28188
<filename>ostap/logger/mute.py #!/usr/bin/env python # -*- coding: utf-8 -*- # ============================================================================= ## @file # Module with some simple but useful utilities # - suppression of stdout/stderr # @author <NAME> <EMAIL> # @date 2013-02-10 # # ================...
1.835938
2
day_1/day1.py
mickeelm/aoc2019
1
28189
def fuel_required_single_module(mass): fuel = int(mass / 3) - 2 return fuel if fuel > 0 else 0 def fuel_required_multiple_modules(masses): total_fuel = 0 for mass in masses: total_fuel += fuel_required_single_module(mass) return total_fuel def recursive_fuel_required_single_module(mass):...
3.984375
4
saascs_sschoreo/feature_choreo/task_helper.py
muraligo/featuretimeline
0
28190
<filename>saascs_sschoreo/feature_choreo/task_helper.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Mar 09 15:44:40 2020 @author: mugopala Helper functions for tasks """ import os import stat import json import threading import time import queue as stdq import csv from io import StringIO from ....
1.90625
2
media.py
DojoZheng/Udacity-Movies-Website
0
28191
import webbrowser class Movie(): """ This class provides a way to store movie related information """ # Class Variable: These are the Movies Ratings # G: General Audiences. All ages admitted. # PG: Parental Guidance Suggested. Some material may not be suitable for children. # PG-13: Parents Strongly Cautioned....
3.5
4
converter.py
Supercip971/convertisseur-python
0
28192
<reponame>Supercip971/convertisseur-python str_xdigits = [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", ] def convert_digit(value: int, base: int) -> str: return str_xdigits[value % base] def convert_to_val(value:...
3.671875
4
backend/test/test_api.py
solevis/pixyship2
8
28193
<gh_stars>1-10 from pixelstarshipsapi import PixelStarshipsApi from run import push_context def test_login(): pixel_starships_api = PixelStarshipsApi() device_key, device_checksum = pixel_starships_api.generate_device() token = pixel_starships_api.get_device_token(device_key, device_checksum) assert...
2.34375
2
tests/test_io.py
crindt/geofeather
60
28194
import os from geofeather import to_geofeather, from_geofeather from pandas.testing import assert_frame_equal import pytest def test_points_geofeather(tmpdir, points_wgs84): """Confirm that we can round-trip points to / from feather file""" filename = tmpdir / "points_wgs84.feather" to_geofeather(points...
2.484375
2
pilmoji/helpers.py
solfisher/miq-fedi
8
28195
<reponame>solfisher/miq-fedi from __future__ import annotations import re from enum import Enum from emoji import EMOJI_UNICODE from PIL import ImageFont from typing import Final, List, NamedTuple, TYPE_CHECKING if TYPE_CHECKING: from .core import FontT # This is actually way faster than it seems _UNICODE_EMO...
2.53125
3
networking_arista/ml2/mechanism_arista.py
sapcc/networking-arista
0
28196
# Copyright (c) 2013 OpenStack Foundation # # 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.0625
1
yamlfred/alfred_object.py
uchida/yamlfred
0
28197
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import os.path import uuid from yamlfred.utils import remove_default, merge_dicts from yamlfred.utils import Include defaults = { 'alfred.workflow.output.notification': { 'config': {'removeextension': False, 'output': 0, 'las...
1.9375
2
project2/main.py
DroogieDroog/python
0
28198
<reponame>DroogieDroog/python """ pirple/python/project2/main.py Project #2 Create a hangman game """ from os import system, name from time import sleep from random import randint import string def clear_screen(): # for windows if name == 'nt': _ = system('cls') # for mac and linux(here, os...
4.28125
4
deepnlpf/core/plugin_manager.py
deepnlpf/deepnlpf
3
28199
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import deepnlpf.log as log from deepnlpf.core.util import Util class PluginManager: def __init__(self): self.HOME = os.environ["HOME"] self.PLUGIN_SERVER = "https://github.com/deepnlpf/" self.PLUGIN_PATH = self.HOME + "/d...
2.34375
2