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
app/recipe/models.py
shivam230697/recipe-api
0
30100
from django.db import models # Create your models here. class TestModel(models.Model): test_field = models.IntegerField(default=0)
2.078125
2
133. Clone Graph.py
Dharaneeshwar/Leetcode
4
30101
""" # Definition for a Node. class Node: def __init__(self, val = 0, neighbors = None): self.val = val self.neighbors = neighbors if neighbors is not None else [] """ class Solution: dairy = {} def cloneGraph(self, node: 'Node') -> 'Node': if not node: return None ...
3.421875
3
pythonidbot/error/__init__.py
hexatester/pythonidbot
1
30102
<reponame>hexatester/pythonidbot import logging from telegram.error import ( TelegramError, Unauthorized, BadRequest, TimedOut, ChatMigrated, NetworkError, ) from .badrequest import badrequest from .chatmigrated import chatmigrated from .networkerror import networkerror from .telegramerror impor...
2.296875
2
numpyro/examples/runge_kutta.py
ahmadsalim/numpyro
3
30103
import functools from typing import Callable, TypeVar import jax import jax.numpy as jnp def scan(f, s, as_): bs = [] for a in as_: s, b = f(s, a) bs.append(b) return s, jnp.concatenate(bs) KwArg = TypeVar('KwArg') @functools.partial(jax.jit, static_argnums=(0, 1, 2, 3, 4, 5, 6, 7)) d...
2.015625
2
python-opencv/blog2-pixel/demo7.py
meteor1993/python-learning
83
30104
<reponame>meteor1993/python-learning import cv2 as cv from matplotlib import pyplot as plt img=cv.imread('maliao.jpg', cv.IMREAD_COLOR) plt.imshow(img) plt.show()
2.890625
3
editaveis/prototipos/protoLevenshtein.py
Ziul/tcc1
0
30105
<reponame>Ziul/tcc1<gh_stars>0 # -*- coding: utf-8 -*- """ Code to rank packages from a search in APT using Levenshtein """ from apt import Cache from Levenshtein import ratio from exact import Pack, _parser from multiprocessing.pool import ThreadPool as Pool _MAX_PEERS = 20 def Thread_Rank(k): pack = _args...
2.453125
2
inpystem/tools/matlab_interface.py
etienne-monier/inpystem
2
30106
<filename>inpystem/tools/matlab_interface.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This module defines an interface to run matlab codes from python. """ import os import time import sys import logging import pathlib import numpy as np import scipy.io as sio _logger = logging.getLogger(__name__) def ma...
2.765625
3
binho/commands/binho_adc.py
binhollc/binho-python-package
4
30107
#!/usr/bin/env python3 from __future__ import print_function import sys import errno import statistics import serial from binho.utils import log_silent, log_verbose, binhoArgumentParser from binho.errors import DeviceNotFoundError, CapabilityError def main(): # Set up a simple argument parser. parser = bi...
2.375
2
server/app/models.py
ju1115kr/hash-brown
4
30108
<reponame>ju1115kr/hash-brown<filename>server/app/models.py<gh_stars>1-10 # -*- coding: utf-8 -*- from flask import url_for, current_app, g from werkzeug import secure_filename from werkzeug.security import generate_password_hash, check_password_hash from itsdangerous import TimedJSONWebSignatureSerializer as Serialize...
2.15625
2
PlotGenGain_PathsOfSelection_TBV.py
janaobsteter/Genotype_CODES
1
30109
import pandas as pd import sys import numpy as np import matplotlib.pyplot as plt T = pd.read_csv('GenTrends_cat.csv') T.index = T.cat T = T.drop('cat', axis=1) tT = np.transpose(T) tT.loc[:,'Cycle'] = [i.strip('_vars').strip('_mean') for i in list(tT.index)] tT_mean = tT.ix[0::2,:] tT_var = tT.ix[1::2,:] cats = [i ...
2.75
3
web_info.py
B4t33n/web_info
1
30110
<filename>web_info.py print("\033[92m") import os import urllib2 import sys print("---------------------------------------------") os.system("figlet web info") print("----------------------------------------------") print("\033[91m") print("#############################################") print(" Code...
2.453125
2
viper_dev.py
safinsingh/viper
0
30111
from viper import * import inspect def GetSource(func): lines = inspect.getsource(func) print(lines)
1.507813
2
cride/utils/models.py
jpablocardona/platzi-django-advance
0
30112
""" django models utilities""" from django.db import models class CRideModel(models.Model): """ Comparte Ride base model CRideModel acts as an abstract base class from which every other model in the project will inherit. This class provides every table with the following attributes: + creat...
2.8125
3
lambda/VisitorsDynamoDBClient.py
kyhau/hello-visitor
0
30113
import boto3 import json import uuid from datetime import datetime import logging # Update the root logger to get messages at DEBUG and above logging.getLogger().setLevel(logging.DEBUG) logging.getLogger("botocore").setLevel(logging.CRITICAL) logging.getLogger("boto3").setLevel(logging.CRITICAL) logging.getLogger("url...
2.078125
2
merge.py
marcelbrueckner/merge-intervals
0
30114
#!/usr/bin/env python3 from argparse import ArgumentParser, ArgumentError import re, sys # Define a custom argument type `interval_int` to properly parse arguments # https://docs.python.org/3/library/argparse.html#type def interval_int(arg): """ Validate given interval and return as list """ pattern ...
3.59375
4
factor_vae/types.py
kiwi0fruit/jats-semi-supervised-pytorch
0
30115
from typing import Tuple from abc import abstractmethod from torch import Tensor from torch.nn import Module class BaseDiscriminator(Module): @abstractmethod def forward_(self, z: Tensor) -> Tuple[Tensor, Tensor]: raise NotImplementedError def forward(self, z: Tensor) -> Tuple[Tensor, Tensor]: #...
2.71875
3
day6/main.py
urosZoretic/adventofcode2021
0
30116
<gh_stars>0 inputFile = "day6/day6_1_input.txt" # https://adventofcode.com/2021/day/6 if __name__ == '__main__': print("Lanternfish") with open(inputFile, "r") as f: fishArray = [int(num) for num in f.read().strip().split(",")] # for part2... not needed to read array again from file origFishA...
3.375
3
datasets/Voc_Dataset.py
DLsnowman/Deeplab-v3plus
333
30117
<gh_stars>100-1000 # -*- coding: utf-8 -*- # @Time : 2018/9/21 17:21 # @Author : HLin # @Email : <EMAIL> # @File : Voc_Dataset.py # @Software: PyCharm import PIL import random import scipy.io from PIL import Image, ImageOps, ImageFilter import numpy as np import cv2 import os import torch import torch.utils.d...
2.203125
2
tool/grid.py
David-Loibl/gistemp
1
30118
<filename>tool/grid.py #!/usr/local/bin/python3.4 # # <NAME>, Revision 2016-01-06 # grid.py """ grid YYYY-MM [v2-file] Display gridded anomalies as SVG file. """ # Regular expression used to match/validate the "when" argument. RE_WHEN = r'(\d{4})-(\d{2})' def map(when, inp, out): """Take a cccgistemp subbox f...
2.890625
3
nlu_flow/retrieval/faq_answer_retrieval/inferencer.py
cheesama/nlflow
1
30119
<gh_stars>1-10 from fastapi import FastAPI from transformers import ElectraModel, ElectraTokenizer from koelectra_fine_tuner import KoelectraQAFineTuner from nlu_flow.preprocessor.text_preprocessor import normalize import torch import faiss import dill app = FastAPI() is_ready = False #load chitchat_retrieval_mod...
2.296875
2
Processing_api.py
enpmo/first-personal-work
0
30120
#!/usr/bin/env python # coding: utf-8 # In[8]: import requests import re import time import json def get_one_page(url): # 根据源码分析,构造请求头 headers = { # 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) ' # 'Chrome/52.0.2743.116 S...
3.109375
3
docs/index_functions.py
guyms/pyansys
0
30121
<filename>docs/index_functions.py #============================================================================== # load a beam and write it #============================================================================== import pyansys from pyansys import examples # Sample *.cdb filename = examples.hexarchivefile # R...
2.546875
3
PAST3/o.py
nishio/atcoder
1
30122
# included from libs/mincostflow.py """ Min Cost Flow """ # derived: https://atcoder.jp/contests/practice2/submissions/16726003 from heapq import heappush, heappop class MinCostFlow(): def __init__(self, n): self.n = n self.graph = [[] for _ in range(n)] self.pos = [] def add_edge(s...
2.984375
3
reo/migrations/0112_auto_20210713_0037.py
NREL/REopt_API
7
30123
# Generated by Django 3.1.12 on 2021-07-13 00:37 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('reo', '0111_auto_20210708_2144'), ] operations = [ migrations.RenameField( model_name='sitemodel', old_name='year_one_emiss...
1.570313
2
deepstreampy/constants/call_state.py
sapid/deepstreampy-twisted
0
30124
<gh_stars>0 INITIAL = 'INITIAL' CONNECTING = 'CONNECTING' ESTABLISHED = 'ESTABLISHED' ACCEPTED = 'ACCEPTED' DECLINED = 'DECLINED' ENDED = 'ENDED' ERROR = 'ERROR'
0.859375
1
data/ZLData.py
sharmavins23/Zhongli-Artifact-and-Weapon-Calcs
0
30125
# Static data class for character stats class Zhongli: level = 90 talentLevel = 8 # Base stat values baseHP = 14695 baseATK = 251 baseCritRATE = 0.05 baseCritDMG = 0.5 # Ability MVs and frame counts class Normal: # Normal attack spear kick hop combo frames = 140 #m...
1.609375
2
app/__init__.py
abhishtagatya/pandubot
1
30126
<filename>app/__init__.py<gh_stars>1-10 import os import sys from instance.config import DATABASE_URI from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_compress import Compress app = Flask(__name__) Compress(app) app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URI app.config['SQLALCHEMY_TRA...
1.859375
2
docker/app/app/backend/apps/_archive/accounts_new/profiles/serializers.py
JTarball/tetherbox
1
30127
""" accounts.profile.serializers ============================ Serializers file for a basic Accounts App """ from rest_framework import serializers from .models import AccountsUser class AccountsUserSerializer(serializers.ModelSerializer): class Meta: model = AccountsUser
1.976563
2
src/ops.py
Elite-Volumetric-Capture-Sqad/DDRNet
128
30128
<reponame>Elite-Volumetric-Capture-Sqad/DDRNet<filename>src/ops.py import numpy as np import sys import tensorflow as tf slim = tf.contrib.slim def convertNHWC2NCHW(data, name): out = tf.transpose(data, [0, 3, 1, 2], name=name) return out def convertNCHW2NHWC(data, name): out = tf.transpose(data, [0, 2,...
1.921875
2
tests/fractalmusic/test_fm_split.py
alexgorji/musurgia
0
30129
<reponame>alexgorji/musurgia import os from musicscore.musictree.treescoretimewise import TreeScoreTimewise from musurgia.unittest import TestCase from musurgia.fractaltree.fractalmusic import FractalMusic path = str(os.path.abspath(__file__).split('.')[0]) class Test(TestCase): def setUp(self) -> None: ...
2.609375
3
docs/p3/setup.py
khchine5/atelier
1
30130
from setuptools import setup if __name__ == '__main__': setup(name='foo', version='1.0.0')
1.132813
1
ParaMol/Objective_function/Properties/regularization.py
mnagaku/ParaMol
15
30131
<reponame>mnagaku/ParaMol # -*- coding: utf-8 -*- """ Description ----------- This module defines the :obj:`ParaMol.Objective_function.Properties.regularization.Regularization` class, which is a ParaMol representation of the regularization property. """ import numpy as np from .property import * # ----------------...
2.53125
3
conversion/octalToDecimal.py
slowy07/pythonApps
10
30132
<gh_stars>1-10 def octalToDecimal(octString: str)->str: octString = str(octString).strip() if not octString: raise ValueError("empty string was passed to function") isNegative = octString[0] == "-" if isNegative: octString = octString[1:] if not all(0 <= int(char) <= 7 for char in oc...
3.59375
4
newsXtract.py
selection-bias-www2018/NewsXtract
1
30133
<reponame>selection-bias-www2018/NewsXtract import os,json import requests BASE_URL = 'http://epfl.elasticsearch.spinn3r.com/content*/_search' BULK_SIZE = 100 SPINN3R_SECRET = os.environ['SPINN3R_SECRET'] HEADERS = { 'X-vendor': 'epfl', 'X-vendor-auth': SPINN3R_SECRET } query = { "size": BULK_SIZE, ...
2.484375
2
core/plugins/hibp.py
area55git/Gitmails
140
30134
import time import requests from core.utils.parser import Parser from core.utils.helpers import Helpers from core.models.plugin import BasePlugin class HIBP(BasePlugin): def __init__(self, args): self.args = args self.base_url = "https://haveibeenpwned.com/api/v2/breachedaccount" self.url...
2.375
2
app/purchases.py
thowell332/Mini-Amazon
0
30135
from re import S from flask import render_template, redirect, url_for, flash, request from flask_paginate import Pagination, get_page_parameter from flask_login import current_user from flask_wtf import FlaskForm from wtforms import SubmitField from flask_babel import _, lazy_gettext as _l from flask_login import curre...
2.390625
2
ml_metadata/workspace.bzl
zijianjoy/ml-metadata
458
30136
# Copyright 2018 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 to in writing, ...
1.164063
1
python/py_src/sudachipy/command_line.py
sorami/sudachi.rs
69
30137
# Copyright (c) 2019 Works Applications Co., Ltd. # # 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 a...
2.046875
2
behave/formatter/json.py
stackedsax/behave
0
30138
<gh_stars>0 # -*- coding: utf-8 -*- from __future__ import absolute_import import base64 try: import json except ImportError: import simplejson as json from behave.formatter.base import Formatter class JSONFormatter(Formatter): name = 'json' description = 'JSON dump of test run' dumps_kwargs = {...
2.359375
2
MUNIT/networks.py
NoaBrazilay/DeepLearningProject
2
30139
<filename>MUNIT/networks.py """ Copyright (C) 2018 NVIDIA Corporation. All rights reserved. Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). """ from torch import nn from torch.autograd import Variable import torch import torch.nn.functional as F import utils im...
2.125
2
nyc_bike_flow.py
AngeloManzatto/NYCBikeFlow
1
30140
# -*- coding: utf-8 -*- """ Created on Mon Aug 5 14:01:56 2019 @author: <NAME> This implementation use ST-ResNet for inflow / outflow bike prediction on the city of NY Article: https://arxiv.org/pdf/1610.00081.pdf References and credits: <NAME>, <NAME>, <NAME>. Deep Spatio-Temporal Residual Networks for Citywide C...
2.3125
2
scripts/reduce.py
inlgmeeting/inlgmeeting.github.io
0
30141
<reponame>inlgmeeting/inlgmeeting.github.io<gh_stars>0 import argparse import csv import json import sklearn.manifold import torch def parse_arguments(): parser = argparse.ArgumentParser(description="MiniConf Portal Command Line") parser.add_argument("papers", default=False, help="paper file") ...
2.453125
2
.vim/bundle-deactivated/python-mode/pylibs/ropemode/environment.py
chrislaskey/.dot-files
0
30142
<filename>.vim/bundle-deactivated/python-mode/pylibs/ropemode/environment.py class Environment(object): def ask(self, prompt, default=None, starting=None): pass def ask_values(self, prompt, values, default=None, starting=None): pass def ask_directory(self, prompt, default=None, starting=N...
2.265625
2
Breast_cancer_prediction1.py
HagerBesar/Breast_cancer_prediction1
1
30143
<filename>Breast_cancer_prediction1.py #!/usr/bin/env python # coding: utf-8 # In[ ]: ####################################<<<<Breast_cancer_prediction>>>>>>#################################### # In[ ]: #part(1)--By:<NAME> # In[1]: import pandas as pd import numpy as np import matplotlib.pyplot as plt # In[...
2.6875
3
regphot/pyprofit.py
raphaelshirley/regphot
0
30144
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Feb 1 17:13:54 2017 Should have similar functions as galfit and allow a model object to use functions to calculate chisq and optimse using standard optimisation. @author: rs548 """ import pyprofit def optimise():
2.546875
3
chrome/common/extensions/docs/server2/branch_utility_test.py
pozdnyakov/chromium-crosswalk
0
30145
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys import unittest from branch_utility import BranchUtility from fake_url_fetcher import FakeUrlFetcher from obj...
2.0625
2
src/mlServiceAPI.py
juliangruendner/ketos_brain_api
0
30146
<reponame>juliangruendner/ketos_brain_api from flask import Flask from flask_restful_swagger_2 import Api from resources.userResource import UserListResource, UserResource, UserLoginResource from resources.imageResource import ImageListResource, ImageResource from resources.environmentResource import EnvironmentListRes...
1.515625
2
Python/Tutorial - 3/check.py
JC2295/FCC_Tutorial_Projects
0
30147
<reponame>JC2295/FCC_Tutorial_Projects x = float(input("Enter Number: ")) if(x % 2) == 0 and x > 0: print("The number you entered is positive and even.") elif(x % 2) == 0 and x < 0: print("The number you entered is negative and even.") elif(x % 2) != 0 and x > 0: print("The number you entered is positive a...
4.375
4
solver.py
itrosen/hall-solver
0
30148
""" Created on Dec 16 2021 @author: <NAME> Poisson equation solver for the Hall effect. Includes classes for Hall bars, Hall bars in a nonlocal geometry, and Corbino disks. The Hall bar class has build in methods for longitudinal and Hall 4-probe resistance measurements. Plotting functions assume coordinates are in mic...
3.0625
3
tools/python/boutiques/util/utils.py
glatard/boutiques
2
30149
<gh_stars>1-10 import os import simplejson as json from boutiques.logger import raise_error # Parses absolute path into filename def extractFileName(path): # Helps OS path handle case where "/" is at the end of path if path is None: return None elif path[:-1] == '/': return os.path.basenam...
2.703125
3
python/exercism/word_count.py
vesche/snippets
7
30150
<filename>python/exercism/word_count.py import re def word_count(s): d = {} s = re.sub('[^0-9a-zA-Z]+', ' ', s.lower()).split() for word in s: if word in d: d[word] += 1 else: d[word] = 1 return d
3.90625
4
src/core/forms.py
artinnok/billing
0
30151
from django import forms from core.models import Profile def get_sender_choices(): return list(Profile.objects.all().values_list('pk', 'inn')) class TransactionForm(forms.Form): sender = forms.ChoiceField( label='Отправитель', help_text='Выберите ИНН отправителя', choices=get_sender...
2.34375
2
fabfile.py
CCMS-UCSD/ProteoSAFe_Workflow_Deployment
1
30152
from fabric2 import Connection from fabric2 import task from fabric2 import config import os import time from xml.etree import ElementTree as ET import uuid import glob import json import urllib.parse import io workflow_components = ['input.xml', 'binding.xml', 'flow.xml', 'result.xml', 'tool.xml'] @task def release_...
2.375
2
tests/test_volume.py
mathieuboudreau/electropy
5
30153
import unittest from electropy.charge import Charge import numpy as np from electropy import volume class VolumeTest(unittest.TestCase): def setUp(self): self.position_1 = [0, 0, 0] self.position_2 = [-2, 4, 1] self.charge = 7e-9 def tearDown(self): pass # Potential fun...
3.3125
3
aiida_icl/__init__.py
chrisjsewell/aiida-cx1scheduler
0
30154
<reponame>chrisjsewell/aiida-cx1scheduler<filename>aiida_icl/__init__.py """ AiiDA Plugin Template Adapt this template for your own needs. """ __version__ = '0.3.4'
1.023438
1
opt/resource/test_out.py
cosee-concourse/mysql-resource
2
30155
import unittest from concourse_common import testutil import out class TestOut(unittest.TestCase): def test_invalid_json(self): testutil.put_stdin( """ { "source": { "user": "user", "password": "password", "host": "hos...
2.828125
3
auctionCrawler/poxy.py
wd18535470628/PythonCraw
0
30156
#-*- coding=utf-8 -*- import urllib2, time, datetime from lxml import etree import sqlite3,time class getProxy(): def __init__(self): self.user_agent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)" self.header = {"User-Agent": self.user_agent} self.dbname="proxy.db" ...
2.984375
3
Agents/utils/readMonFiles.py
mbay-SAG/cumulocity-thinedge-example
1
30157
<gh_stars>1-10 import sys def content(name): try: with open('../apama-mqtt-connect/monitors/' + str(name) + '.mon', 'r') as file: data = file.read() return data except: return []
2.21875
2
tests/test_search.py
capellaspace/console-client
23
30158
<reponame>capellaspace/console-client<filename>tests/test_search.py<gh_stars>10-100 #!/usr/bin/env python import pytest from .test_data import get_search_test_cases, search_catalog_get_stac_ids from capella_console_client import client from capella_console_client.validate import _validate_uuid from capella_console_cl...
2.328125
2
lib/score_functions/mahalanobis_score.py
alabrashJr/Maha-Odd
0
30159
<filename>lib/score_functions/mahalanobis_score.py # Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the MIT License. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY ...
2.3125
2
win/devkit/other/pymel/extras/completion/py/maya/app/sceneAssembly/__init__.py
leegoonz/Maya-devkit
21
30160
<reponame>leegoonz/Maya-devkit from . import adskPrepareRender import maya.cmds as cmd import maya
0.769531
1
ask_user_data.py
sukarita/basics-phyton
0
30161
#Ask user for name name = input("What is your name?: ") #Ask user for the age age = input("How old are you? ") #Ask user for city city = input("What city do you live in? ") #Ask user what they enjoy hobbies = input("What are your hobbies?, What do you love doing? ") #Create output text using placeholders to concat...
4.375
4
skexplain/main/PermutationImportance/multiprocessing_utils.py
monte-flora/scikit-explain
0
30162
"""These are utilities designed for carefully handling communication between processes while multithreading. The code for ``pool_imap_unordered`` is copied nearly wholesale from GrantJ's `Stack Overflow answer here <https://stackoverflow.com/questions/5318936/python-multiprocessing-pool-lazy-iteration?noredirect=1&lq...
3.25
3
mi/dataset/parser/test/test_flntu_x_mmp_cds.py
petercable/mi-dataset
1
30163
#!/usr/bin/env python """ @package mi.dataset.parser.test.test_flcdrpf_ckl_mmp_cds @file marine-integrations/mi/dataset/parser/test/test_flcdrpf_ckl_mmp_cds.py @author <NAME> @brief Test code for a flcdrpf_ckl_mmp_cds data parser """ import os from nose.plugins.attrib import attr from mi.core.exception...
2.203125
2
lib/python3.6/site-packages/pkginfo/commandline.py
backcountryinfosec/iocparser
4
30164
<gh_stars>1-10 """Print the metadata for one or more Python package distributions. Usage: %prog [options] path+ Each 'path' entry can be one of the following: o a source distribution: in this case, 'path' should point to an existing archive file (.tar.gz, .tar.bz2, or .zip) as generated by 'setup.py sdist'. o a...
2.5
2
app_jumanji/migrations/0007_resume.py
arifgafizov/jumanji_v2
1
30165
# Generated by Django 3.0.8 on 2020-08-16 18:03 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('app_jumanji', '0006_auto...
1.742188
2
molecule/resources/tests_err/test_err.py
fletort/rpi_noobs_recovery
0
30166
import os import pytest import json import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') @pytest.fixture() def waited_failed_task_name(host): all_variables = host.ansible.get_variables() return all_v...
2.0625
2
sed_vis/visualization.py
TUT-ARG/sed_vis
79
30167
<gh_stars>10-100 #!/usr/bin/env python # -*- coding: utf-8 -*- """ Visualization ================== This is module contains a simple visualizer to show event lists along with the audio. The visualizer can show multiple event lists for the same reference audio allowing the comparison of the reference and estimated event...
2.59375
3
myApp/views.py
geniyong/oauth_practice
0
30168
from django.shortcuts import render # Create your views here. from django.shortcuts import render,redirect, render_to_response from .models import * from django.views.generic import TemplateView, ListView, DetailView, CreateView, UpdateView, DeleteView from django.urls import reverse from django.http import HttpRespo...
2.015625
2
console/info.py
alexeysp11/sdc-console-python
0
30169
class Info: """ Allows to print out information about the application. """ def commands(): print('''Main modules: imu | Inertial Measurement Unit (GPS, gyro, accelerometer) gps | GPS gyro | Gyroscope accel | Accelerometer ...
3.390625
3
apps/establishment_system/search_indexes.py
camilortte/RecomendadorUD
4
30170
# -*- encoding: utf-8 -*- """ search_indexex.py: Creacion de los indices de busqueda. @author <NAME> @contact <EMAIL> <EMAIL> @camilortte on Twitter @copyright Copyright 2014-2015, RecomendadorUD @license GPL @date 2014-10-10 @satus ...
2.1875
2
utils.py
jeffasante/captcha
0
30171
''' Handling the data io ''' from torchvision import transforms, datasets import numpy as np import zipfile from io import open import glob from PIL import Image, ImageOps import os import string # Read data def extractZipFiles(zip_file, extract_to): ''' Extract from zip ''' with zipfile.ZipFile(zip_file, ...
2.75
3
tests/test_metaregistry.py
kkaris/bioregistry
0
30172
# -*- coding: utf-8 -*- """Tests for the metaregistry.""" import unittest import bioregistry from bioregistry.export.rdf_export import metaresource_to_rdf_str from bioregistry.schema import Registry class TestMetaregistry(unittest.TestCase): """Tests for the metaregistry.""" def test_minimum_metadata(self...
2.625
3
ex038.py
honeyhugh/PythonCurso
0
30173
<filename>ex038.py print('Analisador de números') print('=-=' * 15) n1 = int(input('Digite o primeiro número: ')) n2 = int(input('Digite o segundo número: ')) if n1 > n2: print('O número {} é maior que o número {}'.format(n1, n2)) elif n2 > n1: print('O número {} é maior que o número {}'.format(n2, n1)) else: ...
3.96875
4
setup.py
ksachdeva/symbulate
25
30174
<filename>setup.py<gh_stars>10-100 from setuptools import setup, find_packages setup( name="symbulate", version="0.5.5", description="A symbolic algebra for specifying simulations.", url="https://github.com/dlsun/symbulate", author="<NAME>", author_email="<EMAIL>", license="GPLv3", ...
1.734375
2
snakemake/scripts/pipeline/gc.py
BDI-pathogens/ShiverCovid
0
30175
from __future__ import print_function import gzip import os import sys from decimal import Decimal def calculate_gc(inpath): inf = gzip.open(inpath) if inpath.endswith('.gz') else open(inpath) ttl_bases = 0 gc_bases = 0 for i, l in enumerate(inf): if i % 4 == 1: s = l.strip().uppe...
2.4375
2
blind_automation/event/blocker.py
RaphiOriginal/blindAutomation
1
30176
<reponame>RaphiOriginal/blindAutomation<filename>blind_automation/event/blocker.py<gh_stars>1-10 from typing import Optional, TypeVar from .event import EventBlocker T = TypeVar('T') class Blocker(EventBlocker): def __init__(self): self.__block = False self.__block_list: [T] = [] def block(...
2.453125
2
lib/systems/chlorophyll_c2.py
pulsar-chem/BPModule
0
30177
<filename>lib/systems/chlorophyll_c2.py import pulsar as psr def load_ref_system(): """ Returns chlorophyll_c2 as found in the IQMol fragment library. All credit to https://github.com/nutjunkie/IQmol """ return psr.make_system(""" C -2.51105 2.48309 -0.00367 C ...
2.59375
3
fth.py
anonymous-sys19/fth
2
30178
import os import time import sys import random user_pass = ('''<PASSWORD> admi admin universo html veggeta Admin bados free-fire royale clang free fire anonimo anonimous anoni bills anonymous Aanonimous pass password wordlist kali linux kali-linux start Hacker parrot ubuntu blacken redhat deepin lubuntu depin gogeta ...
1.96875
2
AN-24_Nizhneangarsk/data/google_earth.py
paulross/pprune-calc
1
30179
import itertools import math import pprint import sys import typing import map_funcs GOOGLE_EARTH_AIRPORT_IMAGES = { 'GoogleEarth_AirportCamera_C.jpg' : { 'path': 'video_images/GoogleEarth_AirportCamera_C.jpg', 'width': 4800, 'height': 3011, # Originally measured on the 100m legend...
2.328125
2
mongo_queue/queue.py
shunyeka/mongo_queue
6
30180
<reponame>shunyeka/mongo_queue<filename>mongo_queue/queue.py<gh_stars>1-10 import pymongo from datetime import datetime, timedelta from mongo_queue.job import Job from uuid import uuid4 from pymongo import errors DEFAULT_INSERT = { "attempts": 0, "locked_by": None, "locked_at": None, "last_error": None...
2.59375
3
CursoGuanabara/ex71_aula15_guanabara.py
cirino/python
1
30181
print(''' Exercício 71 da aula 15 de Python Curso do Guanabara Day 24 Code Python - 23/05/2018 ''') print('{:^30}'.format('BANCO DO CIRINO')) print('=' * 30) n = int(input('Qual o valor para sacar? R$ ')) total = n nota = 50 # começar de cima para baixo na estrutura qtdNota = 0 while True: if tota...
3.84375
4
models/face_completion.py
MartinKondor/MachineLearning
0
30182
import numpy as np import matplotlib.pyplot as plt from sklearn.utils.validation import check_random_state from sklearn.datasets import fetch_olivetti_faces from sklearn.externals import joblib rng = check_random_state(21) dataset = fetch_olivetti_faces() X = dataset.images.reshape(dataset.images.shape[0], -1) trai...
2.6875
3
tests/utility.py
dpazel/music_rep
1
30183
<gh_stars>1-10 TONES = list('CDEFGAB') def build_offset_list(scale): iter_scale = iter(scale) first = next(iter_scale) base = first.tonal_offset last_diff = 0 tonal_offsets = [] for dt in iter_scale: diff = dt.tonal_offset - base if diff < 0: diff += 12 # Th...
2.375
2
backend/api/serializers/information_serializer.py
ferdn4ndo/infotrem
0
30184
<filename>backend/api/serializers/information_serializer.py from django.contrib.auth.models import User from django.db.models import Sum from rest_framework import serializers from api.models.information_model import Information from api.models.information_effect_model import InformationEffect from api.models.informat...
2.0625
2
insightface/face_model.py
dniku/insightface
0
30185
<gh_stars>0 import os import cv2 import mxnet as mx import numpy as np from . import face_preprocess from .mtcnn_detector import MtcnnDetector def get_model(ctx, image_size, model_str, layer): _vec = model_str.split(',') assert len(_vec) == 2 prefix = _vec[0] epoch = int(_vec[1]) print('loading'...
2.21875
2
src/newspaperkk.py
harakiriboy/Python-Final-exam-
0
30186
import newspaper from newspaper import Article def getarticle(url): articleurl = url article = Article(articleurl) try: article.download() article.parse() alltext = article.text return alltext except: return "this website is not available"
3.140625
3
Server/app/schema/utils/__init__.py
Team-SeeTo/SeeTo-Backend
4
30187
<filename>Server/app/schema/utils/__init__.py from .activity_logger import idea_activity_logger, todo_activity_logger
1.046875
1
h2o-py/tests/testdir_misc/pyunit_pubdev_7506_model_download_with_cv.py
vishalbelsare/h2o-3
6,098
30188
<filename>h2o-py/tests/testdir_misc/pyunit_pubdev_7506_model_download_with_cv.py<gh_stars>1000+ #!/usr/bin/env python # -*- encoding: utf-8 -*- import h2o import os from h2o.estimators.gbm import H2OGradientBoostingEstimator from tests import pyunit_utils def model_download_with_cv(): prostate = h2o.import_file(p...
2.21875
2
CNN/VGGNET/vgg16_features.py
reddyprasade/Deep-Learning
15
30189
import tensorflow as tf from tensorflow.keras.applications.vgg16 import VGG16 from tensorflow.keras import models from tensorflow.keras.preprocessing import image from tensorflow.keras.applications.vgg16 import preprocess_input import numpy as np import cv2 # prebuild model with pre-trained weights on imagene...
2.90625
3
evaluate.py
m4ln/HIWI_classification
1
30190
""" call in shell: python evaluate.py --dir <rootdir/experiment/> --epoch <epoch to> e.g. in shell: python evaluate.py --dir Runs/se_resnet_trained_final/ --epoch 149 loops over all folds and calculates + stores the accuracies in a file in the root folder of the experiment you might change the model in line 45 from r...
2.5625
3
Allura/allura/webhooks.py
brondsem/allura
0
30191
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (t...
1.523438
2
monitor/monitor_v6_diagnostic.py
nlourie/vent-flowmeter
2
30192
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Apr 7 08:38:28 2020 pyqt realtime plot tutorial source: https://www.learnpyqt.com/courses/graphics-plotting/plotting-pyqtgraph/ @author: nlourie """ from PyQt5 import QtWidgets, QtCore,uic from pyqtgraph import PlotWidget, plot,QtGui import pyqtgra...
3.046875
3
src/quotes_crawlspider/quotes/items.py
azzamsa/learn-scrapy
0
30193
<reponame>azzamsa/learn-scrapy # Define here the models for your scraped items # # See documentation in: # https://docs.scrapy.org/en/latest/topics/items.html import scrapy class QuotesItem(scrapy.Item): # define the fields for your item here like: author_name = scrapy.Field() author_location = scrapy.Fi...
2.6875
3
notebook/pandas_agg.py
vhn0912/python-snippets
174
30194
import pandas as pd import numpy as np print(pd.__version__) # 1.0.0 print(pd.DataFrame.agg is pd.DataFrame.aggregate) # True df = pd.DataFrame({'A': [0, 1, 2], 'B': [3, 4, 5]}) print(df) # A B # 0 0 3 # 1 1 4 # 2 2 5 print(df.agg(['sum', 'mean', 'min', 'max'])) # A B # sum 3.0 12.0 # mean ...
3.34375
3
boonai/model.py
Scapogo/boonai
0
30195
from flask_sqlalchemy import SQLAlchemy from flask_user import UserMixin from itsdangerous import (TimedJSONWebSignatureSerializer as Serializer, BadSignature, SignatureExpired) db = SQLAlchemy() class User(db.Model, UserMixin): __tablename__ = 'user' id = db.Column(db.Integer, prima...
2.421875
2
botfw/bitflyer/api_web.py
Snufkin0866/btc_bot_framework
3
30196
<reponame>Snufkin0866/btc_bot_framework import json from urllib.parse import urlencode import requests from bs4 import BeautifulSoup from .api import BitflyerApi class BitflyerApiWithWebOrder(BitflyerApi): def __init__(self, ccxt, login_id, password, account_id, device_id=None, device_token=Non...
2.296875
2
codes/train.py
PowerLZY/malware_classification_bdci
8
30197
<filename>codes/train.py #!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @File : train.py @Contact : <EMAIL> @License : (C)Copyright 2021-2022 PowerLZY @Modify Time @Author @Version @Desciption ------------ ------- -------- ----------- 2021-10-04 15:03 PowerLZ...
2.046875
2
crawlMp/enums.py
domarm-comat/crawlMp
1
30198
from enum import Enum from typing import Tuple, Type, Optional class Mode(Enum): SIMPLE = "s" EXTENDED = "e" def __str__(self) -> str: return self.value class Header(Enum): PATH = "Path" NAME = "Name" SIZE = "Size" MODIFIED = "Modified" ACCESSED = "Accessed" INPUT = "Inp...
3.1875
3
protocols.py
MartinKist/p2p
2
30199
#!/usr/bin/env python3 # (c) 2021 <NAME> from abc import ABC, abstractmethod from enum import Enum from os import linesep from twisted.internet import reactor from twisted.internet.error import ConnectionDone from twisted.internet.protocol import Factory, Protocol from twisted.logger import Logger from twisted.protoc...
2.671875
3