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
gitools/modules/restore_backup.py
AliRezaBeigy/Gitools
6
12784851
from ..module import Module class RestoreBackupModule(Module): def process(self): Module.restoreBackup() @staticmethod def getFlag(): return "rb" @staticmethod def getName(): return "Restore Backup" @staticmethod def getDescription(): return "" def i...
2.421875
2
Lesson16/api.py
IslamRaslambekov/HomeWork
0
12784852
import requests from pprint import pprint def find_vacancies(parameters): URL = 'https://www.cbr-xml-daily.ru/daily_json.js' response = requests.get(URL).json() usd_rate = response['Valute']['USD']['Value'] euro_rate = response['Valute']['EUR']['Value'] URL_HH = 'https://api.hh.ru/vacancies' ...
3.09375
3
homeassistant/components/flux_led/discovery.py
gptubpkCsHKzjC8fKcRXUdK6SbECPM49P5Xu46U/core
1
12784853
<filename>homeassistant/components/flux_led/discovery.py """The Flux LED/MagicLight integration discovery.""" from __future__ import annotations import asyncio import logging from flux_led.aioscanner import AIOBulbScanner from flux_led.const import ATTR_ID, ATTR_IPADDR, ATTR_MODEL, ATTR_MODEL_DESCRIPTION from flux_le...
2.21875
2
executor/meta/env_var.py
asyre/bachelor_degree
0
12784854
import os from typing import Optional def is_env_var(value: str) -> bool: return value.startswith("$") def extract_env_var(value: str) -> Optional[str]: return os.environ[value[1:]] def must_extract_env_var(value: str) -> str: env = extract_env_var(value) if env is None: raise MissingEnvVa...
3.078125
3
train.py
yutong-xie/Depth-Estimation-based-on-CNN
0
12784855
import os import numpy as np import torch import torch.nn as nn import torchvision import PIL from torchvision import transforms from sklearn.metrics import average_precision_score from PIL import Image, ImageDraw import matplotlib.pyplot as plt from nyu_dataloader import LoadData, NYUDataset from model import CoarseN...
2.09375
2
job/SLURM/Opuntia.py
martintb/typyQ
0
12784856
<reponame>martintb/typyQ<filename>job/SLURM/Opuntia.py from SLURM import SLURMJob class OpuntiaJob(SLURMJob): #no specialization needed! pass
1.257813
1
ddpcr/app/urls.py
clinical-genomics-uppsala/where_my_assys_at
0
12784857
from django.urls import path from . import views urlpatterns = [ path('', views.Index.as_view(), name='index'), path('assays/', views.AssayList.as_view(), name='assays'), path('assays/create/', views.AssayCreate.as_view(), name='assay-create'), path('assays/upload/', views.AssaysCreate.as_view(), nam...
1.898438
2
wards/forms.py
Naomi-sigu/awwwards
1
12784858
<filename>wards/forms.py<gh_stars>1-10 from django import forms from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from .models import Profile, Projects class UpdateUser(forms.ModelForm): email = forms.EmailField() class Meta: model = User fields = ['username...
2.015625
2
dm_irods/list.py
sara-nl/surfsara-dmf-irods-client
2
12784859
<reponame>sara-nl/surfsara-dmf-irods-client import sys import atexit import json import time from argparse import ArgumentParser from .socket_server.client import Client from .socket_server.server import ReturnCode from .server import ensure_daemon_is_running from .server import DmIRodsServer from .cprint import termin...
2.234375
2
dianping/dianping/spiders/dpBaseSpider.py
MircroCode/dpSpider
0
12784860
#!/usr/local/bin/python #-*-coding:utf8-*- __author__ = 'youjiezeng' import random from scrapy.spider import BaseSpider from scrapy.spider import Spider from scrapy.contrib.spiders import CrawlSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request from scrapy.http import Response from scra...
2.671875
3
google/colab/_import_magics.py
figufema/TesteClone
1,521
12784861
<filename>google/colab/_import_magics.py # Copyright 2020 Google 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...
2.109375
2
fits2png_example/primitives/simple_fits_reader.py
Keck-DataReductionPipelines/keckdrpframework
0
12784862
""" Example to read a FITS file. Created on Jul 9, 2019 Be aware that hdus.close () needs to be called to limit the number of open files at a given time. @author: skwok """ import astropy.io.fits as pf from astropy.utils.exceptions import AstropyWarning import warnings import numpy as np from keckdrpframework.mode...
3.015625
3
ax1500-poc.py
marcnewlin/ax1500-crypto-client
14
12784863
<reponame>marcnewlin/ax1500-crypto-client<gh_stars>10-100 #!/usr/bin/env python3 import base64 import binascii import hashlib import json import logging import re import requests from Crypto.Cipher import AES, PKCS1_v1_5 from Crypto.PublicKey import RSA from pprint import pprint ROUTER_HOST = "192.168.0.1" ROUTER_PAS...
2.546875
3
Exercises.py
KA-Advocates/KATranslationCheck
1
12784864
<filename>Exercises.py #!/usr/bin/env python3 """ Utilities regarding KA exercises """ import re import os from collections import defaultdict def findFilenameToExercisesMapping(lang="de"): """ Find a map from filepath to a set of exercises. The links are extracted mainly from the tcomment section. """...
2.875
3
meldnafen/retroarch.py
cecton/meldnafen
0
12784865
<reponame>cecton/meldnafen<gh_stars>0 import re from tempfile import NamedTemporaryFile def prepare(command, controls, settings): with NamedTemporaryFile('wt', prefix='retroarch-', delete=False) as fh: for player, player_controls in sorted(controls.items()): write_retroarch_controls(fh, player...
2.359375
2
scripts/experiment/__unfinished_gan_like_model/pytorch_stuff/models/timg_denoise.py
shantanu-gupta/spad-timg-denoise
0
12784866
""" timg_denoise.py """ import numpy as np import torch import torch.nn as nn class Timg_DenoiseNet_LinT_1Layer(nn.Module): def __init__(self): super(Timg_DenoiseNet_LinT_1Layer, self).__init__() self.C = 64 self.K = 13 self.centre = 3/255.0 self.scale = 2.0 self.c...
2.296875
2
netconf/nc_rpc/base/get.py
Balaji-P/voltha_docker_compose-rsk_tech_CKAD
0
12784867
#!/usr/bin/env python # # Copyright 2016 the original author or 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
1.960938
2
astar.py
AP-Atul/SnakeAI
2
12784868
from queue import PriorityQueue from components import * class AStar: """ A star algorithm implementation f(n) = g(n) + h(n) """ def __init__(self): self.paths = [ KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN ] self.invalid = { ...
3.953125
4
examples/kmeans.py
7enTropy7/ravml
7
12784869
<reponame>7enTropy7/ravml from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from ravml.cluster import KMeans if __name__ == '__main__': k = KMeans() iris = load_iris() X = iris.data[:1000] y = iris.target[:1000] X_train, X_test, y_train, y_test = train_t...
2.484375
2
docs/new-pandas-doc/generated/pandas-DataFrame-plot-bar-3.py
maartenbreddels/datapythonista.github.io
0
12784870
<reponame>maartenbreddels/datapythonista.github.io<filename>docs/new-pandas-doc/generated/pandas-DataFrame-plot-bar-3.py<gh_stars>0 axes = df.plot.bar(rot=0, subplots=True) axes[1].legend(loc=2) # doctest: +SKIP
2.109375
2
anuvaad-etl/anuvaad-extractor/content-handler/src/db/connection_manager.py
srihari-nagaraj/anuvaad
0
12784871
from config import MONGO_CONNECTION_URL,MONGO_DB_SCHEMA from config import REDIS_SERVER_HOST,REDIS_SERVER_PORT from app import server from pymongo import MongoClient from anuvaad_auditor.loghandler import log_info, log_exception from utilities import AppContext from flask import g import redis client = MongoClient(MONG...
2.265625
2
forum/models.py
hann1010/simpleforum_test
0
12784872
<filename>forum/models.py from django.db import models from django.utils import timezone from django.contrib.auth.models import User from ckeditor.fields import RichTextField class Forum_post(models.Model): title = models.CharField(max_length=100, blank=False) post_type = models.CharField(max_length=100, blank...
2.40625
2
data_loader/data_loaders.py
lizhogn/cellpose
1
12784873
<reponame>lizhogn/cellpose from torchvision import datasets, transforms from base import BaseDataLoader from data_loader import cell_datasets class CellDataLoader(BaseDataLoader): """ Cell data loading demo using BaseDataLoader """ def __init__(self, data_dir, batch_size, shuffle=True, validation_split...
2.828125
3
corpora/tng_scripts/tng_scripts.py
galtay/word-to-vec
1
12784874
<gh_stars>1-10 from collections import Counter import json import string import numpy as np class TngScripts: def __init__(self, file_path): with open(file_path, 'r') as fp: self._scripts = json.load(fp) def iter_sentences(self): for episode in self._scripts: for sent ...
2.515625
3
project/project_files_Sylwia/student_utils.py
SylwiaNowakowska/Patient_Selection_for_Diabetes_Drug_Testing
0
12784875
<filename>project/project_files_Sylwia/student_utils.py import pandas as pd import numpy as np import os import tensorflow as tf from sklearn.model_selection import GroupShuffleSplit import functools ####### STUDENTS FILL THIS OUT ###### #Question 3 def reduce_dimension_ndc(df, ndc_df): ''' df: pandas datafram...
2.984375
3
main.py
devashishupadhyay/ml-covid-19
1
12784876
<reponame>devashishupadhyay/ml-covid-19 from core.covid import pred model = pred('Model/model.sav','covid19-features-df/covid_19_strain.pkl') print(model.predict())
1.804688
2
examples/composite_keys/testdata.py
NeolithEra/Flask-AppBuilder
3,862
12784877
import logging from app import db from app.models import Inventory, Datacenter, Rack, Item import random import string from datetime import datetime log = logging.getLogger(__name__) DC_RACK_MAX = 20 ITEM_MAX = 1000 cities = ["Lisbon", "Porto", "Madrid", "Barcelona", "Frankfurt", "London"] models = ["Server MX", "S...
2.65625
3
host.py
JinlongWukong/DevLab-ansible
0
12784878
from ansible_task_executor import AnsibleTaskExecutor import os class HOST(object): def __init__(self, ip, user, password, subnet=None, role=None): self.ip = ip self.user = user self.password = password self.role = role self.cpu = None self.memory = None se...
2.296875
2
jams/tcherkez.py
MuellerSeb/jams_python
9
12784879
#!/usr/bin/env python from __future__ import division, absolute_import, print_function import numpy as np import jams.const as const def tcherkez(Rstar, Phi=0.3, T=0.056, a2=1.0012, a3=1.0058, a4=1.0161, t1=0.9924, t2=1.0008, g=20e-3, RG=False, Rchl=False, Rcyt=False, fullmodel=T...
1.898438
2
architectures/providers/kubernetes/controlplane.py
marinmuso/architectures
15
12784880
# Do not modify this file directly. It is auto-generated with Python. from architectures.providers import _Kubernetes class _Controlplane(_Kubernetes): _service_type = "controlplane" _icon_dir = "icons/kubernetes/controlplane" class Sched(_Controlplane): _icon = "sched.png" _default_label = "Sched" ...
1.570313
2
glsl/glsl_translate.py
avr-aics-riken/SURFACE
10
12784881
<reponame>avr-aics-riken/SURFACE #!/usr/bin/env python # # TODO: # o Support array(swizzle) much more cleaner manner. # o and more... # import os import os.path import subprocess import sys import tempfile from string import Template from sexps import * gSlotToN = { 'x': 0, 'y': 1, 'z': 2, 'w': 3 } gNToSlo...
2.203125
2
lopi/descriptors/regex_validation.py
QristaLabs/LOPi
0
12784882
import re import typing as t from .typed import StringTyped class RegexDescriptor(StringTyped): def __init__(self, *args, pattern: t.Union[str, re.Pattern], **kwargs) -> None: super().__init__(*args, **kwargs) if isinstance(pattern, str): pattern = re.compile(pattern) self.p...
3.03125
3
Core/DivideExamples.py
rothadamg/UPSITE
1
12784883
<filename>Core/DivideExamples.py """ Pseudorandomly distributed subsets """ __version__ = "$Revision: 1.4 $" import Split import sys def getDocumentId(idString): return idString.rsplit(".",2)[0] def getIdFromLine(line): assert(line.find("#") != -1) return line.split("#")[-1].strip() def getDocumentIds(f...
2.671875
3
setup.py
mcx/deep_ope
64
12784884
<gh_stars>10-100 # Copyright 2020 Google LLC. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed t...
0.976563
1
test/test_invertible_1x1_conv.py
AI-Huang/glow-pytorch
0
12784885
<filename>test/test_invertible_1x1_conv.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Date : Aug-04-21 21:43 # @Author : <NAME> (<EMAIL>) import torch import torch.nn.functional as F from models.glow.invertible_1x1_conv import Invertible_1x1_Conv def invertible_1x1_conv_test(): """ Test cases: ...
2.84375
3
moderngl_window/capture/__init__.py
sheepman4267/moderngl-window
12
12784886
<reponame>sheepman4267/moderngl-window<gh_stars>10-100 from .base import BaseVideoCapture # noqa from .ffmpeg import FFmpegCapture # noqa
0.882813
1
code/119.Pascal's-Triangle-II.py
Aden-Q/leetcode
1
12784887
<gh_stars>1-10 class Solution: def getRow(self, rowIndex: int) -> List[int]: if rowIndex == 0: return [1] cur = [1, 1] next_row = cur for i in range(1, rowIndex): next_row = [1] for j in range(i): next_row.append(cur[j] + cur[j+1]) ...
3.046875
3
mesh_transformer/layers.py
VE-FORBRYDERNE/mesh-transformer-jax
2
12784888
<filename>mesh_transformer/layers.py import haiku as hk import jax import jax.numpy as jnp import numpy as np from mesh_transformer.util import f_psum, g_psum, maybe_shard, head_print from jax.experimental import PartitionSpec as P from jax.experimental.maps import thread_resources class ReplicatedLayerNorm(hk.Modul...
1.84375
2
app/tasksmodule/__init__.py
sanketsaurav/personfinder
0
12784889
<filename>app/tasksmodule/__init__.py # TODO(nworden): rename this module to just "tasks" once tasks.py is emptied and # deleted.
1.4375
1
fhir/resources/DSTU2/substance.py
cstoltze/fhir.resources
144
12784890
# -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/DSTU2/substance.html Release: DSTU2 Version: 1.0.2 Revision: 7202 """ from typing import List as ListType from pydantic import Field from . import domainresource, fhirtypes from .backboneelement import BackboneElement class Substance(domainresource.DomainReso...
2.09375
2
hrs/utils/rest.py
coyotevz/hrs
0
12784891
<reponame>coyotevz/hrs<filename>hrs/utils/rest.py # -*- coding: utf-8 -*- """ utils.rest ~~~~~~~~~~~~ Provides tools for building REST interfaces. primary function built_result(). Limitations: - Only work for simple queries agains one model. Depends on: - SQLAlchemy - Flask -...
2.390625
2
src/bitcaster/middleware/i18n.py
bitcaster-io/bitcaster
4
12784892
from django.utils import translation from bitcaster.config import settings from bitcaster.utils.language import get_attr class UserLanguageMiddleware: def __init__(self, get_response): self.get_response = get_response def __call__(self, request): if request.user and request.user.is_authentic...
2.046875
2
Experiment Processing/experiment2/count_picked_songs_per_playlist.py
Austaon/GroupRecommendationThesis
0
12784893
<reponame>Austaon/GroupRecommendationThesis<filename>Experiment Processing/experiment2/count_picked_songs_per_playlist.py<gh_stars>0 import statistics import matplotlib.pyplot as plt from database.session import Session def parse_int(playlist_string): return int(''.join(filter(str.isdigit, playlist_string))) d...
3.359375
3
cmr_localization/scripts/generate_db_name.py
MarvinStuede/cmr_localization
0
12784894
#!/usr/bin/env python import time import sys millis = int(round(time.time() * 1000)) sys.stdout.write("~/.ros/rtabmap_test_" + str(millis)+ '.db')
1.664063
2
strops/schemes/admin.py
ckoerber/strops
1
12784895
"""Admin pages for schemes models. On default generates list view admins for all models """ from django.contrib.admin import StackedInline, register from espressodb.base.admin import register_admins from espressodb.base.admin import ListViewAdmin as LVA from strops.schemes.models import ( ExpansionScheme, Ex...
1.804688
2
setup.py
Sage-Bionetworks/synapsemonitor
4
12784896
"""Setup""" import os from setuptools import setup, find_packages # figure out the version # about = {} # here = os.path.abspath(os.path.dirname(__file__)) # with open(os.path.join(here, "synapsemonitor", "__version__.py")) as f: # exec(f.read(), about) with open("README.md", "r") as fh: long_description = fh...
1.5625
2
pipeline_prepare_db.py
TobiasKoopmann/airankings
0
12784897
import urllib.request import shutil import gzip import json import re import os from collections import defaultdict from scholarmetrics import hindex from tqdm import tqdm from app.dblp_parser import parse_dblp, parse_dblp_person, get_dblp_country from app.myfunctions import get_dblp_url URL = 'http://dblp.org/xml/'...
2.765625
3
codes/data/LQGT_dataset_3d.py
LCM1999/VolumeRescaling
4
12784898
import random import numpy as np import cv2 import torch import torch.utils.data as data import logging from . import util class LQGTDataset3D(data.Dataset): ''' Read LQ (Low Quality, here is LR) and GT vti file pairs. If only GT image is provided, generate LQ vti on-the-fly. The pair is ensured by '...
2.15625
2
rl/wrench_rl.py
yifan-you-37/ScaffoldLearning
5
12784899
import multiprocessing import threading import numpy as np import os import shutil import matplotlib.pyplot as plt import sys import argparse import torch import torch.nn as nn import torch.nn.functional as F import torch.multiprocessing as mp from shared_adam import SharedAdam import math, os import cv2 import torchvi...
2.15625
2
loginsystem.py
TaylorJonesTRT/Loginsystem
0
12784900
import json import sys import hashlib user_details = {} hasher = hashlib.sha256() with open('user_credentials.json', 'r') as f: user_details = json.load(f) while True: print("Welcome to the new and sophisticated login system!") choice = input("What would you like to do? \n [1]LOGIN \n [2]REGISTER \n")...
3.625
4
991_cnn_godata_mobilenetv2_transfer_learning_with_data_augmentation_classifier.py
lao-tseu-is-alive/tensorflow2-tutorial
0
12784901
<reponame>lao-tseu-is-alive/tensorflow2-tutorial import pathlib import matplotlib.pyplot as plt import numpy as np import os # next line is to limit tensorflow verbose output os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from tensorflo...
2.9375
3
mowgli_etl/loader/_kg_edge_loader.py
tetherless-world/mowgli
4
12784902
<reponame>tetherless-world/mowgli<gh_stars>1-10 from abc import abstractmethod from mowgli_etl._loader import _Loader from mowgli_etl.model.kg_edge import KgEdge class _KgEdgeLoader(_Loader): @abstractmethod def load_kg_edge(self, edge: KgEdge): raise NotImplementedError
2.03125
2
jaxopt/_src/base.py
mblondel/jaxopt
0
12784903
<reponame>mblondel/jaxopt # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
2.421875
2
tests/oldtests/dm2_download_megatest.py
ctb/pygr
2
12784904
# test via # python protest.py dm2_download_megatest.py from pygr import nlmsa_utils import pygr.Data import os, tempfile, time def rm_recursive(top): 'recursively remove top and everything in it!' for root, dirs, files in os.walk(top, topdown=False): for name in files: os.remove(os.path.j...
2.515625
3
StockAnalysisSystem/core/interface_util.py
lifg2000/StockAnalysisSystem
0
12784905
from .AnalyzerEntry import StrategyEntry, AnalysisResult from StockAnalysisSystem.core.Utiltity.task_future import * from StockAnalysisSystem.core.DataHubEntry import DataHubEntry # For core.interface, without ui. class SasAnalysisTask(TaskFuture): def __init__(self, strategy_entry: StrategyEntry, data_hub: Data...
2.234375
2
string_algorithms/utils.py
mhozza/string_algorithms
6
12784906
from math import floor, log2 from operator import itemgetter def argmin(*args): if len(args) == 1: iterable = args[0] else: iterable = args return min((j, i) for i, j in enumerate(iterable))[1] def greatest_pow2(n): return 2 ** floor(log2(n)) def inverse_index(a): return {v: k ...
3.234375
3
test1.py
jeffhawk/pythontraining
0
12784907
<filename>test1.py import sys if sys.version_info[0] >= 3: import PySimpleGUI as sg else: import PySimpleGUI27 as sg def MachineLearningGUI(): sg.SetOptions(text_justification='right') flags = [[sg.Checkbox('Normalize', size=(12, 1), default=True), sg.Checkbox('Verbose', size=(20, 1))], [sg.Checkb...
2.5
2
setup.py
XertroV/nvblib
3
12784908
<gh_stars>1-10 from distutils.core import setup setup( name='nvblib', version='0.0.1', packages=['nvblib', 'nvblib.instructions'], url='https://github.com/XertroV/nvblib', license='MIT', author='XertroV', author_email='<EMAIL>', description='core library for nvb objects' )
1.179688
1
venv/lib/python2.7/site-packages/lettuce/plugins/scenario_names.py
GrupoMazoGuay/final
0
12784909
# -*- coding: utf-8 -*- # <Lettuce - Behaviour Driven Development for python> # Copyright (C) <2010-2012> <NAME> <<EMAIL>> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of ...
2.15625
2
dcp/003/solution.py
dantin/poj
0
12784910
<reponame>dantin/poj # -*- coding: utf-8 -*- class Node(): def __init__(self, val, left=None, right=None): self.val = val self.left = left self.right = right class Solution(): def deserialize(self, data): def decode(vals): val = next(vals) if val == ...
3.15625
3
automation/read_config_file.py
ominocutherium/gamejam-skeleton-project
0
12784911
#!/usr/bin/env python3 # MIT License # # Copyright (c) 2021 ominocutherium # # 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 righ...
1.742188
2
common/config_parser/config_dto.py
Softeq/PyCats
7
12784912
<filename>common/config_parser/config_dto.py from dataclasses import dataclass @dataclass class APIValidationDTO: check_status_code: bool check_headers: bool check_body: bool check_is_field_missing: bool @dataclass class WebDriverSettingsDTO: webdriver_folder: str default_wait_time: int ...
1.796875
2
apps/about/models.py
glenjasper/cobija-web
0
12784913
<reponame>glenjasper/cobija-web from django.db import models from auditlog.registry import auditlog class About(models.Model): title = models.CharField(max_length = 100, verbose_name = 'Title', help_text = "It's not used, it's only referential.") description = models.TextField(verbose_name = 'Description', hel...
2.125
2
mep/people/tests/test_people_commands.py
making-books-ren-today/test_eval_3_shxco
3
12784914
<reponame>making-books-ren-today/test_eval_3_shxco import datetime from io import StringIO from django.test import TestCase from mep.accounts.models import Event from mep.people.management.commands import export_members from mep.people.models import Person class TestExportMembers(TestCase): fixtures = ['sample_...
2.328125
2
server/swagger_server/test/test_notification_controller.py
kakwa/certascale
0
12784915
<reponame>kakwa/certascale<gh_stars>0 # coding: utf-8 from __future__ import absolute_import from flask import json from six import BytesIO from swagger_server.models.default_error import DefaultError # noqa: E501 from swagger_server.models.default_message import DefaultMessage # noqa: E501 from swagger_server.mod...
1.859375
2
codeforces/1111A/solution.py
yhmin84/codeforces
0
12784916
# https://codeforces.com/problemset/problem/1111/A vowels = set(["a", "e", "i", "o", "u"]) def can_partial_transform(c1, c2): if (c1 in vowels and c2 in vowels) or (c1 not in vowels and c2 not in vowels): return True return False def can_transform(hero1, hero2): hero1_len = len(hero1) if her...
4.03125
4
test4.py
Ticlext-Altihaf/Absen-Kamera
0
12784917
<filename>test4.py from deepface import DeepFace DeepFace.stream()
1.039063
1
development/modules/auxiliary_career_decision_data.py
tobiasraabe/respy_for_ma
0
12784918
<filename>development/modules/auxiliary_career_decision_data.py """This module contains the auxiliary function for the data transformation.""" import numpy as np import pandas as pd from respy.python.shared.shared_constants import TEST_RESOURCES_DIR def prepare_dataset(): """Convert the raw dataset to a DataFram...
3.09375
3
corefacility/authorizations/google/entity/authorization_token/authorization_token.py
serik1987/corefacility
0
12784919
<reponame>serik1987/corefacility from core.entity.external_authorization_token import ExternalAuthorizationToken from core.entity.entity_fields import ReadOnlyField, ManagedEntityField from .authorization_token_set import AuthorizationTokenSet from .model_provider import ModelProvider from .mock_provider import MockPr...
2.921875
3
fabric_bolt/projects/migrations/0003_auto_20150911_1911.py
jooni22/fabric-bolt
219
12784920
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('hosts', '0002_sshconfig'), ('projects', '0002_auto_20140912_1509'), ] operations = [ migrations.AddField( ...
1.71875
2
utils/download_data.py
ialifinaritra/Music_Generation
0
12784921
import urllib.request DIR_PATH = '../data/' def download_music(output_path): midiFile_l = ['cs1-2all.mid', 'cs5-1pre.mid', 'cs4-1pre.mid', 'cs3-5bou.mid', 'cs1-4sar.mid', 'cs2-5men.mid', 'cs2-3cou.mid', 'cs1-6gig.mid', 'cs6-4sar.mid', 'cs4-5bou.mid', 'cs4-3cou.mid', 'cs5-3cou.mid', ...
2.859375
3
src/stock_data_provider/cn_a/__init__.py
stonewell/learn-curve
0
12784922
#load stock data from vip data for cn_a from .vip_dataset import load_stock_data
1
1
ppgan/metric/metric_util.py
ZMpursue/PaddleGAN
4
12784923
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
2.5
2
run_gps_master.py
MarieNyst/GPS
4
12784924
import time import random import os from GPS import gps from GPS import redisHelper from GPS import helper from GPS import args from GPS import postProcess # Parse the command line arguments, then, if provided, parse the arguments in # the scenario file. Then adds default values for paramaters without definitions # ...
2.734375
3
main.py
Deepkk-9/phdc-discord-bot
0
12784925
<reponame>Deepkk-9/phdc-discord-bot #Imports import discord import os import requests import json import random import urllib from replit import db from keep_alive import keep_alive #Variables client = discord.Client() bad_words = [ "Fuck", "fuck", "Fuck You", "Shit", "Piss off", "Fuck off", "Dick head", "As...
2.734375
3
tests/test_helper.py
JimBoonie/hydra
28
12784926
<filename>tests/test_helper.py """ Helper methods for unit testing. """ REPEAT = 100
1.15625
1
server/demon/matching.py
jphacks/TK_1814
1
12784927
import sys sys.path.append('/home/kenta/pinky') from itertools import groupby import time from database import session from model import Motion, Promise def run_loop(): while True: filepath = '/home/kenta/pinky/demon/test.log' log_file = open(filepath,'a') matching() try: ...
2.34375
2
tests/snippets/type_hints.py
janczer/RustPython
0
12784928
# See also: https://github.com/RustPython/RustPython/issues/587 def curry(foo: int) -> float: return foo * 3.1415926 * 2 assert curry(2) > 10
2.28125
2
lib/gstreamer/util.py
yefengxx/vaapi-fits
0
12784929
<reponame>yefengxx/vaapi-fits ### ### Copyright (C) 2021 Intel Corporation ### ### SPDX-License-Identifier: BSD-3-Clause ### from ...lib.common import memoize, try_call @memoize def have_gst(): return try_call("which gst-launch-1.0") and try_call("which gst-inspect-1.0") @memoize def have_gst_element(element): r...
1.976563
2
mudi/dispatcher.py
daturkel/mudi
0
12784930
<filename>mudi/dispatcher.py import logging from pathlib import Path import watchgod from .site import Site from .utils import rel_name from .watcher import MudiWatcher class MudiDispatcher: def __init__(self, site: Site): self.site = site def _dispatch(self, change_type: watchgod.Change, path: Path...
2.109375
2
ports/core/port.py
yzgyyang/portcran
1
12784931
"""Classes describing a FreeBSD Port and the various structures.""" from abc import ABCMeta, abstractmethod from io import StringIO from itertools import groupby from math import ceil, floor from pathlib import Path from typing import (Any, Callable, Dict, Generic, IO, Iterable, Iterator, List, Optional, Set, Tuple, Ty...
2.453125
2
jumpscale/tools/wireguard/__init__.py
zaibon/js-sdk
13
12784932
<reponame>zaibon/js-sdk import binascii from nacl import public from nacl.encoding import Base64Encoder from nacl.signing import VerifyKey def generate_zos_keys(node_public_key): """Generate a new set of wireguard key pair and encrypt the private side using the public key of a 0-OS node. Args: ...
2.21875
2
6 kyu/Madhav array.py
mwk0408/codewars_solutions
6
12784933
def is_madhav_array(arr): if len(arr)<=1: return False low=1 high=3 increment=3 compare=arr[0] while high<=len(arr): if sum(arr[low:high])!=compare: return False low, high=high, high+increment increment+=1 return True if (high-increment+1)==len(arr...
3.609375
4
stacks/constructs/api.py
juliuskrahn-com/backend
0
12784934
<reponame>juliuskrahn-com/backend import aws_cdk.core import aws_cdk.aws_apigateway as apigw import aws_cdk.aws_lambda as lambda_ import aws_cdk.aws_dynamodb as dynamodb import aws_cdk.aws_secretsmanager as sm import aws_cdk.aws_logs as logs from .. import Environment from stacks.stack_utils import to_camel_case clas...
1.851563
2
webapp/main/migrations/0009_auto_20140321_1349.py
joepetrini/bike-counter
5
12784935
<filename>webapp/main/migrations/0009_auto_20140321_1349.py # encoding: utf8 from django.db import models, migrations import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): dependencies = [ ('main', '0008_survey_value'), ] operations = [ migrations....
1.710938
2
tests/test_extractor.py
Edinburgh-Genome-Foundry/easy_dna
6
12784936
import os import pytest import numpy as np import easy_dna as dna def test_extract_from_input(tmpdir): parts = [] for i in range(10): part_id = "part_%s" % ("ABCDEFGHAB"[i]) # id is nonunique on purpose alias = "part_%d" % i # alias is unique part_length = np.random.randint(1000, 150...
2.1875
2
backend/apps/workOrder/migrations/0006_auto_20211130_0131.py
jorgejimenez98/auditorio-django-react
0
12784937
# Generated by Django 3.2.7 on 2021-11-30 00:31 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('workOrder', '0005_remove_workorder_forg'), ] operations = [ migrations.AddField( model_name='workorder', name='FORG'...
1.53125
2
benchmarks/query_benchmarks/query_delete_related/benchmark.py
deepakdinesh1123/actions
0
12784938
from ...utils import bench_setup from .models import Artist, Song class QueryDeleteRel: def setup(self): bench_setup(migrate=True) self.a1 = Artist.objects.create(name="abc") self.a2 = Artist.objects.create(name="abc") self.a3 = Artist.objects.create(name="abc") self.a4 = A...
2.515625
3
src/posts/migrations/0003_auto_20170327_1306.py
ChrisMunene/Blog
0
12784939
<filename>src/posts/migrations/0003_auto_20170327_1306.py # -*- coding: utf-8 -*- # Generated by Django 1.9 on 2017-03-27 10:06 from __future__ import unicode_literals import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependenci...
1.539063
2
__init__.py
daqbroker/daqbrokerServer
0
12784940
from daqbrokerServer.daqbroker import Server
1.054688
1
examples/text_scroll.py
paddywwoof/python-sense-hat
104
12784941
<reponame>paddywwoof/python-sense-hat<gh_stars>100-1000 #!/usr/bin/python from sense_hat import SenseHat sense = SenseHat() sense.set_rotation(180) red = (255, 0, 0) sense.show_message("One small step for Pi!", text_colour=red)
1.992188
2
python/athena/__init__.py
sj1104/Het
2
12784942
<gh_stars>1-10 from __future__ import absolute_import from .gpu_links import * from .gpu_ops import * from .stream import *
1.078125
1
blog/admin.py
abhishekBhartiProjects/learnLanguageDjango
0
12784943
from django.contrib import admin # Register your models here. from blog.models import Post admin.site.register(Post)
1.289063
1
pyresourcepool/pyresourcepool.py
bensonrodney/pyresourcepool
0
12784944
#!/usr/bin/env python3 """ Basic python object resource pool. """ import copy import time import traceback from threading import RLock, Thread from contextlib import contextmanager # Callback attribute name when adding a return callback to an object CALLBACK_ATTRIBUTE = 'resource_pool_return_callback' class AllRes...
3.625
4
src/scripts/rPi/main.py
MarkintoshZ/Self-Driving-Pi
2
12784945
<filename>src/scripts/rPi/main.py import numpy as np from PIL import Image import os from os import system as sys from keras.models import load_model import keras from replay import ExperienceReplay import random import time import cv2 import drive # Get a reference to webcam #0 (the default one) video_capture = cv2....
2.65625
3
tests/ibllib/test_atlas.py
SebastianBruijns/ibllib
0
12784946
<reponame>SebastianBruijns/ibllib import unittest import numpy as np from ibllib.atlas import BrainCoordinates, sph2cart, cart2sph, Trajectory, Insertion class TestInsertion(unittest.TestCase): def test_init(self): d = { 'label': 'probe00', 'x': 544.0, 'y': 1285.0, ...
2.65625
3
train.py
pandeydeep9/Attentive-Neural-Process
0
12784947
<gh_stars>0 from tqdm import tqdm from network import LatentModel from tensorboardX import SummaryWriter import torchvision import torch as t from torch.utils.data import DataLoader from preprocess import collate_fn import os def adjust_learning_rate(optimizer, step_num, warmup_step=4000): lr = 0.001 * warmup_step...
2.171875
2
examples/jsonrpc_server/jsonrpc_server.py
podhmo/toybox
3
12784948
# -*- coding:utf-8 -*- import logging from toybox.simpleapi import run from pyramid_rpc.jsonrpc import jsonrpc_method # please: pip install pyramid_rpc # see also: http://docs.pylonsproject.org/projects/pyramid_rpc/en/latest/jsonrpc.html """ python ./jsonrpc_server.py $ echo '{"id": "1", "params": {"name": "foo"}, "me...
2.5
2
fake_count/templatetags/fake_count_tmpl.py
iterweb/django_fake_counter
1
12784949
<filename>fake_count/templatetags/fake_count_tmpl.py from django.template import Library from random import randint from datetime import datetime from fake_count.app_settings import DAY, NIGHT register = Library() night = 235922861933 morning = 100129385257 current_time = str(datetime.now().time()).replace(':', '')....
2.5
2
Examen/pandas_example - copia.py
jansforte/Inteligencia-Artificial
0
12784950
<filename>Examen/pandas_example - copia.py import pandas as pd Datos = pd.DataFrame({"hora": ["0.29 [0.15-0.48]", "6.586 [0.15-0.48]", "9800 [10-200]", "3 [10-200]", "6.586 [0.15-0.48]"]}) Datos["hora"] = Datos["hora"].str.extract(r"(.*\d\s)") print(Datos)
3.578125
4