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
tests/unit/test_resultlib.py
boxingbeetle/softfab
20
12771951
# SPDX-License-Identifier: BSD-3-Clause """Test result storage and processing functionality.""" from pytest import fixture, raises from softfab.resultlib import ResultStorage @fixture def resultStorage(tmp_path): return ResultStorage(tmp_path) # Test data that can be used by various test cases: TASK_NAME = 't...
2.296875
2
01_Language/01_Functions/python/fileinode.py
cliff363825/TwentyFour
3
12771952
# coding: utf-8 import os def fileinode(filename): return os.stat(filename).st_ino if __name__ == '__main__': print(fileinode("test.txt"))
2.3125
2
sustainableCityManagement/tests/ML_Models/test_bikes_uasge_prediction.py
Josh-repository/Dashboard-CityManager-
0
12771953
<reponame>Josh-repository/Dashboard-CityManager- from main_project.ML_models.bikes_usage_prediction import * from django.test import TestCase from unittest.mock import MagicMock from main_project.Config.config_handler import read_config import datetime import unittest class TestBikeUsagePrediction(TestCase): @cla...
2.671875
3
pypeit/pypeit.py
joshwalawender/PypeIt
0
12771954
<gh_stars>0 """ Main driver class for PypeIt run """ import time import os import numpy as np from collections import OrderedDict from astropy.io import fits from pypeit import msgs from pypeit import calibrations from pypeit.images import scienceimage from pypeit import ginga from pypeit import reduce from pypeit.core...
2.203125
2
swig/x64dbgpy/__events.py
swigger/x64dbgpy
1
12771955
# import os # from os import path # import runpy # import glob from . utils import Singleton EVENTS = [ # 'init_debug', 'stop_debug', 'breakpoint', 'create_process', 'exit_process', 'create_thread', 'exit_thread', 'system_breakpoint', 'load_dll', 'unload_dll', 'trace_execute...
1.921875
2
CodeCrakers/drones.py
suhasksv/py-ground
3
12771956
<filename>CodeCrakers/drones.py x = 0 drone_chk = [112, 334, 4444, 4444, 445, 112, 27466, 445, 27466] for i in drone_chk: x ^= i print("The missing drone order ID is:", x)
2.828125
3
qt-creator-opensource-src-4.6.1/tests/system/suite_editors/tst_delete_externally/test.py
kevinlq/Qt-Creator-Opensource-Study
5
12771957
############################################################################ # # Copyright (C) 2016 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. # # Commercial License Usage # Licensees holding valid commercial Qt licenses may use this file in # accordance with the co...
1.445313
1
torchx/utils/Norm.py
antoniojkim/TorchX
0
12771958
# -*- coding: utf-8 -*- import torch def pixel_norm(x: torch.Tensor, epsilon: float = 1e-8): """Applies a pixel-wise normalization. Note: Implemented as described in `this paper <https://arxiv.org/pdf/1710.10196.pdf>`_. `Reference <https://github.com/tkarras/progressive_growing_of_gans/blob/m...
2.6875
3
web/talks/tests/tests_models.py
vtalks/vtalks.net
1
12771959
from django.test import TestCase from channels.models import Channel from talks.models import Talk # Create your tests here. class TalkModelTests(TestCase): def setUp(self): chanel_1 = Channel.objects.create(code='1', title='channel title 1') Talk.objects.create(code='1', title='talk title 1', ...
2.4375
2
scripts/update_package_mapping.py
JonathanGailliez/azure-sdk-for-python
1
12771960
#!/usr/bin/env python # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # ---------------------------------------------...
2.1875
2
day10/Day_10_Code_Challenge.py
dikshaa1702/ml
1
12771961
""" Code Challenge 1 Certificate Generator Develop a Python code that can generate certificates in image format. It must take names and other required information from the user and generates certificate of participation in a Python Bootcamp conducted by Forsk. Certificate should have Forsk Seal, Forsk Signature, ...
3.8125
4
datasheets/tab.py
etcher-be/datasheets
625
12771962
import types from collections import OrderedDict import apiclient import pandas as pd from datasheets import exceptions, helpers class Tab(object): def __init__(self, tabname, workbook, drive_svc, sheets_svc): """Create a datasheets.Tab instance of an existing Google Sheets tab. This class in n...
3.015625
3
selenium_driver_updater/browsers/_operaBrowser.py
Svinokur/selenium_driver_updater
8
12771963
#pylint: disable=logging-fstring-interpolation #Standart library imports import subprocess import os import re import platform from typing import Tuple,Any from pathlib import Path import shutil # Third party imports from bs4 import BeautifulSoup import wget # Selenium imports from selenium import webdriver from sele...
2.171875
2
src/utils/config.py
slebras/index_runner
0
12771964
import urllib.request import yaml import os import json import time import logging import requests logger = logging.getLogger('IR') _FETCH_CONFIG_RETRIES = 5 # Defines a process-wide instance of the config. # Alternative is passing the configuration through the entire stack, which is feasible, # but we consider that ...
2.28125
2
tests/__init__.py
theincognito-inc/manga-dl
1
12771965
<filename>tests/__init__.py from .archive import TestArchive from .base import TestBaseClass from .http import TestHttpClasses from .init_provider import TestInitProvider from .matrix import TestMatrix from .web_driver import TestWebDriver from .crypt import TestCrypt from .std import TestStd
1.171875
1
elections_admin/urls.py
newsdev/nyt-elections-admin
3
12771966
<reponame>newsdev/nyt-elections-admin<filename>elections_admin/urls.py from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', (r'^elections/2016/admin/', include(admin.site.urls)), )
1.453125
1
examples/streamline1.py
yang69can/pyngl
125
12771967
# # File: # streamline1.py # # Synopsis: # Draws streamlines on a map over water only. # # Category: # Streamlines on a map. # # Author: # <NAME> # # Date of original publication: # December, 2004 # # Description: # This example draws streamlines over water on a map using a # Cylindrical Eq...
3.15625
3
setup.py
hashimom/grpcping
0
12771968
from setuptools import find_packages, setup setup( name='grpcping', version='0.1.0', packages=find_packages(), include_package_data=True, url='https://github.com/hashimom/grpcping', entry_points={ "console_scripts": [ "grpcping = grpcping.ping:main", ] }, lic...
1.21875
1
src/companion-software/PiLED/matrix/matrix.py
LongMetal-Robotics/ShowBot
0
12771969
<filename>src/companion-software/PiLED/matrix/matrix.py from rgbmatrix import RGBMatrix, RGBMatrixOptions from video import playVideo, loopVideo from image import displayImage import logging import threading import re class Matrix: currentThread = None threadStop = False def __init__(self): print...
2.703125
3
hanabi.py
drew-lustig/hanabi
0
12771970
<reponame>drew-lustig/hanabi<filename>hanabi.py from random import shuffle class CardDeck(object): variations = { 'classic': ( ['r', 'b', 'g', 'y', 'w'], {1: 3, 2: 2, 3: 2, 4: 2, 5: 1} ) } def __init__(self, variation='classic'): self._variation = variation...
3.296875
3
hermes_fix/utils/date_helper.py
yabov/hermes_fix
2
12771971
<filename>hermes_fix/utils/date_helper.py<gh_stars>1-10 from datetime import datetime, timedelta from dateutil import tz, parser def inside_time_range(current_time, start_time, end_time): if (current_time >= start_time) and (current_time <= end_time): return True return False def get_session_times(d...
2.796875
3
challenges/texture_structure_nerf/worker.py
ritmps/kubric
0
12771972
<filename>challenges/texture_structure_nerf/worker.py # Copyright 2021 The Kubric 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 # ...
2.15625
2
process/templatetags/json_filters.py
pycess/pycess
1
12771973
from django.core.serializers import serialize from django.core.serializers.json import DjangoJSONEncoder from django.db.models.query import QuerySet from django.utils.safestring import mark_safe from django.template import Library import json register = Library() @register.filter def jsonify(object): return json...
1.796875
2
GEOS_Util/coupled_diagnostics/g5lib/confocn.py
GEOS-ESM/GMAO_Shared
1
12771974
<reponame>GEOS-ESM/GMAO_Shared ''' @EXPDSC ### Put detailed experiment description here ### ''' import os from datetime import date expid='@EXPID' cmpexp='@EXPID' data_path='@EXPDIR' plot_path=data_path+'/plots_ocn' basin_mask='@COUPLEDIR/basin_mask/@OGCM_IMx@OGCM_JM/basin_mask.nc' grid_spec='@COUPLEDIR/a@AGCM_IMx@AG...
1.992188
2
torchsr/models/carn.py
mgm52/torchSR
0
12771975
# Implementation from https://github.com/nmhkahn/CARN-pytorch # Fast, Accurate, and Lightweight Super-Resolution with Cascading Residual Network # https://arxiv.org/abs/1803.08664 import math import torch import torch.nn as nn import torch.nn.functional as F from torch.hub import load_state_dict_from_url __all__ = [ ...
2.40625
2
__init__.py
austinmilt/video-game-view
3
12771976
""" Video Game HUD for Youtube videos. .. moduleauthor:: <NAME> <<EMAIL>> """ from detection import *
0.855469
1
src/CPMel/api/apiwrap.py
2921251087/CPMel
1
12771977
#!/usr/bin/python # -*-coding:utf-8 -*- u""" :创建时间: 2020/5/18 23:57 :作者: 苍之幻灵 :我的主页: https://cpcgskill.com :QQ: 2921251087 :爱发电: https://afdian.net/@Phantom_of_the_Cang :aboutcg: https://www.aboutcg.org/teacher/54335 :bilibili: https://space.bilibili.com/351598127 """ import maya.cmds as cmds from .. import core as cmc...
2.296875
2
Algorithms/Medium/873. Length of Longest Fibonacci Subsequence/answer.py
KenWoo/Algorithm
0
12771978
<filename>Algorithms/Medium/873. Length of Longest Fibonacci Subsequence/answer.py from typing import List import collections class Solution: def lenLongestFibSubseq(self, A: List[int]) -> int: indexes = {x: i for i, x in enumerate(A)} longest = collections.defaultdict(lambda: 2) res = 0 ...
3.90625
4
templates/control.py
Coricos/Challenger
15
12771979
# Author: <NAME> # Date: 05 April 2020 # Project: Challenger import os, json, sys, subprocess rmf = ['bin', 'etc', 'include', 'lib', 'lib64', 'pyvenv.cfg', 'share'] msk = ['challenger', 'package', 'elementtree', 'ffprobe'] def packages_from_project(path): try: cmd = 'pipreqs --force --no-pin --print...
2.1875
2
lib/analyzers.py
sully90/spider
1
12771980
import collections import math import numpy as np import mlpy class TermFrequencyAnalyzer(object): def __init__(self, *documents): self.idf = self.compute_idf(*documents) def compute_idf(self, *documents): # document frequency df = collections.defaultdict(int) for tokens in d...
2.734375
3
src/client/ui/widget/dynamic_textbox_example.py
Tubular-Terriers/code-jam
1
12771981
<gh_stars>1-10 #!/usr/bin/env python import asyncio import curses import curses.textpad import pygame from pynput import keyboard def static_vars(**kwargs): def async_wrapper(callback): def inner(key): temp = asyncio.run(callback(key)) # key combinations traitement if...
2.8125
3
activflow/quotient/forms.py
mcgauranc/mosaiq
0
12771982
"""Custom Forms""" from django import forms from django.db.models import ( CharField) class CustomForm(forms.ModelForm): """Sample Custom form""" sample_id = CharField("Sample Id:", max_length=200, editable=False)
2.421875
2
presidio-analyzer/analyzer/field_types/us/phone.py
kant/presidio
0
12771983
from field_types import field_type, field_regex_pattern class Phone(field_type.FieldType): name = "PHONE_NUMBER" context = ["phone", "number", "telephone", "cell", "mobile", "call"] patterns = [] # Strong pattern: e.g., (425) 882 8080, 425 882-8080, 425.882.8080 pattern = field_regex_pattern.Rege...
2.734375
3
tests/test_optim_loss.py
naokishibuya/simple_transformer
5
12771984
<reponame>naokishibuya/simple_transformer<gh_stars>1-10 import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), '..')) import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor from simple_transformer.optim import TranslationLoss from simple_tra...
2.078125
2
scripts/metaphlan2species.py
CGATOxford/proj029
3
12771985
<filename>scripts/metaphlan2species.py ''' metaphlan2species.py - template for CGAT scripts ==================================================== :Author: <NAME> :Release: $Id$ :Date: |today| :Tags: Python Purpose ------- create list of species from output of metaphlan2table.py --relab Usage ----- Example:: pyt...
2.6875
3
TensorFlow_Federated/models/convolutional_NN.py
BaptisteTomasin/Federated-Learning-Frameworks
0
12771986
<reponame>BaptisteTomasin/Federated-Learning-Frameworks<gh_stars>0 import tensorflow as tf import numpy as np class Convolutional_NN(object): def __init__(self): pass def lr_network(self, input_shape, label_shape): """ Create loss function and the list of metrics Argume...
2.546875
3
upsilont/features/__init__.py
dwkim78/UPSILoN-T
3
12771987
from upsilont.features.variability_features import VariabilityFeatures from upsilont.features.variability_features import get_train_feature_name from upsilont.features.variability_features import get_all_feature_name
1.171875
1
presto/migrations/0035_auto_20180327_0753.py
pwgbots/presto
0
12771988
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2018-03-27 05:53 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_depende...
1.71875
2
dentalapp-backend/dentalapp/userauth/api.py
PavelescuVictor/DentalApplicationReact
1
12771989
<reponame>PavelescuVictor/DentalApplicationReact<gh_stars>1-10 from django.contrib.auth.signals import user_logged_in, user_logged_out from rest_framework import generics, permissions, status from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.permissions import...
2.03125
2
visualSHARK/models.py
benjaminLedel/visualSHARK_topicShark
0
12771990
<reponame>benjaminLedel/visualSHARK_topicShark<filename>visualSHARK/models.py ##!/usr/bin/env python # -*- coding: utf-8 -*- import copy import json import uuid from django.conf import settings from django.db.models.signals import post_save from django.db import models, transaction from django.dispatch import receiver...
1.976563
2
src/ts_analysis/ts_correlation.py
daudprobst/master_thesis
0
12771991
<gh_stars>0 import pandas as pd import numpy as np from src.ts_analysis.timeseries import Timeseries, load_ts_from_csv from src.utils.output_folders import DATA_HYPE_PHASE_TS_FOLDER import scipy.stats as stats def ts_pearson_correlation(A: Timeseries, B: Timeseries, lag: int = 0): if len(A) != len(B): rai...
2.625
3
tox/__main__.py
doismellburning/tox
1
12771992
from tox._cmdline import main main()
1.15625
1
digitalarchive/models.py
epikulski/digitalarchive
2
12771993
""" digitalarchive.models The module provides documented models and an ORM for interacting with the DA API. """ from __future__ import annotations # Standard Library import dataclasses import json import logging import copy from datetime import datetime, date from typing import List, Any, Optional, Union, Dict, Class...
2.5625
3
install/core/python/tank/util/metrics.py
JoanAzpeitia/lp_sg
0
12771994
<reponame>JoanAzpeitia/lp_sg # Copyright (c) 2016 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indic...
2.015625
2
h/auth/policy/bearer_token.py
pombredanne/h
0
12771995
from pyramid import interfaces from zope import interface from h.auth.policy._identity_base import IdentityBasedPolicy from h.security import Identity @interface.implementer(interfaces.IAuthenticationPolicy) class TokenAuthenticationPolicy(IdentityBasedPolicy): """ A bearer token authentication policy. ...
2.515625
3
CodeWars/2016/MultiplesOf3and5-6k.py
JLJTECH/TutorialTesting
0
12771996
#Return the sum of all the multiples of 3 or 5 below the number passed in. def solution(number): lit = [] for i in range(0, number): if i % 3 == 0 or i % 5 == 0: lit.append(i) return sum(lit) #Alternate Solution def solution(number): return sum(x for x in range(number) if x % 3 == 0...
4.1875
4
analysis/plot_dat_mod.py
noahfranz13/BL-TESSsearch
0
12771997
import os, glob, sys from turbo_seti.find_event.plot_dat import plot_dat from turbo_seti import find_event as find import numpy as np def main(): import argparse parser = argparse.ArgumentParser() parser.add_argument('--dir', default=os.getcwd()) parser.add_argument('--minHit', type=float, default=None...
2.328125
2
Bagpipe/Coordinator/sender.py
kasramvd/Rexy
51
12771998
""" ===== sender.py ===== Import data from server. ============================ """ from flask import Flask, jsonify from flask import make_response from config import sender_links app = Flask(__name__) @app.errorhandler(404) def not_found(error): return make_response(jsonify({'error': 'Not found'}), 404) ...
2.40625
2
tests/test_marble.py
mcgibbon/marble
3
12771999
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for `marble` package.""" import unittest import marble import numpy as np import sympl as sp test_era5_filename = '/home/twine/data/era5/era5-interp-2016.nc' def get_test_state(pc_value=0.): n_features = marble.components.marble.name_feature_counts st...
2.125
2
python/coursera_python/MICHIGAN/WEB/week4/asss.py
SayanGhoshBDA/code-backup
16
12772000
<reponame>SayanGhoshBDA/code-backup # socketTest.py import socket mysocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) mysocket.connect(('http://data.pr4e.org/intro-short.txt', 80)) mysocket.send('GET intro-short.txt HTTP/1.0\n') mysocket.send('Host: www.pythonlearn.com\n\n') # mysocket.send(b'GET http://www....
2.796875
3
tests/clients/sendgrid/test_sendgrid.py
zaibon/js-sdk
13
12772001
<reponame>zaibon/js-sdk import email import imaplib import os import string import gevent import pytest from jumpscale.loader import j from tests.base_tests import BaseTests @pytest.mark.integration class Sendgrid(BaseTests): SMTP_SERVER = "imap.gmail.com" def setUp(self): self.sendgird_client_name ...
2.046875
2
Paper_topography_figures/Figure_5_C_E_Figure_S6_A_C_E_F.py
kavli-ntnu/mini2p_topography
1
12772002
### Figure 5 C and E - Obenhaus et al. # Figure S6 A, C, E and F - Obenhaus et al. # # NN distance analysis # Pairwise distance analysis # import sys, os import os.path import numpy as np import pandas as pd import datajoint as dj import cmasher as cmr from tabulate import tabulate import itertools # Make plot...
2.125
2
Definitions/definitions_for_scraping_fitbit_data.py
ddritsa/PhD-Thesis-repository
0
12772003
<filename>Definitions/definitions_for_scraping_fitbit_data.py #!/usr/bin/env python # coding: utf-8 # To use this: # # Put in the parenthesis: User email, password, user ID) # # (Email+password that are used in Strava # # In[3]: import pandas as pd from xml.dom import minidom import csv from bs4 import Beautif...
2.953125
3
sensitivity_general.py
kwabenaOwusu/CovidInterventionsABM
0
12772004
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ simulations for sensitivity to results Author: <NAME> Date: May, 2020 """ import csv import time as mytime ############################################ENVIRONMENT################################################################################### exec(open('./enviro...
2.28125
2
tests/test_model_serializer_deserialize.py
aswinkp/swampdragon
366
12772005
from swampdragon.serializers.model_serializer import ModelSerializer from swampdragon.testing.dragon_testcase import DragonTestCase from .models import TextModel, SDModel from datetime import datetime from django.db import models # to make sure none of the ModelSerializer variables are clobbering the data MODEL_KEYWO...
2.546875
3
pyx12/test/test_xmlwriter.py
sanjaysiddhanti/pyx12
0
12772006
<reponame>sanjaysiddhanti/pyx12<filename>pyx12/test/test_xmlwriter.py import os.path import sys import os import unittest try: from StringIO import StringIO except: from io import StringIO import tempfile from pyx12.xmlwriter import XMLWriter class TestWriter(unittest.TestCase): """ """ def set...
2.640625
3
housing_prices_kaggle/results/2020-04-13/runall.py
be2112/modeling_projects
0
12772007
<reponame>be2112/modeling_projects from lib_bre import * import pandas as pd import matplotlib.pyplot as plt # Set pandas options to be more user friendly for a wide dataset pd.set_option('display.max_columns', 500) pd.set_option('display.width', 1000) # Ignore Matplotlib memory warnings plt.rcParams.update({'figure....
2.765625
3
docs/examples/docker/mrcnn/handler.py
mysuperai/superai-sdk
1
12772008
import base64 import json import os import zlib from urllib.request import urlretrieve import boto3 import mrcnn.model as modellib import numpy as np import pandas as pd import skimage.io from mrcnn import utils from mrcnn.config import Config from superai.meta_ai import BaseModel s3 = boto3.client("s3") _MODEL_PAT...
2.484375
2
testes e exercícios/exercicios/script_040.py
LightSnow17/exercicios-Python
0
12772009
<reponame>LightSnow17/exercicios-Python print('Notas: menor que 5, REPROVADO / entre 5 e 6.9, RECUPERAÇÃO / maior ou igual a 7, APROVADO') nota1 = float(input('Primeira nota: ')) nota2 = float(input('Segunda nota: ')) media = (nota1 + nota2) / 2 if media < 5: print('Sua média é {} e você está REPROVADO!!'.format(m...
4.09375
4
cogs/commands/mod/modactions.py
BinnyDevel/Bloo
0
12772010
<reponame>BinnyDevel/Bloo<gh_stars>0 from apscheduler.jobstores.base import ConflictingIdError import discord from discord.commands import Option, slash_command from discord.commands.commands import message_command, user_command from discord.errors import HTTPException from discord.ext import commands from discord.util...
1.828125
2
feature_eng.py
vikrantpailkar/Loan_Default_Prediction
2
12772011
<reponame>vikrantpailkar/Loan_Default_Prediction # -*- coding: utf-8 -*- """ Created on 02/02/2019 Author: Vikrant """ from trim_data import ext_num_from_sub_grade from trim_data import drop_emp_title from trim_data import fill_na_annual_inc from trim_data import drop_zip_code from trim_data import fill_na_delinq_2yr...
1.289063
1
perses/storage/storage.py
mikemhenry/perses
0
12772012
""" Storage layer for perses automated molecular design. TODO ---- * Add write_sampler_state(modname, sampler_state, iteration) * Generalize write_quantity to handle units * Add data access routines for reading to isolate low-level storage layer """ __author__ = '<NAME>' ############################################...
2.203125
2
services/docService/app/models.py
anaquin135/modularCPQ
0
12772013
from datetime import datetime from app import db class DOCUMENT(db.Model): id = db.Column(db.Integer, nullable=False, primary_key=True) description = db.Column(db.String(300), nullable=False, default='Missing Description') isActive = db.Column(db.Boolean, nullable=False, default=...
2.421875
2
snake/helpers/queue.py
JacobLiu001/slitherin
83
12772014
<filename>snake/helpers/queue.py class Queue: def __init__(self, initial_values): self.queue = initial_values def enqueue(self, val): self.queue.insert(0, val) def dequeue(self): if self.is_empty(): return None else: return self.queue.pop() de...
3.265625
3
main.py
devlights/excel_shape_position_adjust
1
12772015
################################################################# # 指定されたフォルダ配下のExcelを開いていき、画像が指定位置に貼付けされていないファイルを出力or調整します。 # # 実行には、以下のライブラリが必要です. # - win32com # - $ python -m pip install pywin32 # # [参考にした情報] # - https://www.sejuku.net/blog/23647 ##############################################################...
3.171875
3
mmdet/models/roi_heads/wsod_embedding_head.py
dyabel/wsod-mmdet
6
12772016
import torch from mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler from ..builder import HEADS, build_head, build_roi_extractor from .base_roi_head import BaseRoIHead from .test_mixins import BBoxTestMixin, MaskTestMixin from mmdet.core import multiclass_nms,bbox_select_per_class from mmdet.core....
1.703125
2
esphome/components/am2320/sensor.py
TheEggi/esphomeyaml
0
12772017
import esphome.codegen as cg import esphome.config_validation as cv from esphome.components import i2c, sensor from esphome.const import CONF_HUMIDITY, CONF_ID, CONF_TEMPERATURE, \ UNIT_CELSIUS, ICON_THERMOMETER, ICON_WATER_PERCENT, UNIT_PERCENT DEPENDENCIES = ['i2c'] am2320_ns = cg.esphome_ns.namespace('am2320')...
2.21875
2
estate/settings/base.py
badri/estate
0
12772018
import ast import os import dj_database_url PROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), os.pardir)) SECRET_KEY = os.environ.get("SECRET_KEY", "UNKNOWN") DEBUG = ast.literal_eval(os.environ.get('DEBUG', 'False')) LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True...
1.757813
2
movies/entertainment_center.py
MANOJPATRA1991/fresh_tomatoes
0
12772019
<reponame>MANOJPATRA1991/fresh_tomatoes """This module opens the fresh_tomatoes.html in a web browser""" import media import my_movies # creating instances of the Movie class # INTERSTELLAR interstellar = media.Movie( "Interstellar", "In the future, Earth is slowly becoming uninhabitable. Ex" "E...
3.03125
3
LeetCode/Python3/Math/1175. Prime Arrangements.py
WatsonWangZh/CodingPractice
11
12772020
# Return the number of permutations of 1 to n so that prime numbers are at prime indices (1-indexed.) # (Recall that an integer is prime if and only if it is greater than 1, # and cannot be written as a product of two positive integers both smaller than it.) # Since the answer may be large, return the answer modulo 10...
3.84375
4
keywords_per_year_organiser.py
Track-your-parliament/track-your-parliament-data
0
12772021
<reponame>Track-your-parliament/track-your-parliament-data import pandas as pd import numpy as np import datetime PROPOSALS = './data/votes_keywords_distributions.json' df = pd.read_json(PROPOSALS) df = df.assign(year=lambda x: x.date.dt.year) group_by_years = df.groupby(by=['year']) yearly_keywords = pd.DataFrame(d...
3.125
3
units/volume/u_s_tablespoons.py
putridparrot/PyUnits
0
12772022
# <auto-generated> # This code was generated by the UnitCodeGenerator tool # # Changes to this file will be lost if the code is regenerated # </auto-generated> def to_millilitres(value): return value * 14.786764781249998848 def to_litres(value): return value * 0.014786764781249998848 def to_kilolitres(value): re...
2.546875
3
pyavreceiver/command.py
JPHutchins/pyavreceiver
2
12772023
"""Define commands.""" from abc import ABC, abstractmethod from typing import Callable, List, Sequence, Tuple, Union from pyavreceiver import const from pyavreceiver.error import AVReceiverInvalidArgumentError from pyavreceiver.functions import identity class CommandValues: """Possible values for a command.""" ...
3.1875
3
app/accounts/admin.py
bladewing/bahnplan-next
0
12772024
from django.contrib import admin from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from django.contrib.auth.models import User from accounts.models import Player class PlayerInline(admin.StackedInline): model = Player class UserAdmin(BaseUserAdmin): inlines = (PlayerInline,) admin.site.unr...
1.945313
2
libraries/botbuilder-core/botbuilder/core/state_property_info.py
awaemmanuel/botbuilder-python
1
12772025
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from abc import ABC class StatePropertyInfo(ABC): @property def name(self): raise NotImplementedError();
2.15625
2
workalendar/usa/pennsylvania.py
taiyeoguns/workalendar
405
12772026
<gh_stars>100-1000 from ..registry_tools import iso_register from .core import UnitedStates @iso_register('US-PA') class Pennsylvania(UnitedStates): """Pennsylvania""" include_good_friday = True include_thanksgiving_friday = True include_election_day_every_year = True
1.601563
2
homeassistant/components/blnet/__init__.py
nielstron/home-assistant
1
12772027
""" Connect to a BL-NET via it's web interface and read and write data TODO: as component """ import logging import voluptuous as vol from homeassistant.helpers.discovery import load_platform from homeassistant.const import ( CONF_RESOURCE, CONF_PASSWORD, CONF_SCAN_INTERVAL, TEMP_CELSIUS, ) from homeassistant.hel...
2.34375
2
sdk/python/pulumi_aws_native/pinpointemail/configuration_set.py
AaronFriel/pulumi-aws-native
29
12772028
<gh_stars>10-100 # coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. impor...
1.65625
2
FEV_KEGG/KEGG/NUKA.py
ryhaberecht/FEV-KEGG
0
12772029
from FEV_KEGG.Graph import SubstanceGraphs from FEV_KEGG.Graph.Elements import ReactionID, EcNumber from FEV_KEGG.Graph.SubstanceGraphs import SubstanceEcGraph, SubstanceReactionGraph from FEV_KEGG.KEGG.File import cache from FEV_KEGG.KEGG.Organism import Organism from FEV_KEGG.settings import verbosity as init_verbosi...
2.25
2
eggo/resources/download_mapper.py
laserson/eggo
32
12772030
#! /usr/bin/env python # Licensed to Big Data Genomics (BDG) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The BDG licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you...
2.125
2
scraper/schema.py
pekasen/DBoeS-Automatization
0
12772031
<reponame>pekasen/DBoeS-Automatization # Configure schema: 'Column_name': ['List', 'of', 'synonyms'] columns_with_synonyms = { 'Name': ['Mitglied des Landtages'], 'Fraktion': ['Partei', 'Fraktion (ggf. Partei)', ], 'Wahlkreis': ['Landtagswahlkreis der Direktkandidaten', ...
2.3125
2
sumo/tools/build/wix.py
iltempe/osmosi
0
12772032
<filename>sumo/tools/build/wix.py #!/usr/bin/env python """ @file wix.py @author <NAME> @author <NAME> @date 2011 @version $Id$ Builds the installer based on the nightly zip. SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ Copyright (C) 2011-2017 DLR (http://www.dlr.de/) and contributors This fil...
2.015625
2
bcs-ui/backend/iam/permissions/perm.py
ZhongmingFan/bk-bcs
0
12772033
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
1.914063
2
okl4_kernel/okl4_2.1.1-patch.9/tools/magpie-parsers/src/magpieparsers/mig/__init__.py
CyberQueenMara/baseband-research
77
12772034
<reponame>CyberQueenMara/baseband-research from magpieparsers.mig.parser import parse_to_pt __ALL__ = ['parse_to_pt']
1.210938
1
_test/_test_multi_gaussian_distribution.py
hjw-1014/Multi-Objective-Reactive-Motion-Planning-in-Mobile-Manipulators
0
12772035
<reponame>hjw-1014/Multi-Objective-Reactive-Motion-Planning-in-Mobile-Manipulators<filename>_test/_test_multi_gaussian_distribution.py # Test multi gaussian distribution import torch import torch.distributions as td import matplotlib.pyplot as plt from icecream import ic g1 = td.Normal(torch.tensor([0.0]), torch.tenso...
2.21875
2
tools/get_graph.py
zeng-ziyin/RG_GCN
0
12772036
<gh_stars>0 import torch import torch.nn as nn from torch_geometric.nn import knn_graph class RandomDrop(nn.Module): """ Find dilated neighbor from neighbor list edge_index: (2, batch_size, num_points, k) """ def __init__(self, k=20, random_rate=1.0, stochastic=True, isTrain=True): ...
2.734375
3
apps/vision/trials.py
dlooto/driver-vision
2
12772037
# coding=utf-8 # !/usr/bin/env python # # Copyright (C) 2014 NianNian TECH Co., Ltd. All rights reserved. # Created on Oct 22, 2015, by Junn # # import Queue import random import maths from config import * from vision.models import RoadModel import copy cached_real_roads = RoadModel.objects.get_all_roads(is_real=Tr...
2.296875
2
jupyter-notebooks/console-examples/pdb-debugging.py
r2cp/PES-Programacion-I
1
12772038
# -*- coding: utf-8 -*- """ Editor de Spyder Este es un archivo temporal. """ #import pdb def biseccion(f, a=-100, b=100, epsilon=0.001, max_iter=100): guess = (a + b) / 2 # Contador de iteraciones num_guesses = 0 #pdb.set_trace() while abs(f(guess)) >= epsilon and num_guesses < max_iter:...
3.5625
4
tests/endpoints/test_transactions.py
tmnhat2001/yelp-fusion-api
0
12772039
<reponame>tmnhat2001/yelp-fusion-api<filename>tests/endpoints/test_transactions.py from yelpfusion.endpoints.transactions import Transactions def test_transaction_search(requests_mock): mock_api = requests_mock.get("https://api.yelp.com/v3/transactions/pickup/search", json={}) Transactions("test-key").search...
1.96875
2
accelbyte_py_sdk/api/lobby/operations/friends/__init__.py
AccelByte/accelbyte-python-sdk
0
12772040
<reponame>AccelByte/accelbyte-python-sdk # Copyright (c) 2021 AccelByte Inc. All Rights Reserved. # This is licensed software from AccelByte Inc, for limitations # and restrictions contact your company contract manager. # # Code generated. DO NOT EDIT! # template file: justice_py_sdk_codegen/__main__.py """Auto-gene...
1.414063
1
gui.py
charan123g/imageprocessing
0
12772041
import tkinter as tk from tkinter import filedialog from tkinter import * from PIL import ImageTk, Image import numpy as np import cv2 #load the trained model to classify sign from tensorflow.keras.models import load_model from tensorflow.keras.preprocessing.sequence import pad_sequences from tensorflow.keras.models i...
2.90625
3
add_jira_label.py
shnax0210/add-jira-label
0
12772042
<filename>add_jira_label.py<gh_stars>0 import requests class JiraLabelAdder: def __init__(self, login, password, jira_base_url, batch_size=50): self.login = login self.password = password self.jira_base_url = jira_base_url self.batch_size = batch_size def add_label(self, jql, ...
2.609375
3
Python/Reals/river_in_brazil/count_bracket.py
Mr-Perfection/coding_practice
0
12772043
""" for a string with '(' find the count of complete '()' ones, '(()))" does not count, if does not have full brackets, return -1 time & space: O(n), n = length of S """ def count_brackets(S): # initializations cs,stack,cnt = S[:],[],0 # iterate through char array of S for c in cs: # if it is ...
4
4
fuzzysets/sets/base.py
StiliyanDr/fuzzy-sets
1
12772044
import abc import operator from fuzzysets import utils class Domain(abc.ABC): """ An abstract class for domain of a fuzzy set. """ @abc.abstractmethod def __iter__(self): """ :returns: a generator which yields the elements of the domain. The order of the elements is the sa...
3.75
4
pex/proto/ldap/listener.py
EntySec/pex
0
12772045
#!/usr/bin/env python3 # # MIT License # # Copyright (c) 2020-2022 EntySec # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to...
1.601563
2
tests/unit/providers/aws/test_AWSConfigBuilder.py
romsok24/epiphany
0
12772046
from cli.src.providers.aws.InfrastructureBuilder import InfrastructureBuilder from cli.src.helpers.objdict_helpers import dict_to_objdict def test_get_resource_group_should_set_proper_values_to_model(): cluster_model = get_cluster_model(cluster_name='TestCluster', address_pool='10.20.0.0/22') builder = Infrast...
2.171875
2
docs/cross.py
txt/sin21
1
12772047
import random,math def distribution(decay,buckets): "Return random numbers, sum noamrlzes 0..1" tmp=[random.random()] for _ in range(buckets-1): old=tmp[-1]; tmp += [old*decay] s=sum(tmp) return sorted([x/s for x in tmp]) def run(n=1000,decay=0.99,dimensions=10, buckets = 10): ds=[distribution...
3.28125
3
config/production.py
javicacheiro/device-info-service
0
12772048
DEBUG = False CONSUL_URL = 'http://consul:8500/v1/kv'
1.007813
1
train_2.py
pengfeidip/refindeDet_Pytorch
12
12772049
<reponame>pengfeidip/refindeDet_Pytorch<gh_stars>10-100 """Adapted from: @longcw faster_rcnn_pytorch: https://github.com/longcw/faster_rcnn_pytorch @rbgirshick py-faster-rcnn https://github.com/rbgirshick/py-faster-rcnn Licensed under The MIT License [see LICENSE for details] """ import torch import torch...
2.03125
2
examples/small.py
bvarjavand/ngl-bot
0
12772050
from ngubot.utils.base import BaseGame import pyautogui as pag import time game = BaseGame() def clean(game): itemsToMerge = [ "Head", "Chest", "Legs", "Boots", "Weapon", "Accessory1", "0_0", "0_1", "0_2", "0_3", "0_4", ...
2.703125
3