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
django_pages/language/__init__.py
lunemec/django-pages
3
12794551
<filename>django_pages/language/__init__.py # -*- encoding: utf-8 -*- from django.http import Http404 from ..common.errors import ConfigurationError from .models import Language def get_language(url_data): """ checks for language in data from url parsing @param url_data: dict @return Language objec...
2.484375
2
scan/contours.py
Akumatic/ExamScan
0
12794552
<reponame>Akumatic/ExamScan # SPDX-License-Identifier: MIT # Copyright (c) 2019 Akumatic import cv2, imutils, numpy from . import utils ###################### # Contour operations # ###################### def find_contours ( image: numpy.ndarray, mode: int = cv2.RETR_LIST, method: int = cv2.C...
2.78125
3
setup.py
aerocyber/ShortLink
0
12794553
<reponame>aerocyber/ShortLink # Copyright 2021 aditya # # 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 l...
1.71875
2
argos/cluster.py
gyplus/comparing-trajectory-clustering-methods
92
12794554
<reponame>gyplus/comparing-trajectory-clustering-methods from scipy.sparse import lil_matrix from scipy.spatial.distance import directed_hausdorff import numpy as np import math def calculate_distance_matrix(traj_list, threshold): def hausdorf(traj1, traj2): d = max(directed_hausdorff(traj1, traj2)[0], di...
2.578125
3
tools/pretty-printers/gdb/cista_vector.py
mayhemheroes/cista
0
12794555
<reponame>mayhemheroes/cista import re import gdb.xmethod def is_cista_vector(gdb_type): return str(gdb_type.strip_typedefs().unqualified()).startswith("cista::basic_vector") def is_raw_vector(gdb_type): return not str(gdb_type.strip_typedefs().template_argument(1)).startswith("cista::offset_ptr") class Cist...
2.328125
2
var/spack/repos/builtin/packages/mrcpp/package.py
xiki-tempula/spack
1
12794556
<reponame>xiki-tempula/spack # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Mrcpp(CMakePackage): """The MultiResolution Computation Progr...
1.210938
1
rplugin/python3/tmuxdir/test_dirmngr.py
viniarck/tmuxdir.nvim
23
12794557
import os from tmuxdir.dirmngr import ConfigHandler, DirMngr import pytest @pytest.fixture def dir_mngr() -> DirMngr: folder_name = "/tmp/tmuxdirtest/" os.makedirs(folder_name, exist_ok=True) cfg_handler = ConfigHandler(folder_name=folder_name) yield DirMngr([], [".git"], cfg_handler=cfg_handler) ...
2.28125
2
kubegen/__main__.py
razaqK/kubegen
1
12794558
<gh_stars>1-10 from .kubepolicygen import KubePolicyGen from .util import log, validate_yaml import json import click @click.command() @click.option('--kind', '-k', help='what kind of k8s policy file are you trying to create. support type includes deployment, ingress and svc.') @click.option('--data', '...
2.421875
2
test/test_ude/communication/test_grpc_auth.py
aws-deepracer/ude
0
12794559
<reponame>aws-deepracer/ude ################################################################################# # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # # # Licensed under the Apache License, Version...
2.265625
2
testing/adios2/bindings/python/TestBPSelectSteps_nompi.py
taniabanerjee/ADIOS2
190
12794560
<filename>testing/adios2/bindings/python/TestBPSelectSteps_nompi.py #!/usr/bin/env python # # Distributed under the OSI-approved Apache License, Version 2.0. See # accompanying file Copyright.txt for details. # # TestBPSelectSteps_nompi.py: test step selection by reading in Python # in ADIOS2 File Write # Created on:...
2.1875
2
SF-home-price-prediction/src/learning.py
apthomas/SF-home-price-prediction
0
12794561
<reponame>apthomas/SF-home-price-prediction<filename>SF-home-price-prediction/src/learning.py<gh_stars>0 import pandas as pd import numpy as np import sklearn import matplotlib.pyplot as plt import seaborn as sns from scipy import stats from sklearn import preprocessing from sklearn.preprocessing import MinMaxScaler, R...
2.578125
3
web-server.py
filhit/dsoulstest-server
0
12794562
<reponame>filhit/dsoulstest-server from http.server import HTTPServer, BaseHTTPRequestHandler from datetime import datetime import json import ssl last_update = None last_players = None class HTTPRequestHandler(BaseHTTPRequestHandler): def end_headers (self): self.send_header('Access-Control-Allow-Origin...
2.359375
2
python scripts/detect_winning_team.py
Geoffry-Skionfinschii/Datapack_SurvivalGames
10
12794563
<reponame>Geoffry-Skionfinschii/Datapack_SurvivalGames def main(): print("# Generated by python script") for i in range(1, 22): print("execute as @r[team=TEAM_{0}, tag=InGame] run tag @a[team=TEAM_{0}] add Winner".format(i)) print("execute as @r[team=TEAM_{0}, tag=InGame] run scoreboard players ...
2.75
3
server.py
MensahDev/assignment1-im
0
12794564
<gh_stars>0 # coding: utf-8 import socketserver # Copyright 2013 <NAME>, <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 # # Un...
2.828125
3
loggingUnitTests/LoggingConfigUnitTest.py
jonreding2010/PythonLogging
0
12794565
import os import unittest from baseLogger.ConsoleLogger import ConsoleLogger from baseLogger.FileLogger import FileLogger from baseLogger.LoggingConfig import LoggingConfig from baseLogger.constants.LoggingEnabled import LoggingEnabled from baseLogger.constants.MessageType import MessageType from utilities.Config impor...
2.546875
3
fuzzytest.py
skylers27/heartsound
0
12794566
#fuzzytest.py #<NAME> #<NAME> #fuzzy clustering for testFun.dat from __future__ import division, print_function import numpy as np import matplotlib.pyplot as plt import skfuzzy as fuzz colors = ['b', 'orange', 'g', 'r', 'c', 'm', 'y', 'k', 'Brown', 'ForestGreen'] # Insert his test data instead !!!! # Then our data ...
3.171875
3
Rest-Api/app.py
jigarkcj/Booyah-
0
12794567
import os import json from os import path as pth from pytube import YouTube from pydub import AudioSegment from dejavu import Dejavu from dejavu.recognize import FileRecognizer from flask import Flask, request, abort, jsonify from werkzeug.utils import secure_filename from celery import Celery, states from celery.excep...
1.960938
2
social_graph/models.py
suselrd/django-social-graph
0
12794568
# coding=utf-8 from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.contrib.sites.managers import CurrentSiteManager from django.db import models from django.dispatch import receiver from django.utils.translat...
1.867188
2
typish/classes/_subscriptable_type.py
georgeharker/typish
16
12794569
<reponame>georgeharker/typish<gh_stars>10-100 class _SubscribedType(type): """ This class is a placeholder to let the IDE know the attributes of the returned type after a __getitem__. """ __origin__ = None __args__ = None class SubscriptableType(type): """ This metaclass will allow a t...
2.46875
2
09_road_limit/model.py
yeodongbin/2020AIChallengeCode
0
12794570
<reponame>yeodongbin/2020AIChallengeCode<gh_stars>0 import torchvision from torchvision.models.detection.faster_rcnn import FastRCNNPredictor from torchvision.models.detection.mask_rcnn import MaskRCNNPredictor from efficientnet_pytorch import EfficientNet from torchvision.models.detection import FasterRCNN from torch...
2.125
2
steamprofile/__init__.py
aaronlyy/steamprofile
0
12794571
<gh_stars>0 from .steamprofile import *
1.203125
1
sygicmaps/client.py
Sygic/sygic-maps-services-python
2
12794572
<gh_stars>1-10 import json import time import requests from sygicmaps.input import Input SERVICES_URL = "https://{}-geocoding.api.sygic.com" GEOCODE_URL_PATH = "/{}/api/geocode" GEOCODE_BATCH_URL_PATH = "/{}/api/batch/geocode" REVERSE_GEOCODE_URL_PATH = "/{}/api/reversegeocode" REVERSE_GEOCODE_BATCH_URL_PATH = "/{...
2.59375
3
tests/integration/conftest.py
eruvanos/warehouse14
2
12794573
from uuid import uuid4 import boto3 import pytest from moto import mock_dynamodb2, mock_s3 from tests.local_login import MockAuthenticator from warehouse14 import DBBackend, PackageStorage from warehouse14.repos_dynamo import DynamoDBBackend from warehouse14.storage import S3Storage @pytest.fixture def bucket(): ...
2.109375
2
admin_enhancer/tests/admin.py
JanOosting/django-admin-enhancer
1
12794574
from django.contrib import admin from .. import admin as enhanced_admin from .models import Author, Book, Character, Theme class EnhancedModelAdmin(enhanced_admin.EnhancedModelAdminMixin, admin.ModelAdmin): pass class CharacterInline(enhanced_admin.EnhancedAdminMixin, ...
1.78125
2
eulerproject.py
xiangyuwu/euler
0
12794575
<filename>eulerproject.py<gh_stars>0 import math class PrimeNumbers(object): def __init__(self): pass def determinePrime(self, testnumber): primestate = True list1 = range(3, int(math.sqrt(testnumber)) + 1) divisor_list = [element for element in list1 if element % 2 != 0] ...
3.59375
4
zardoz/zroll.py
kpow-jp/zardoz
1
12794576
import typing import discord from discord.ext import commands from .database import fetch_guild_db from .logging import LoggingMixin from .rolls import (RollHandler, QuietRollHandler, SekretRollHandler, RollList, DiceDelta) from .utils import handle_http_exception class RollCommands(commands.Cog...
2.359375
2
setup.py
rth/py-speedyfx
4
12794577
<reponame>rth/py-speedyfx #!/usr/bin/python # -*- coding: utf-8 -*- import os import sys import re from setuptools import setup, find_packages, Extension from Cython.Distutils import build_ext #from distutils.core import setup #from distutils.extension import Extension import numpy as np import Cython.Compiler.Options...
1.835938
2
pybarreleye/barrele_agent.py
LiXi-storage/barreleye
10
12794578
<reponame>LiXi-storage/barreleye """ Library for Barreleye agent. Barreleye is a performance monitoring system for Lustre. """ import json from http import HTTPStatus from pycoral import utils from pycoral import lustre_version from pycoral import ssh_host from pybarreleye import barrele_collectd class BarreleAgent()...
2.3125
2
triptodos/bootstrap_etcd.py
mikalstill/productivity
0
12794579
#!/usr/bin/python2.7 # This is a simple script which copies old tripit auth details into etcd. # If you've never run the scraper, you don't need to run this script. # $1 is a job tag, which identifies the tripit user authentication details # in etcd. import json import os import sys import etcd etcd_path = '/todo...
2.65625
3
DQN/AtariBreakoutEnv.py
viv92/wildML_RLimplementations
1
12794580
<reponame>viv92/wildML_RLimplementations import gym import numpy as np from matplotlib import pyplot as plt env = gym.envs.make("Breakout-v0") print("Action space size: {}".format(env.action_space.n)) #print(env.get_action_meanings()) observation = env.reset() print("Observation space shape: {}".format(observation.sh...
2.71875
3
cnn_model.py
bibofeng/CNN-TA-1
6
12794581
import tensorflow as tf from tensorflow import keras from tensorflow.keras.layers import Dense, Conv2D, Flatten, Dropout, MaxPooling2D from tensorflow.keras import Model class CNN(Model): def __init__(self): super(CNN, self).__init__() self.conv1 ...
3.265625
3
wbepi/parameter_estimation.py
Song921012/2021Waste_Water_Project
0
12794582
<reponame>Song921012/2021Waste_Water_Project from __future__ import absolute_import from __future__ import division from __future__ import print_function from wbepi import basic_models as md import numpy as np import matplotlib.pyplot as plt import seaborn as sns from lmfit import Parameters, minimize, report_fit impo...
2.78125
3
radiopadre/__init__.py
ratt-ru/radiopadre
9
12794583
<reponame>ratt-ru/radiopadre<filename>radiopadre/__init__.py<gh_stars>1-10 import json import nbformat import os import pkg_resources import radiopadre_kernel from IPython.display import display, HTML, Javascript from radiopadre_utils.notebook_utils import scrub_cell from radiopadre import settings_manager from rad...
2
2
code/141.Linked-List-Cycle-v2.py
Aden-Q/leetcode
1
12794584
from collections import Counter from collections import deque class Solution: def ladderLength(self, beginWord: str, endWord: str, wordList: List[str]) -> int: wordList = set(wordList) if endWord not in wordList: return 0 q = deque([beginWord]) step = 0 w...
3.453125
3
main.py
mrprompt/CriptosIOT
2
12794585
<filename>main.py from screen import oled from config import CRIPTOS import criptos import time while True: oled.fill(0) oled.text("Consultando", 1, 1, 1) oled.show() for moeda in CRIPTOS: cotacao = criptos.do_criptos(moeda) oled.fill(0) oled.text("Moeda: {}".format(cota...
2.609375
3
saticl/trainer/base.py
edornd/multimodal-icl
6
12794586
<reponame>edornd/multimodal-icl from __future__ import annotations import time from collections import OrderedDict, defaultdict from enum import Enum from posix import listdir from typing import TYPE_CHECKING, Any, Dict, Iterable import numpy as np import torch from accelerate import Accelerator from torch import nn ...
1.820313
2
python/woofpicbot/main.py
intothevoid/bikeshed
0
12794587
from telegram import update from telegram.ext import Updater, CommandHandler import requests import re import os URL = "https://random.dog/woof.json" def get_url(): contents = requests.get(URL).json() url = contents["url"] return url def woof(update, context): url = get_url() chat_id = update.m...
2.578125
3
opt/program/src/features/build_features.py
fbomb111/full-stack-mlops
0
12794588
<reponame>fbomb111/full-stack-mlops import pandas as pd import numpy as np import keras import os prefix = '/' if "IS_CONTAINER" in os.environ else './' data_path = os.path.join(prefix, 'opt/ml/input/data') train_path = os.path.join(data_path, 'processed') def main(): print(os.getcwd()) train = pd.read_csv(os...
2.9375
3
test_utilities/src/d1_test/instance_generator/format_id.py
DataONEorg/d1_python
15
12794589
#!/usr/bin/env python # This work was created by participants in the DataONE project, and is # jointly copyrighted by participating institutions in DataONE. For # more information on DataONE, see our web site at http://dataone.org. # # Copyright 2009-2019 DataONE # # Licensed under the Apache License, Version 2.0 (t...
1.96875
2
scripts/task_space_force_control.py
MatthiasDR96/industrial_robotics_simulator
1
12794590
import math from src.Simulator import * from src.arms import * from src.controllers.task_space_force_controller import * """ This script uses force control and simulates contact with a wall at x=1.1m.""" # Create robot q_init = np.array([[math.pi / 2], [-math.pi / 2]]) robot = TwoDofArm() robot.set_q_init(q_init) #...
2.5
2
Homework/Homework III/src/SpectralClustering.py
SS47816/3D-PointCloud
1
12794591
<filename>Homework/Homework III/src/SpectralClustering.py<gh_stars>1-10 # 文件功能: 实现 Spectral Clustering 算法 import numpy as np from sklearn.cluster import KMeans import matplotlib.pyplot as plt class SpectralClustering(object): """ SpectralClustering Parameters ---------- n_clusters: int N...
3.640625
4
piccolo/utils/sync.py
telerytech/piccolo
1
12794592
<gh_stars>1-10 from __future__ import annotations import asyncio import typing as t from concurrent.futures import ThreadPoolExecutor def run_sync(coroutine: t.Coroutine): """ Run the coroutine synchronously - trying to accommodate as many edge cases as possible. 1. When called within a coroutine. ...
3.59375
4
Fun Excercise/rovarskparket.py
NirmalSilwal/Python-
32
12794593
<filename>Fun Excercise/rovarskparket.py sen=input('enter text: ') def translate(txt): result=[] vowel=['a','e','i','o','u'] for value in txt.lower(): if value in vowel: result.append(value) else: result.append(value) result.append('o') result....
3.640625
4
day07/puzzle2.py
spgill/AdventOfCode2019
0
12794594
<gh_stars>0 # stdlib imports import enum import itertools # vendor imports import click class IntCodeMachineState(enum.Enum): CLEAN = enum.auto() HALTED = enum.auto() WAITING_FOR_INPUT = enum.auto() class IntCodeMachine: def __init__(self, instructions): # Machine starts in a clean state ...
3.25
3
test_tifffolder.py
tlambert03/tifffolder
7
12794595
<gh_stars>1-10 import os from itertools import product import numpy as np import pytest import tifffile from tifffolder import LLSFolder ADD_REL = 423345 @pytest.fixture def lls_folder(tmp_path): template = "cell1_ch{c}_stack{t:04}_{w}nm_{ab:07}msec_{rel:010}msecAbs.tif" wave = [488, 560] time = range...
1.828125
2
rlutils/gym/envs/reset_obs/__init__.py
vermouth1992/rl-util
0
12794596
from .ant import AntEnv as AntResetObsEnv from .half_cheetah import HalfCheetahEnv as HalfCheetahResetObsEnv from .hopper import HopperEnv as HopperResetObsEnv from .inverted_pendulum import InvertedPendulumEnv as InvertedPendulumResetObsEnv from .pendulum import PendulumEnv as PendulumResetObsEnv from .swimmer import ...
1.117188
1
Prognostic/bin/train.py
wangxiaodong1021/HCC_Prognostic
13
12794597
import argparse import os import sys import torch import torch.utils.data from tensorboardX import SummaryWriter import torch.backends.cudnn as cudnn sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../') from utils.Survival_Aanlysis import SurvivalAnalysis from utils.RiskLayer import cox_cost from ...
1.773438
2
lpjguesstools/__init__.py
lukasbaumbach/lpjguesstools
2
12794598
import logging from logging.handlers import RotatingFileHandler import numpy as np import sys try: # python 2.7+ from logging import NullHandler except ImportError: class NullHandler(logging.Handler): def emit(self, record): pass logging.getLogger(__name__).addHandler(NullHandler()) # TO...
2.8125
3
tests/bundles/security/_app/config.py
achiang/flask-unchained
0
12794599
from flask_unchained import AppBundleConfig class Config(AppBundleConfig): SECRET_KEY = 'not-secret-key' SECURITY_SEND_REGISTER_EMAIL = True SECURITY_SEND_PASSWORD_CHANGED_EMAIL = True SECURITY_SEND_PASSWORD_RESET_NOTICE_EMAIL = True
1.507813
2
utils/prepare_for_fasttext.py
pdufter/staticlama
11
12794600
import argparse from transformers import BertTokenizer from tqdm import tqdm def main(args): """Tokenize a corpus and write one sentence per line in order to be able to train fastText on it. Args: args (TYPE) """ tok = BertTokenizer.from_pretrained(args.vocab) with open(args.corpu...
3.125
3
notepad.py
jakubiszon26/simple-notepad
1
12794601
<gh_stars>1-10 import gi gi.require_version("Gtk", "3.0") from gi.repository import Gtk builder = Gtk.Builder(); builder.add_from_file("UI.glade") handlers = { "onDestroy": Gtk.main_quit, "onExitActivate": Gtk.main_quit } builder.connect_signals(handlers) window = builder.get_object("MainWindow") window.show_...
1.757813
2
source/config.sample.py
Stegoo/ogame-caller
1
12794602
<filename>source/config.sample.py<gh_stars>1-10 og_login = 'your_login' og_password = '<PASSWORD>' og_domain = 'fr' og_universe = '10' og_id_mother_planet = '1234567' og_planets = {'340001', '340002', '340003'} #every planets except the target one og_main_planet_coordonates = ['1', '300', '6'] og_metal_threshold = 1000...
1.875
2
_erwin/main.py
der2b2/erwin
1
12794603
from _erwin import build from _erwin import serve from _erwin import clean from _erwin import initialize def run(argv): if argv[0] == "clean" or argv[0] == "c": print("Cleaning output folder") clean.run_clean() elif argv[0] == "build" or argv[0] == "b": print("Build") build.main() e...
2.609375
3
project_name/settings/apps/system.py
thnee/django-template
1
12794604
<reponame>thnee/django-template from ..base import * # noqa INSTALLED_APPS += [ 'django.contrib.admin', 'apps.admin_site', 'apps.backoffice', 'apps.frontoffice', ] ROOT_URLCONF = 'apps.system.urls'
1.234375
1
test/preprocess_tests/error_correct_intbcs_to_whitelist_test.py
YosefLab/SingleCellLineageTracing
52
12794605
import os import unittest import numpy as np import pandas as pd import cassiopeia class TestErrorCorrectIntBCstoWhitelist(unittest.TestCase): def setUp(self): dir_path = os.path.dirname(os.path.realpath(__file__)) test_files_path = os.path.join(dir_path, "test_files") self.whitelist_fp ...
2.515625
3
tests/test_views.py
yezyilomo/drf-pretty-put
28
12794606
from django.urls import reverse from rest_framework.test import APITestCase from tests.testapp.models import Book, Course, Student, Phone class ViewTests(APITestCase): def setUp(self): self.book1 = Book.objects.create(title="Advanced Data Structures", author="S.Mobit") self.book2 = Book.objects.cr...
2.4375
2
src/trader/analyser.py
edse/bl3ptrader
1
12794607
<filename>src/trader/analyser.py from collections import namedtuple from django.conf import settings from .storage import Storage from .base import * # noqa TrendResult = namedtuple('Trend', ['trend', 'current']) class Analyser(object): @staticmethod def checkTrend(): """ Check the last 2 r...
2.4375
2
bruhat/render/doc/run_tests.py
punkdit/bruhat
3
12794608
<reponame>punkdit/bruhat #!/usr/bin/env python3 """ Note: use mkdoc.py to rebuild all docs & images. """ import os import collections import bruhat.render.doc from bruhat.render.front import Canvas, Scale, Base from bruhat.render.box import Box class TestRun(Base): def __init__(self, func, start=None, end=None...
2.3125
2
machine-learning/QiWei-Python-Chinese/function/function_03.py
yw-fang/MLreadingnotes
2
12794609
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = '<NAME>' __maintainer__ = "<NAME>" __email__ = '<EMAIL>' __license__ = 'Apache License 2.0' __creation_date__= 'Dec. 25, 2018' """ This example shows how to gently make use of functions """ def add(x, y): return(x+y) """ In general, we use this functio...
3.78125
4
scripts/batchOfflineExperiment.py
e73898ms/ForgettingData
0
12794610
<filename>scripts/batchOfflineExperiment.py import sys import os import subprocess import shutil java = "Java-12 Path" jar = "Path to jar file" repository = "Path to input ontologies" outRep = "Output directory" experimentScript = "Path to the single experiment script" coverage=100 for i in range(1, 91): name = "...
2.171875
2
tests/core/test_make_requests.py
WandyYing/mussel
0
12794611
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: <NAME> @email: <EMAIL> @time: 2021/12/17 20:25 """ from unittest import mock import pytest from mussel.core.make_requests import MakeRequest from mussel.scheme.api import Interface class TestMakeAPIRequests: def test_can_be_instantiated(self): ...
2.328125
2
examples/pursuit/cosamp_step_by_step.py
carnot-shailesh/cr-sparse
42
12794612
<reponame>carnot-shailesh/cr-sparse """ CoSaMP step by step ========================== This example explains the step by step development of CoSaMP (Compressive Sensing Matching Pursuit) algorithm for sparse recovery. It then shows how to use the official implementation of CoSaMP in ``CR-Sparse``. The CoSaMP algor...
2.734375
3
evalTestSet.py
mandoway/dfp
0
12794613
import pickle from pathlib import Path from datetime import datetime from tqdm import tqdm from dfp_main import patch, PatchStats, setVerbose TEST_SET_PATH = "testSet" # How many test files should be examined [0,100] LIMIT = None def evaluateTestSet(): testFiles = list(Path(TEST_SET_PATH).iterdir()) testPa...
2.375
2
tools/conan/conans/client/generators/env.py
aversiveplusplus/aversiveplusplus
29
12794614
from conans.model import Generator from conans.paths import CONANENV class ConanEnvGenerator(Generator): @property def filename(self): return CONANENV @property def content(self): return self.deps_env_info.dumps()
1.8125
2
Classwork/format.py
rhiggins2308/G00364712-problemSet
0
12794615
<reponame>rhiggins2308/G00364712-problemSet<filename>Classwork/format.py for i in range(1, 11): print('{:2d} {:3d} {:4d} {:5d}'.format(i, i**2, i**3, i**4))
2.96875
3
build/lib/pyconfluent/kafka_streams/processor/serialization/_bytes.py
newellp2019/pyconfluent
330
12794616
<reponame>newellp2019/pyconfluent from .deserializer import Deserializer from .serializer import Serializer class BytesSerializer(Serializer[bytes]): def serialize(self, topic: str, data: bytes) -> bytes: return data def configure(self, configs, is_key): pass def close(self): pas...
2.5
2
kulkunen/apps.py
HotStew/respa
49
12794617
from django.apps import AppConfig from .signal_handlers import install_signal_handlers class KulkunenConfig(AppConfig): name = 'kulkunen' verbose_name = 'Kulkunen' def ready(self): install_signal_handlers()
1.28125
1
task 1.py
Rugvedkaikamwar/result
0
12794618
<reponame>Rugvedkaikamwar/result X=input("input the radius of the circle : ") r=float(X) a=3.14*r**2 print("area of circle : ",a)
3.96875
4
tests/events/test_schemacache.py
janw/uptimer
1
12794619
from os import path from unittest.mock import call from uptimer.events import SCHEMATA_PATH from uptimer.events.cache import SchemaCache def test_schemacache_init(mocker): mocked_open = mocker.patch.object(SchemaCache, "__missing__") schema_cache = SchemaCache() assert schema_cache is not None mock...
2.4375
2
python/crawlab/config.py
twinsant/crawlab-sdk
34
12794620
<reponame>twinsant/crawlab-sdk import os from typing import Optional def get_task_id() -> Optional[str]: try: return os.getenv('CRAWLAB_TASK_ID') except Exception: return None
1.890625
2
fa.py
BlackDragonF/FurAffinityScraper
9
12794621
<reponame>BlackDragonF/FurAffinityScraper from fa_scraper import * import argparse import sys import os import signal import pickle import json import logging import logging.config def signal_handler(signum, frame): # exit signal received, use pickle to dump scraper logger.info('exit signal received, saving...
2.53125
3
visualizer.py
margrietpalm/VisGrid3D-python
0
12794622
<reponame>margrietpalm/VisGrid3D-python #!/usr/bin/env python """Visualizes data on a cubic lattice Built specifically to visualize the VTK files created by Morpheus """ import os import glob import sys import argparse import numpy as np import vtk from vtk.util import numpy_support as VN from matplotlib import colo...
2.640625
3
python/asteria/source.py
IceCubeOpenSource/ASTERIA
2
12794623
<gh_stars>1-10 # -*- coding: utf-8 -*- """CCSN neutrino sources. This module encapsulates the basic parameters of neutrino fluxes from supernovae as modeled in the CCSN literature. For each species of neutrino one requires an estimate of the luminosity vs. time as well as the energy spectrum of the neutrinos at any gi...
2.171875
2
envpy/error.py
Combofoods/pyenv
1
12794624
<gh_stars>1-10 class BaseError(Exception): ... class UnknownError(BaseError): ... class InvalidIDError(BaseError): ... class NotFoundIDError(BaseError): ... class NotFoundEnviromentVariableError(BaseError): def __init__(self, enviromentVariable): self.enviromentVariable : str = enviromentVariable ...
2.796875
3
problems/sqrtx/solution-2.py
MleMoe/LeetCode-1
2
12794625
<filename>problems/sqrtx/solution-2.py class Solution: def mySqrt(self, x: int) -> int: l = 0 # x = 1 特例 r = x // 2 + 1 while l < r: mid = l + (r - l + 1) // 2 square = mid * mid if square > x: r = mid - 1 else: ...
3.71875
4
mtp_api/apps/security/migrations/0011_delete_securitydataupdate.py
ministryofjustice/mtp-api
5
12794626
<reponame>ministryofjustice/mtp-api # Generated by Django 1.10.5 on 2017-03-01 15:31 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('security', '0010_prisoner_profile_uniqueness'), ] operations = [ migrations.DeleteModel(name='SecurityDataUpdate')...
1.515625
2
PythonScripts/pickle_processing.py
marinmarcillat/PELGAS-TS-Analysis
0
12794627
from sklearn.neighbors import NearestNeighbors import Sv import logging import pandas as pd import numpy as np import functools import os import math logger = logging.getLogger('marin') logger.setLevel(logging.DEBUG) def point_processing(tracks_data): """ input: tracking data matrix ouput: column of dist...
3.296875
3
final_model/space_recognition_original.py
AEyeAlliance/aeye-alliance
6
12794628
<gh_stars>1-10 import torch import torch.nn as nn # import torch.onnx # import onnx # import onnx_caffe2.backend # from onnx import checker, helper import torch.optim as optim import numpy as np import cv2 from PIL import Image import torch.utils.model_zoo as model_zoo import torch.onnx def export_model(): model ...
2.59375
3
Ex010.py
paulosv2/CursoEmVideo
0
12794629
real = float(input('Insíra quantos reais voce quer converter para dólar: ')) dolar = real / 3.27 print(f'Com R${real} você pode comprar US${dolar}!')
3.625
4
data_structure/list.py
mstao/pycore
0
12794630
<filename>data_structure/list.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- # 初始化list classmates = ['Michael', 'Bob', 'Tracy'] print(classmates) # 取第一个元素 print(classmates[0]) # 取最后一个元素 print(classmates[-1]) # 追加元素到末尾 classmates.append("Mary") print(classmates) # 把元素插入到指定的位置 classmates.insert(1, "Walker") print...
4.03125
4
leagueinputs.py
pritish-devurkar/Hackathon2021_FFL
0
12794631
<reponame>pritish-devurkar/Hackathon2021_FFL from wtforms import Form, IntegerField, StringField, validators, SelectField, FieldList, FormField class InputForm(Form): league_id = IntegerField( label='League ID', validators=[validators.InputRequired()] ) year = IntegerField( label='...
2.765625
3
audiorename/utils.py
Josef-Friedrich/mutagen-renamer
0
12794632
<filename>audiorename/utils.py import re def indent(text: str) -> str: return ' ' + re.sub(r'\n', '\n ', text) def read_file(path: str) -> str: return open(path, 'r').read()
2.984375
3
grsc_app/apps.py
NicholasFry/geothermalrisingsc
0
12794633
<gh_stars>0 from django.apps import AppConfig class GrscAppConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'grsc_app'
1.28125
1
geomstats/geometry/stratified/point_set.py
shubhamtalbar96/geomstats
0
12794634
<reponame>shubhamtalbar96/geomstats """Class for Stratified Spaces. Lead authors: <NAME> & <NAME> """ import functools import itertools from abc import ABC, abstractmethod def broadcast_lists(list_a, list_b): """Broadcast two lists. Similar behavior as ``gs.broadcast_arrays``, but for lists. """ n_...
2.9375
3
mail/test.py
Codefans-fan/p2pSpider
0
12794635
<reponame>Codefans-fan/p2pSpider # -*- coding: utf-8 -*- ''' Created on Mar 18, 2016 @author: fky ''' import smtplib if not 'SMTP_SSL' in smtplib.__all__: print('''error: Server does not support SMTP-over-SSL. You could use STARTTLS instead. If SSL is needed, an upgrade to Python 2.6 on the server-side s...
1.96875
2
deepface/recognizers/recognizer_vgg.py
wanjinchang/deepface-1
1
12794636
<gh_stars>1-10 import abc import os import sys import cv2 import numpy as np import tensorflow as tf from scipy.io import loadmat import pickle from deepface.confs.conf import DeepFaceConfs from .recognizer_base import FaceRecognizer from deepface.utils.common import grouper, faces_to_rois, feat_distance_cosine cla...
1.9375
2
junos_get_bgp_neighbors.py
ksator/junos-automation-with-NAPALM
15
12794637
<filename>junos_get_bgp_neighbors.py from json import dumps from napalm_base import get_network_driver junos_driver = get_network_driver('junos') junos_device = {'username': 'pytraining', 'password': '<PASSWORD>', 'hostname': '172.30.179.95'} with junos_driver(**junos_device) as junos: print('-'*60) print junos.g...
2.375
2
log-analysis/log2tbl.py
danpoe/gpu-tools
0
12794638
#!/usr/bin/env python3 import argparse import os import sys import collections import textwrap from functools import partial import machinery as ma from machinery import ErrMsg, chk, bail from machinery import LogEntry as L from generic import lty, interleave, itemify, dupchk, listify, w_str # -----------------------...
2.5
2
CodeWars/arr_diff.py
Jaidev810/Competitive-Questions
1
12794639
<gh_stars>1-10 def arr_diff(arr1, arr2): if len(arr2) == 0: return arr1 result = list() for i in range(0, len(arr1)): flag = False for j in range(0, len(arr2)): if arr1[i] == arr2[j]: flag = True if not flag: result.append(arr1[i]...
3.5625
4
Taller_estruturas_de_control_secuenciales/Python_Daniel/Ejercicio_6.py
Danielnaki/Algoritmos_y_programacion
0
12794640
""" Entradas Numero_hombres-->int-->n_hombres Numero_mujeres-->int-->n_mujeres Salidas porcentaje_hombres-->float-->p_hombres porcentaje_mujeres-->float-->p_mujeres """ n_hombres=int(input("Ingrese el número de hombres ")) n_mujeres=int(input("Ingrese el número de mujeres ")) total=int(n_hombres+n_mujeres) p_h=float(n_...
3.984375
4
flask_api/app/resources/__init__.py
brennanhfredericks/network-monitor-server
0
12794641
<reponame>brennanhfredericks/network-monitor-server<gh_stars>0 from .packet_endpoints import ( Packet_EP, Packet_Table_EP, Packet_Table_Counts_EP, Packet_Table_Views_EP, )
1.070313
1
baselines/a2c/a2c.py
wgrathwohl/BackpropThroughTheVoidRL
44
12794642
<gh_stars>10-100 import os.path as osp import gym import time import joblib import logging import numpy as np import tensorflow as tf from baselines import logger from baselines.common import set_global_seeds, explained_variance from baselines.common.vec_env.subproc_vec_env import SubprocVecEnv from baselines.common.a...
1.710938
2
reversestring/test_.py
technolingo/AlgoStructuresPy
0
12794643
<reponame>technolingo/AlgoStructuresPy<filename>reversestring/test_.py from .index import reverse_string def test_reverse_string(): assert reverse_string('heLLo woRld') == 'dlRow oLLeh'
2.375
2
setup.py
msimms/ZwoReader
0
12794644
<reponame>msimms/ZwoReader from setuptools import setup, find_packages __version__ = '1.0.0' setup( name='ZwoReader', version=__version__, description='.', url='https://github.com/msimms/ZwoReader', packages=[], author='<NAME>', author_email='<EMAIL>', license='MIT', install_requir...
1.179688
1
arxivdigest/core/scraper/scrape_metadata.py
iai-group/arXivDigest
13
12794645
# -*- coding: utf-8 -*- """This module contains the the methods related to scraping articles from arXiv. To only scrape the metadata from the articles in the rss-stream use the harvestMetaDataRss method. It's also possible to scrape articles between any two dates, to accomplish this use the get_records_by_date method."...
2.96875
3
enumeracion.py
DannielF/Python
1
12794646
objetive = int(input('Choose a whole number: ')) answer = 0 while answer**2 < objetive: answer += 1 if answer**2 == objetive: print(f'Square root of {objetive} is {answer}') else: print(f'{objetive} it doesn´t have square root exact')
4.1875
4
cases/Diginetica/diginetica_baseline.py
sparsh-ai/reco-session
0
12794647
# This is sample baseline for CIKM Personalization Cup 2016 # by <NAME> & <NAME> import numpy as np import pandas as pd import datetime start_time = datetime.datetime.now() print("Running baseline. Now it's", start_time.isoformat()) # Loading queries (assuming data placed in <dataset-train/> queries = pd.read_csv('d...
2.484375
2
dgmvae/losses/discrete_kl.py
rnagumo/dgm_vae
5
12794648
"""Discrete KL divergence KL loss for Categorical and RelaxedCategorical ref) KL divergence in PyTorch https://pytorch.org/docs/stable/_modules/torch/distributions/kl.html#kl_divergence """ from typing import Optional, List, Dict, Tuple import sympy import torch from torch._six import inf from pixyz.distribution...
3.15625
3
pe8.py
ChrisCalderon/project-euler
1
12794649
import sys def yield_next_product(ints, n): # ints is a string while len(ints) > n: next_sequence = ints[:n] zero = next_sequence.find('0') if zero > -1: ints = ints[zero + 1:] else: yield reduce(lambda a, b: a*int(b), next_sequence, 1) ints =...
3.734375
4
services/gevent-server.py
kevinmcguinness/axes-research
1
12794650
<reponame>kevinmcguinness/axes-research #!/usr/bin/env python """ Django gevent server for axes research """ import os, sys def setup_paths(): import site old_sys_path = list(sys.path) base_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) py_version = '%d.%d' % (sys.version_in...
2.03125
2