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
test.py
ahwhbc/LookIntoPerson
79
12794851
<gh_stars>10-100 # import the necessary packages import argparse import os import cv2 as cv import keras.backend as K import numpy as np from config import num_classes from data_generator import random_choice, safe_crop, to_bgr from model import build_model if __name__ == '__main__': # Parse arguments ap = a...
2.453125
2
tests/func_indycmd_test.py
pustotnik/raven
2
12794852
# coding=utf-8 # # pylint: disable = wildcard-import, unused-wildcard-import # pylint: disable = missing-docstring, invalid-name # pylint: disable = unused-argument, no-member, attribute-defined-outside-init # pylint: disable = too-many-lines, too-many-branches, too-many-statements """ Copyright (c) 2020, <NAME>. Al...
1.867188
2
Forum/views.py
Galbar/django-forum
2
12794853
# -*- coding: utf-8 -*- import json from django.http import Http404, HttpResponse from django.views.decorators.csrf import csrf_protect from django.contrib.auth.decorators import login_required from django.contrib.auth import logout as lgout, authenticate, login as lgin from django.shortcuts import render, redirect fro...
2.03125
2
spinup/algos/ude_td3_new/uncertainty_on_rnd.py
LinghengMeng/spinningup
0
12794854
<reponame>LinghengMeng/spinningup import numpy as np import tensorflow as tf import time from spinup.algos.ude_td3_new.core import MLP, BeroulliDropoutMLP, BootstrappedEnsemble, get_vars, count_vars from spinup.algos.ude_td3_new.replay_buffer import ReplayBuffer, RandomNetReplayBuffer from spinup.utils.logx import Epo...
1.984375
2
venv/lib/python2.7/dist-packages/landscape/monitor/plugin.py
pengwu/scapy_env
0
12794855
<reponame>pengwu/scapy_env from logging import info from twisted.internet.defer import succeed from landscape.log import format_object from landscape.lib.log import log_failure from landscape.broker.client import BrokerClientPlugin class MonitorPlugin(BrokerClientPlugin): """ @cvar persist_name: If specifie...
2.3125
2
Desafio 4/main.py
nathaliadv/AceleraDevDS_Codenation
1
12794856
#!/usr/bin/env python # coding: utf-8 # # Desafio 4 # # Neste desafio, vamos praticar um pouco sobre testes de hipóteses. Utilizaremos o _data set_ [2016 Olympics in Rio de Janeiro](https://www.kaggle.com/rio2016/olympic-games/), que contém dados sobre os atletas das Olimpíadas de 2016 no Rio de Janeiro. # # Esse _d...
3.828125
4
blog/migrations/0003_auto_20190504_0806.py
avahmh/Drman
0
12794857
<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-05-04 08:06 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import mptt.fields class Migration(migrations.Migration): dependencies = [ ('blog', '0002_post_likes'), ...
1.570313
2
src/cautious_invention/utils.py
MerktSimon/cautious-invention
0
12794858
# -*- coding: utf-8 -*- """Contain the utilities of cautious-invention.""" my_awesome_constant = 4 def hello_world(): """Print hello World.""" print("Hello, I am a cautious invention") def add(x, y): """Add two numbers together.""" return x+y
2.59375
3
SparkProgramming/2.4.MovieRatingData/p24_spark.py
yevheniyku/Cloud-and-Big-Data
0
12794859
<gh_stars>0 from pyspark import SparkConf, SparkContext def rating(x): if(x <= 1) : return 1 if(x <= 2) : return 2 if(x <= 3) : return 3 if(x <= 4) : return 4 else : return 5 def movieRating(input): ratingsRDD = input.map(lambda x: x.split(",")) ratingsRDD = ratingsRDD.map(lambda x: (x[1],...
3.234375
3
tests/test_content_search.py
TAPP-TV/django-bulbs
0
12794860
from __future__ import absolute_import import itertools import datetime from django.utils import timezone from django.test.client import Client from django.template.defaultfilters import slugify from bulbs.content.models import Content, Tag, FeatureType from elastimorphic.tests.base import BaseIndexableTestCase fro...
2.125
2
misc.py
Friendly0Fire/manim-utils
0
12794861
<gh_stars>0 def split_on_condition(seq, condition): a, b = [], [] for item in seq: (a if condition(item) else b).append(item) return a, b
2.8125
3
gwtarget/DESI_mainInjector/Main-Injector-master/python/sourceProb.py
rknop/timedomain
1
12794862
import numpy as np import os import scipy.stats import mags import hp2np import warnings license=""" Copyright (C) 2014 <NAME> This program is free software; you can redistribute it and/or modify it under the terms of version 3 of the GNU General Public License as published by the Free Software Foundation...
1.953125
2
Python/Maths/matrices.py
GeneralNZR/maths-and-javascript
3
12794863
<filename>Python/Maths/matrices.py<gh_stars>1-10 """ Description: Différentes fonctions pour manipuler des matrices. Auteur: <NAME> Version: 1.0 """ def matrice_identite(n: int) -> list: """ Description: Crée une matrice identité de taille n. Paramètres: n: {int} -- Taill...
3.59375
4
app/__init__.py
onyxcherry/OnyxcherryOTP
1
12794864
<reponame>onyxcherry/OnyxcherryOTP<gh_stars>1-10 import os from dataclasses import dataclass from config import Config, CSPSettings from dotenv import load_dotenv from flask import Flask, current_app, render_template, request from flask_babel import Babel from flask_babel import lazy_gettext as _l from flask_bcrypt im...
2.265625
2
silverpieces/__init__.py
fareedmirza/silverpieces
1
12794865
<reponame>fareedmirza/silverpieces<filename>silverpieces/__init__.py # required for python2?
0.984375
1
RetrieveMolWeights.py
dcoukos/CHO_network
1
12794866
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jan 24 16:03:28 2018 @author: dimitricoukos Test: in command line: python RetrieveUniProt.py 'Unit Tests/sample_brenda_parameters.json' """ import sys import cobra_services as CS from multiprocessing import Pool from urllib.error import HTTPError f...
1.75
2
local-pipelines/python-ggnn-expr-completion/datagen/get_data.py
kiteco/kiteco-public
17
12794867
import argparse import datetime import json import logging import pickle import time import shutil from kite.graph_data.data_feeder import EndpointDataFeeder from kite.graph_data.session import RequestInit from kite.graph_data.graph_feed import GraphFeedConfig from kite.infer_expr.config import MetaInfo, Config from...
2.140625
2
experiments/utils/nets/cnn_factory.py
ezetl/deep-learning-techniques-thesis
0
12794868
<filename>experiments/utils/nets/cnn_factory.py #!/usr/bin/env python2.7 import caffe from caffe import (layers as L, params as P) from layers_wrappers import * caffe.set_device(0) caffe.set_mode_gpu() class MNISTNetFactory: @staticmethod def standar(lmdb_path=None, batch_size=125, scale=1.0, is_train=True...
2.796875
3
solveLinearEquation/gauss-with-pivot.py
terasakisatoshi/pythonCodes
0
12794869
<gh_stars>0 import numpy as np # Example1 a = np.matrix([[0, 4, 5, 2], [1, 0, 2, -6], [4, 1, 0, -2], [1, 7, 1, 0]], dtype='float64') b = np.matrix([9, -3, 1, -3], dtype='float64').T x = np.matrix([None]*4, dtype='float64').T # Example2 a = np.matrix([[2, 4, 6], ...
2.234375
2
setup.py
hansek/django-groups-sync
0
12794870
<gh_stars>0 import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="django-groups-sync", version="0.0.7", author="<NAME>", author_email="<EMAIL>", description="A set of management commands to export and sync Django User Groups permissions betwe...
1.289063
1
VGGish/f_XGboost_spatial_class_hand.py
ducphucnguyen/TransferLearningWFN
0
12794871
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Thu Dec 23 11:24:09 2021 @author: nguy0936 I used this code to classify noise at different location using Xhand data """ # load packages import pandas as pd import umap import matplotlib.pyplot as plt import numpy as np from sklearn.decomposition import PCA from skle...
2.1875
2
examples/control_point_av.py
aleixq/python3-brisa
4
12794872
# Licensed under the MIT license # http://opensource.org/licenses/mit-license.php or see LICENSE file. # Copyright 2007-2008 <NAME> <<EMAIL>> from brisa.core.reactors import install_default_reactor reactor = install_default_reactor() import sys from brisa.upnp.control_point.control_point_av import ControlPointAV fro...
1.90625
2
OnlineStudy/rbac/service/routers.py
NanRenTeam-9/MongoMicroCourse
132
12794873
from collections import OrderedDict from django.utils.module_loading import import_string from django.conf import settings from django.urls.resolvers import URLResolver, URLPattern import re def check_url_exclude(url): for regex in settings.AUTO_DISCOVER_EXCLUDE: if re.match(regex, url): retur...
2.375
2
tests/views/test_camera_control_widget.py
lsst-sitcom/spot_motion_monitor
0
12794874
# This file is part of spot_motion_monitor. # # Developed for LSST System Integration, Test and Commissioning. # # See the LICENSE file at the top-level directory of this distribution # for details of code ownership. # # Use of this source code is governed by a 3-clause BSD-style # license that can be found in the LICE...
2.15625
2
baselines/neural_best_buddies/get_missing.py
iviazovetskyi/rewriting
526
12794875
<reponame>iviazovetskyi/rewriting import os from netdissect import pidfile from options.options import Options from tqdm import tqdm opt = Options().parse() def get_imgs(): img_nums = sorted([int(f.strip().split(f'{base_name}_')[1].split('.')[0]) for f in os.listdir(opt.source)]) file_names = [f'{base_name}_{...
2.21875
2
asyncio_connection_pool/contrib/datadog.py
fellowinsights/asyncio-connection-pool
6
12794876
<gh_stars>1-10 from contextlib import asynccontextmanager, AsyncExitStack from datadog import statsd from ddtrace import tracer from typing import AsyncIterator, TypeVar from asyncio_connection_pool import ConnectionPool as _ConnectionPool __all__ = ("ConnectionPool",) Conn = TypeVar("Conn") class ConnectionPool(_Co...
2.234375
2
parse_map.py
cadoman/map-parser
0
12794877
<filename>parse_map.py import argparse import matplotlib.pyplot as plt from shapely import geometry from map_extractor import preprocessing, shape_extraction, country_naming import skimage.color from map_extractor.PolygonGroup import PolygonGroup import json import numpy as np import cv2 def display_img(img, title="...
2.828125
3
assemblyline/assemblyline/common/yara/yara_importer.py
dendisuhubdy/grokmachine
46
12794878
<reponame>dendisuhubdy/grokmachine import os import logging from assemblyline.common import isotime from assemblyline.al.common import forge class YaraImporter(object): REQUIRED_META = ['description', 'id', 'organisation', 'poc', 'rule_version', 'yara_version', 'rule_group'] def __init__(self, logger=None)...
1.757813
2
test.py
doncat99/zvt
10
12794879
<filename>test.py # import asyncio # import functools # import time # import random # import multiprocessing # import aiomultiprocess # import uvloop # import numpy as np # from tqdm import tqdm # # # 下载协程 # # async def download(url): # # cost = time.time() # # await asyncio.sleep(3) # 模拟1秒的下载过程 # # ret...
2.609375
3
teamdjibouti-solutions/teamdjibouti_contains.py
benkhaireh/parcrobotic
0
12794880
# Script pour rechercher un entier x dans un tableau # ------------------------------------------------------------ # Fonction de recherche d'un entier x dans un tableau def contient(arr, taille, x): # Recherche de l'entier x dans le tableau. if x in arr: print("true") else: print("false") ...
3.6875
4
pyny/fields.py
7pairs/pyny
0
12794881
<filename>pyny/fields.py # -*- coding: utf-8 -*- # # Copyright 2015−2019 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
2.234375
2
idingtalk/idingtalk/__init__.py
icmdb/iwebhooks
0
12794882
# -*- coding: utf-8 -*- from .incoming import dingtalk_incoming if __name__ == "__main__": token = "" payload = { "msgtype" : "markdown", "markdown": { "title": "This is the title!", "text" : "\n\n".join([ "# This is title", "> This is f...
2.0625
2
yolov5-coreml-tflite-converter/utils/constants.py
SchweizerischeBundesbahnen/sbb-ml-models
0
12794883
<filename>yolov5-coreml-tflite-converter/utils/constants.py<gh_stars>0 import os # -------------------------------------------------------------------------------------------------------------------- # # Constants # -------------------------------------------------------------------------------------------------------...
1.734375
2
subsworld/subsEnd.py
mugdhaadhav/subsworld
1
12794884
<filename>subsworld/subsEnd.py def endSubStatus(val): if val == 0: print('\nSubtitle Downloaded Successfully... ') if not input('\nPlease press enter to keep searching the same or press any other key to search other substitle: '): return else: from subsworld import su...
3.34375
3
src/setup.py
GML22/GeocoderPL
0
12794885
<reponame>GML22/GeocoderPL from setuptools import setup setup( name='geocoderpl', version='1.1', description='GeocoderPL is an application written in Python, which can be used for geocoding address points in ' + 'Poland along with the possibility to display basic information about a given a...
2.453125
2
tests/plugins/test_yum_inject.py
goldmann/dock
0
12794886
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import print_function import os try: from collections import OrderedDict except ImportError: # Python 2.6 from o...
2.03125
2
run/base/hpe_base_util.py
KAIST-HCIL/DeepFisheyeNet
23
12794887
from dataset.data_model import HandDataModel def unpack_data(results, is_eval = False): joint_out = results['joint'] heatmap = None heatmap_true = None if not is_eval: heatmap = results['heatmap'] heatmap_true = results['heatmap_true'] heatmap_reprojected = results['heatmap_repr...
2.234375
2
leetcode/1143.最长公共子序列/1143-最长公共子序列.py
ruisunyc/-
2
12794888
<reponame>ruisunyc/-<gh_stars>1-10 class Solution: def longestCommonSubsequence(self, text1: str, text2: str) -> int: m = len(text1)+1 n = len(text2)+1 dp = [[0]*n for _ in range(m)] for i in range(1,m): for j in range(1,n): if text1[i-1]==text2[j-1]: ...
2.78125
3
neurokit2/hrv/hrv.py
vansjyo/NeuroKit
0
12794889
# -*- coding: utf-8 -*- import pandas as pd import matplotlib import matplotlib.pyplot as plt from .hrv_time import hrv_time from .hrv_frequency import hrv_frequency from .hrv_frequency import _hrv_frequency_show from .hrv_nonlinear import hrv_nonlinear from .hrv_nonlinear import _hrv_nonlinear_show from .hrv_utils im...
3.0625
3
disno/objects/__init__.py
QwireDev/disno
0
12794890
""" disno.objects ~~~~~~~~~~~~~ Independently usable object models for the Discord API. Docs reference: https://discord.dev :copyright: (c) 2021-present Qwire Development Team :license: MIT, see LICENSE for more details. """ from .user import *
0.839844
1
tensorstream/helpers/any_nan_spec.py
clems4ever/tensorstream
5
12794891
import math import tensorflow as tf import unittest from tensorstream.helpers.any_nan import any_nan def in_tf(x): with tf.Session() as sess: return sess.run(x) class AnyNanSpec(unittest.TestCase): def test_any_nan_scalar(self): x = any_nan(tf.constant(4.0)) self.assertEqual(in_tf(x), False) y =...
2.6875
3
texaslan/voting/views.py
hsmeans/texaslan.org
2
12794892
from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.core.urlresolvers import reverse from django.contrib import messages from django.views.generic import ListView, CreateView, DetailView, FormView from django.forms import ValidationError from .models import Candidate...
1.953125
2
remote/task.py
jackyin68/paramiko-windows
1
12794893
from multiprocessing import Process import os import time def run_proc(process_name): print('running subprocess %s(%s)......' % (process_name, os.getpid())) count = 100 for i in range(count): print("*** {} ***".format(i)) time.sleep(1) os.mkdir(str(count)) print('sub process end') ...
2.921875
3
src/affe/tests/__init__.py
eliavw/affe
1
12794894
<filename>src/affe/tests/__init__.py from .resources import get_dummy_flow
1.109375
1
DeepHyperion-MNIST/train_model.py
IharBakhanovich/DeepHyperion
5
12794895
<reponame>IharBakhanovich/DeepHyperion<filename>DeepHyperion-MNIST/train_model.py import argparse import sys import numpy as np from os import makedirs from os.path import exists import tensorflow as tf CLIP_MIN = -0.5 CLIP_MAX = 0.5 K = tf.keras.backend mnist = tf.keras.datasets.mnist np_utils = tf.keras.utils Seque...
2.65625
3
2new_task.py
booiljung/pymqdemo
0
12794896
<filename>2new_task.py # 참조: https://blog.storyg.co/rabbitmqs/tutorials/python/02-work-queue import pika import sys connection = pika.BlockingConnection(pika.ConnectionParameters('localhost')) channel = connection.channel() channel.queue_declare(queue='task_queue', durable=True) message = ' '.join(sys.argv[1:]) or ...
2.75
3
read_shapefile.py
clearedTakeoff/Bridge-Reconstruction
0
12794897
<gh_stars>0 import shapefile class ShapefileReader: def __init__(self, filename): # Open and read the shapefile (file extension not required, only filename) self.sf = shapefile.Reader(filename) # Save all entries in the file, each entry containing both shape and record object self...
3.25
3
timelap/models.py
TonyEight/django-timelap
0
12794898
from django.db import models from django.core.exceptions import ValidationError from django.utils.translation import ugettext as _ __all__ = ['ModelWithDateRange', 'ModelWithDateTimeRange',] class ModelWithDateRange(models.Model): # Attributes start_date = models.DateField() end_date = models.DateField(...
2.421875
2
28_uvm_component/testbench.py
raysalemi/python4uvm_examples
1
12794899
<reponame>raysalemi/python4uvm_examples<filename>28_uvm_component/testbench.py import pyuvm from pyuvm import * # # uvm_component # ## Running the phases # Figure 1: A uvm_test demonstrating the phase methods @pyuvm.test() class PhaseTest(uvm_test): # uvm_test extends uvm_component def build_phase(self): ...
2.25
2
degvabank/degvabank/apps/transaction/urls.py
Vixx-X/DEGVABanck-backend
0
12794900
from django.urls.conf import path, include from rest_framework import routers from . import views router = routers.DefaultRouter() router.register( r"transactions", views.TransactionViewSet, ) user_transaction_urls = [ path( "transactions/", views.UserTransactionListCreateView.as_view(), ...
1.875
2
cardinal_pythonlib/openxml/pause_process_by_disk_space.py
RudolfCardinal/pythonlib
10
12794901
#!/usr/bin/env python3 # cardinal_pythonlib/openxml/pause_process_by_disk_space.py """ =============================================================================== Original code copyright (C) 2009-2021 <NAME> (<EMAIL>). This file is part of cardinal_pythonlib. Licensed under the Apache License, Versi...
1.960938
2
aula06/Strings_P1.py
viniciusFernandesInacio/Curso_Python
0
12794902
<filename>aula06/Strings_P1.py curso="Curso de Python" #print(curso[9:15]) #print(curso.strip()) #remove os espaços da string #print(curso.lower().strip()) #converte a string para letras minusculas #print(curso.upper()) #converte a string para letras maiusculas #print(curso.replace("Python","SQL")) #troca obje...
4.0625
4
src/labeling.py
misads/im_scripts
8
12794903
<reponame>misads/im_scripts # encoding=utf-8 import pdb import numpy as np import os import argparse import cv2 import numpy as np from src.base import Base from src.load_config import load_yml from src.misc_utils import attach_file_suffix, binaryzation, args, random_crop class Labeling(Base): def __init__(self...
2.390625
2
maincrawler/apps.py
sharawy/genie_crawler
0
12794904
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import AppConfig class SpidermanagerConfig(AppConfig): name = 'maincrawler'
1.023438
1
ALDS/ALDS1_2_D.py
yu8ikmnbgt6y/MyAOJ
1
12794905
<filename>ALDS/ALDS1_2_D.py import sys import io input_txt = """ 1 1 """ sys.stdin = io.StringIO(input_txt) print(input()) # copy the below part and paste to the submission form. # ---------function------------ def insertion_sort(array, gap): n = len(array) cnt = 0 for i in range(gap, n...
3.6875
4
setup.py
btrspg/Animal-Courier
0
12794906
<reponame>btrspg/Animal-Courier import configparser from setuptools import setup, find_packages version = configparser.ConfigParser() version.read('VERSION') install_requires = [ 'numpy>=1.15', 'pandas>=0.23.4', 'certifi>=2018.10.15', 'psutil>=5.4.8', 'python-dateutil>=2.7.5', 'pytz>=2018.7',...
1.875
2
multi_sokoban/actions.py
FjodBorg/Multi_Agent_AI
1
12794907
<filename>multi_sokoban/actions.py """Define literals and actions schemas for the muli-PDDL framework.""" import copy import operator from typing import Dict import numpy as np from utils import println class Literals: def __init__(self, parent: "Literals" = None): # initializes the literals if ...
2.40625
2
adv_patch_bench/models/common.py
chawins/adv-patch-bench
1
12794908
from turtle import forward import torch import torch.nn as nn class Normalize(nn.Module): def __init__(self, mean, std, *args, **kwargs): super().__init__() self.register_buffer('mean', torch.tensor(mean)[None, :, None, None]) self.register_buffer('std', torch.tensor(std)[None, :, None, No...
2.703125
3
main_headless.py
riteshgn/aryabhatta-2048
0
12794909
<filename>main_headless.py import json import statistics import time # from ai_engine.engine_best_score_v2 import BestScore as AIEngine # from ai_engine.engine_best_score_with_depth import BestScoreWithDepth as AIEngine from ai_engine.engine_expectimax_with_heur_v1 import Expectimax as AIEngine from ai_oracle.oracle_p...
2.375
2
safe/safe_dict.py
andreclaudino/python-safe-dict
0
12794910
<gh_stars>0 class SafeDict(dict): def __init__(self, dictionary:dict = {}, default=None, **kwargs): super().__init__(**dictionary, **kwargs) self.default = default def __getitem__(self, key): return self.get(key, self.default)
2.78125
3
extension/level2hbase.py
wanji/dicaf
0
12794911
#!/usr/bin/env python # coding: utf-8 ######################################################################### ######################################################################### """ File Name: level2hbase.py Author: <NAME> E-mail: <EMAIL> Created on: Sat Jun 7 13:36:03 2014 CST """ DESCRIPTI...
2.734375
3
bannerpunk/extension.py
jarret/bannerpunk
3
12794912
<reponame>jarret/bannerpunk from bolt.util import h2b from bolt.bigsize import BigSize from bolt.tlv import Tlv from bolt.namespace import Namespace from bolt.hop_payload import HopPayload, TlvHopPayload from bannerpunk.pixel import Pixel PIXEL_TLV_TYPE = 44445 ART_TLV_TYPE = 44443 class Extension: def _encode_p...
1.914063
2
Rota_System/UI/Vacancies/__init__.py
ergoregion/Rota-Program
0
12794913
<gh_stars>0 __author__ = '<NAME>' from widget_vacancies import VacanciesWidget
1.125
1
Chapter04/reduction.py
DzulJalali/Python-Pararel_SISTER
1
12794914
<reponame>DzulJalali/Python-Pararel_SISTER import numpy from mpi4py import MPI comm = MPI.COMM_WORLD size = comm.size rank = comm.rank array_size = 10 recvdata = numpy.zeros(array_size,dtype=numpy.int) senddata = (rank+1)*numpy.arange(array_size,dtype=numpy.int) print(" process %s sending %s " %(rank , senddata))...
2.765625
3
dog_cmd.py
vilsmeier/SummerSession_2021
1
12794915
<reponame>vilsmeier/SummerSession_2021 from DogService import * add_heart_rate(2,89)
1.03125
1
src/modeling/datagens.py
ilrd/Pulmonary-Fibrosis
0
12794916
import numpy as np from tensorflow import keras import pandas as pd import os class DcmDataGenerator(keras.utils.Sequence): """Generates data for Keras Sequence based data generator. Suitable for building data generator for training and prediction. """ def __init__(self, images_path, dim=(15, 512, 51...
3.171875
3
lib/fuzzy_word_search_results.py
dev-mike-del/fuzzy-word-search
0
12794917
<filename>lib/fuzzy_word_search_results.py """This module performs a 'fuzzy search on on JSON file""" #!/usr/bin/env python # -*- coding: utf-8 -*- from lib.fuzzy_word_search_work import FuzzyWordSearchWork # Performs a 'fuzzy search' on given JSON. # See test_input.json for JSON format class FuzzyWordSearch(FuzzyWor...
3.703125
4
src/abc194_b.py
06keito/study-atcoder
1
12794918
<gh_stars>1-10 N = int(input()) li = [list(map(int,input().split())) for i in range(N)] ans = 10**9 for idx_a in range(N): for idx_b in range(N): A,B = li[idx_a][0],li[idx_b][1] if idx_a==idx_b: ans = min(ans,A+B) else: ans = min(ans,max(A,B)) print(ans)
2.40625
2
src/api/datahub/databus/migration_views.py
Chromico/bk-base
84
12794919
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-BASE 蓝鲸基础平台 is licensed under the MIT License. License for BK-BASE 蓝鲸基础平台: ------------------------------------------...
1.320313
1
tests/test_delete_contact.py
s34rching/python_classes
0
12794920
<filename>tests/test_delete_contact.py # -*- coding: utf-8 -*- from models.contact import Contact import random import pytest def test_delete_contact(app, orm, check_ui): with pytest.allure.step('Given a non-empty contact list'): if app.contact.count() == 0: app.contact.create(Contact(firstname...
2.6875
3
BrushUp/import.py
JaviFdezT/brush_up
0
12794921
<filename>BrushUp/import.py<gh_stars>0 import time import sqlite3 from tkinter.filedialog import askopenfilename from tkinter import Tk Tk().withdraw() filename = askopenfilename(initialdir="./BBDD") connection = sqlite3.connect(filename) cursor=connection.cursor() file = open("DOCS/words.txt",'r') words,discard...
3.0625
3
graph/gp.py
HerlanAssis/Networkx-From-KML
0
12794922
from fastkml import kml from .utils import haversine class GraphFromKmlDoc: def __init__(self, filename='pracas'): self._filename = filename def _get_document(self): doc = open("pracas.kml", "r").read().encode('utf-8') self._document = kml.KML() self._document.from_...
2.765625
3
diccionario/diccionario/dictionary/models.py
ssvargass/en-senas
1
12794923
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals from django.db import models from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible from pyuploadcare.dj.models import ImageField from taggit_autosuggest.managers import Tagga...
2.078125
2
benchmark/conftest.py
yhtang/GraphDot
9
12794924
#!/usr/bin/env python # -*- coding: utf-8 -*- def pytest_benchmark_scale_unit(config, unit, benchmarks, best, worst, sort): if unit == 'seconds': prefix = 'm' scale = 1e3 elif unit == 'operations': prefix = 'K' scale = 0.001 else: raise RuntimeError("Unexpected meas...
2.40625
2
ruclip/model.py
AlexWortega/ru-clip
73
12794925
<filename>ruclip/model.py # -*- coding: utf-8 -*- import os import json from collections import OrderedDict import torch import numpy as np from torch import nn class LayerNorm(nn.LayerNorm): """Subclass torch's LayerNorm to handle fp16.""" def forward(self, x: torch.Tensor): orig_type = x.dtype ...
2.46875
2
textattack/models/summarization/t5_summarization.py
yuchenlin/TextAttack
1
12794926
<filename>textattack/models/summarization/t5_summarization.py from textattack.models.helpers import T5ForTextToText class T5Summarization(T5ForTextToText): """ A T5 model trained to summarize English text. Trained on the CNN/Daily Mail summarization dataset. For more information, please s...
2.34375
2
pcshell/shell.py
xSlither/pretty-click-shell
2
12794927
from typing import Callable import sys import os from copy import deepcopy from io import StringIO import click from click.core import MultiCommand, _check_multicommand from colorama import Style from . import globals as globs from . import _colors as colors from .chars import IGNORE_LINE from .pretty import Pretty...
2.125
2
tests/unit/test_cwl_interaction.py
Phil-Ocone/datacoco-cloud
1
12794928
<gh_stars>1-10 """ Test Cloud Watch Log """ import os import unittest from unittest.mock import MagicMock from datacoco_cloud import UNIT_TEST_KEY from datacoco_cloud.cwl_interaction import CWLInteraction class TestCWLInteraction(unittest.TestCase): def setUp(self): os.environ[UNIT_TEST_KEY] = "True" ...
2.3125
2
sendEmail.pyw
lucas-pixel/SendEmail
0
12794929
<reponame>lucas-pixel/SendEmail import smtplib import PySimpleGUI as sg from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText class Interface: def __init__(self): sg.theme('DarkPurple4') layout = [ [sg.Text('Servidor ', size=(8,1)), ...
2.546875
3
src/tasks/lesson03/task301.py
vadimkondratovich/asd
0
12794930
from django.http import HttpRequest, HttpResponse from main.util import render_template TEMPLATE = "tasks/lesson03/task301.html" def handler(request: HttpRequest) -> HttpResponse: name = request.GET.get("name") context = { "input_name": name, "greeting_name": name or "anonymous", } ...
2.671875
3
configs/fisheye_pig/yolov3_d53_mstrain-608_273e_coco_2passage_pig.py
leemengwei/my_mmdetection
1
12794931
<reponame>leemengwei/my_mmdetection<filename>configs/fisheye_pig/yolov3_d53_mstrain-608_273e_coco_2passage_pig.py<gh_stars>1-10 _base_ = '../yolo/yolov3_d53_mstrain-608_273e_coco.py' # model settings model = dict( bbox_head=dict( num_classes=2), train_cfg=dict( nms_pre=1000, nms=dict(typ...
1.453125
1
application/tests/test_camera.py
Sapfir0/web-premier-eye
0
12794932
import unittest from config import Config as cfg import requests class Camera(unittest.TestCase): routeUrl = cfg.serverUrl + "gallery/camera" camerasList = [1,2,3] def test_IsAllCamerasAvailable(self): for camera in self.camerasList: r = requests.get(f"{self.routeUrl}/{camera}") ...
3.109375
3
app/core/migrations/0004_auto_20201128_2021.py
vivek92-tech/SocialSphere-Insta-clone
1
12794933
<reponame>vivek92-tech/SocialSphere-Insta-clone # Generated by Django 3.1.3 on 2020-11-28 20:21 import core.models from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import uuid class Migration(migrations.Migration): dependenci...
1.789063
2
models/train_classifier.py
Yasir-Ghunaim/disaster_response_pipeline
0
12794934
<gh_stars>0 import sys import nltk nltk.download(['punkt', 'stopwords', 'wordnet', 'averaged_perceptron_tagger']) import re import pandas as pd import numpy as np import pickle from sqlalchemy import create_engine from nltk.tokenize import word_tokenize from nltk.corpus import stopwords from nltk.stem import WordNetLe...
2.671875
3
controller/server.py
uniaim-event-team/watch-link
2
12794935
<reponame>uniaim-event-team/watch-link from flask import Blueprint, render_template app = Blueprint(__name__, "server") @app.route('/') def route(): return render_template('top.html')
1.78125
2
tests/test_ges.py
stevenengler/witness-encryption
0
12794936
<reponame>stevenengler/witness-encryption from trivial_ges import TrivialGES import sys # Testing l = int(sys.argv[1]) n = int(sys.argv[2]) print("Instantiating with lambda = ", l, " n = ", n) x = TrivialGES(l, n) print("n: ", x.get_n()) print("lambda: ", x.get_lambda()) e = x.sample() print("Sample 1:", e) f = pri...
3.21875
3
zipline/utils/calendars/calendar_helpers.py
NunoEdgarGFlowHub/zipline
0
12794937
<gh_stars>0 # # Copyright 2016 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
2.5
2
Lab1/tt.py
Machinesaac/6.009
0
12794938
a = [(255,0,0)] print(a[0][0])
2.46875
2
objetto/reactions.py
brunonicko/objetto
8
12794939
# -*- coding: utf-8 -*- """Reactions.""" from ._reactions import CustomReaction, Limit, LimitChildren, UniqueAttributes, reaction __all__ = [ "reaction", "CustomReaction", "UniqueAttributes", "LimitChildren", "Limit", ]
1.171875
1
backend/app/crud/crud_debit.py
ralphribeiro/debito_automatico
0
12794940
from typing import Any, Dict, Optional, Union, List from fastapi.encoders import jsonable_encoder from sqlalchemy.orm import Session from app.crud.base import CRUDBase from app.models.debit import Debit from app.schemas.debit import DebitCreate, DebitUpdate class CRUDDebit(CRUDBase[Debit, DebitCreate, DebitUpdate])...
2.21875
2
Products/mcdutils/ftests/functest.py
zms-publishing/Products.mcdutils
0
12794941
<reponame>zms-publishing/Products.mcdutils # Run this test from 'zopectl run' # Requires that we are running a memcached on localhost, port 11211 import transaction from .proxy import MemCacheProxy proxy = MemCacheProxy(['localhost:11211']) session = proxy.new_or_existing('foobar') print(session) session['abc'] = ...
1.726563
2
scripts/deepimpact/brute-force.py
d1shs0ap/pyserini
451
12794942
import argparse import json import os from scipy.sparse import csr_matrix from tqdm import tqdm import numpy as np from multiprocessing import Pool, Manager def token_dict_to_sparse_vector(token_dict, token2id): matrix_row, matrix_col, matrix_data = [], [], [] tokens = token_dict.keys() col = [] data...
2.46875
2
pycc/cli/__init__.py
kevinconway/pycc
17
12794943
<filename>pycc/cli/__init__.py """Modules related to the command line interface of the project."""
1.164063
1
notebooks/snippets/nbody/create_n.py
IsabelAverill/Scipy-2017---Numba
149
12794944
@njit def create_n_random_particles(n, m, domain=1): ''' Creates `n` particles with mass `m` with random coordinates between 0 and `domain` ''' parts = numpy.zeros((n), dtype=particle_dtype) #attribute access only in @jitted function for p in parts: p.x = numpy.random.random() * doma...
2.796875
3
desidiff/src/scores.py
EquinoxOmega0/timedomain
0
12794945
<filename>desidiff/src/scores.py import numpy import copy def clipmean_one(y,ivar,mask,nsig=3): w=numpy.where(mask==0)[0] ansivar = ivar[w].sum() ansmean = numpy.sum(y[w]*ivar[w])/ansivar newy = y-ansmean w=numpy.where(numpy.logical_and.reduce([mask==0, numpy.abs(newy*numpy.sqrt(ivar)) < nsig...
2.25
2
Experiment2/URL_rating.py
aditya1271/Learning-Perspectives
0
12794946
from googlesearch import search import requests import re import csv data=[] a=[] student="Mam" def swap(text,j): temp1=text[j] temp2=text[j+1] temp3=text[j+2] temp4=text[j+3] text[j]=text[j+4] text[j+1]=text[j+5] text[j+2]=text[j+6] text[j+3]=text[j+7] text[j+4]=temp1 text[j+5]=...
3.453125
3
A1014280203/6/6.py
saurabh896/python-1
3,976
12794947
<filename>A1014280203/6/6.py import nltk import string import os # simply extend word like: it's => it is def extend_word(text): if text.find('\'') > 0: old2new = dict() words = text.split() for word in words: if word.find('\'') > 0: parts = word.spl...
3.65625
4
sub.py
waki285/rt-bot
26
12794948
<filename>sub.py """りつたん! (C) 2020 RT-Team LICENSE : ./LICENSE README : ./readme.md """ desc = """りつたん - (C) 2021 RT-Team 少女起動中...""" print(desc) from discord.ext import commands import discord # routeは無効にする。 commands.Cog.route = lambda *args, **kwargs: lambda *args, **kwargs: (args, kwargs) from ai...
2.453125
2
states/games/game_H2R.py
ianiancilla/kanacode
0
12794949
<gh_stars>0 import random import pygame from helper.textinput import TextInput from helper.pygame_helpers import create_centered_text, create_containers, place_buttons from helper.button import Button import text class H2R(object): """ A mode in which a hiragana word is displayed, and the user needs to enter...
3.453125
3
getPeriodicBoundaryCondition.py
mo-hanxuan/MagicPBC
1
12794950
""" generate periodic boundary condition (PBC). Two methods to detect and partition the surface-nodes: 1. graph-method: (recommended, can deal with arbitrary deformed shape): use dictionary-data-structure to map facet-nodes to element-number, where the surface-facet is shared ...
3.078125
3