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
antares/query_alerts.py
EquinoxOmega0/timedomain
4
12790351
import numpy as np from datetime import datetime from astropy.io import ascii from astropy.time import Time from argparse import ArgumentParser from antares_client.search import search, download def build_query(ra0, dec0, fov, date): """Generate a query (a Python dictionary) to submit to the ANTARES client. ...
2.78125
3
MobileNetv2/1_pruning/src_code/mobilenetv2.py
aiiuii/AutoPruner
19
12790352
""" Creates a MobileNetV2 Model as defined in: <NAME>, <NAME>, <NAME>, <NAME>, <NAME>. (2018). MobileNetV2: Inverted Residuals and Linear Bottlenecks arXiv preprint arXiv:1801.04381. import from https://github.com/tonylins/pytorch-mobilenet-v2 """ import torch.nn as nn import math import torch from . import my_op __...
3.109375
3
apps/iotdb_cloud_core/admin.py
JulianFeinauer/iotdb-cloud
6
12790353
from django.contrib import admin from apps.iotdb_cloud_core.models import IoTDBRelease admin.site.register(IoTDBRelease)
1.257813
1
mygmm.py
DaiLisen/Eye-gaze-Point-Detection-Modified-sec-
0
12790354
import numpy as np def gaussian(x,mu,sigma): temp = -np.square(x-mu)/(2*sigma) return np.exp(temp)/(np.sqrt(2.0*np.pi*sigma)) # sigma = sigma^2 def e_step(data, phais, mus, sigmas): Qs = [] for i in xrange(len(data)): q = [phai*gaussian(data[i],mu,sigma) for phai,mu,sigma in zip(phais,mus,sigmas...
2.765625
3
score_following_game/evaluation/evaluation.py
CPJKU/score_following_game
43
12790355
import copy import numpy as np PXL2CM = 0.035277778 def print_formatted_stats(stats): """ Print formatted results for result tables """ print("& {:.2f} & {:.2f} & {:.2f} & {:.2f} \\\\" .format(np.mean(stats['tracked_until_end_ratio']), np...
2.640625
3
submodules/datasets/datasets/human/parsing/mhp_v1.py
khy0809/WeightNet
0
12790356
from pathlib import Path from torchvision.datasets import VisionDataset import numpy as np from PIL import Image class MHPv1(VisionDataset): """ MHP dataset : Multi-Human Parsing V1은 human parsing 만 있고, v2는 pose 포함 https://github.com/ZhaoJ9014/Multi-Human-Parsing or https://lv-mhp.github.io/ ...
2.890625
3
Code/spark_connector.py
EthanTGo/DataWarehouseProject
0
12790357
<filename>Code/spark_connector.py from pyspark.sql import SparkSession import pyspark.sql.functions as f ''' To run, please make sure you have the appropriate Spark and Scala version - For my packages: I have Scale version 2.12 and Spark version 3.2.0 - This is important as we need to configure the appropriate versi...
3.03125
3
laboratorios/laboratorio-5/coins.py
CristianGaleano04/ayed-2019-1
0
12790358
from sys import stdin def count(S, m, n): tabla = [[0 for x in range(m)] for x in range(n+1)] for i in range(m): tabla[0][i] = 1 for i in range(1, n+1): for j in range(m): x = tabla[i - S[j]][j] if i-S[j] >= 0 else 0 y = tabla[i][j-1] if j >= 1 else 0 ...
3.203125
3
UMLRT2Kiltera_MM/transformation_reduced/Himesis/HExitPoint2BProcDef_WhetherOrNotExitPtHasOutgoingTrans.py
levilucio/SyVOLT
3
12790359
<gh_stars>1-10 from core.himesis import Himesis import cPickle as pickle from uuid import UUID class HExitPoint2BProcDef_WhetherOrNotExitPtHasOutgoingTrans(Himesis): def __init__(self): """ Creates the himesis graph representing the AToM3 model HExitPoint2BProcDef_WhetherOrNotExitPtHasOutgoingTra...
2.390625
2
videoSummarizer/summarize/models.py
talsperre/LectureSummarizer
4
12790360
from django.db import models from django.utils import timezone from django.forms import ModelForm from django.contrib.auth.models import User from django.db.models.signals import post_save from django.dispatch import receiver from django.core.exceptions import ValidationError import secrets import os class Profile(mod...
2.15625
2
testing/misc/test1.py
lagvier/echo-sense
0
12790361
<reponame>lagvier/echo-sense import sys from os import path import numpy as np ts = [1467038416442, 1467038416452, 1467038416462, 1467038416472, 1467038416482, 1467038416492, 1467038416502, 1467038416512, 1467038416522, 1467038416532] y = [0, 0, 1, 1, 1, 1, 0, 0, 0, None]
1.773438
2
cs15211/KEmptySlots.py
JulyKikuAkita/PythonPrac
1
12790362
__source__ = 'https://leetcode.com/problems/k-empty-slots/' # Time: O() # Space: O() # # Description: Leetcode # 683. K Empty Slots # #There is a garden with N slots. In each slot, there is a flower. The N flowers will bloom one by one in N days. # In each day, there will be exactly one flower blooming and it will be ...
4.03125
4
rainy/replay/base.py
kngwyu/Rainy
37
12790363
<filename>rainy/replay/base.py from abc import ABC, abstractmethod from typing import Generic, List, Type, TypeVar ReplayFeed = TypeVar("ReplayFeed") class ReplayBuffer(ABC, Generic[ReplayFeed]): def __init__(self, feed: Type[ReplayFeed], allow_overlap: bool = False) -> None: self.feed = feed sel...
2.703125
3
app/wda.py
shucheng-ai/WDA-web-server
0
12790364
#!/usr/bin/env python3 # coding:utf-8 """ 配置 wda-auth && wda-cloud """ import datetime from config import DEPLOY, AUTH_DB_HOST, AUTH_DB_PORT, AUTH_DB_USERNAME, AUTH_DB_PASSWORD, DB_HOST, DB_PORT, \ DB_USERNAME, DB_PASSWORD if DEPLOY == 1: from wda_decorators.wda import WDA as WDA_AUTH from wda_model.wda_mo...
2.171875
2
app/main/views.py
synthiakageni/NEWS-APP
0
12790365
from flask import render_template,request,redirect,url_for from . import main from ..request import get_news from ..request import get_news, get_news_articles,search_article # Views @main.route('/') def index(): ''' function that returns the index page and its data ''' #Get popular news general_ne...
2.96875
3
bicycleparameters/tests/test_models.py
JRMVV/BicycleParameters
20
12790366
<reponame>JRMVV/BicycleParameters<filename>bicycleparameters/tests/test_models.py import numpy as np from nose.tools import assert_raises from ..parameter_sets import Meijaard2007ParameterSet from ..models import Meijaard2007Model meijaard2007_parameters = { # dictionary of the parameters in Meijaard 2007 'IBxx'...
2
2
python-algorithm/leetcode/problem_963.py
isudox/nerd-algorithm
5
12790367
<filename>python-algorithm/leetcode/problem_963.py<gh_stars>1-10 """963. Minimum Area Rectangle II https://leetcode.com/problems/minimum-area-rectangle-ii/ Given a set of points in the xy-plane, determine the minimum area of any rectangle formed from these points, with sides not necessarily parallel to the x and y axe...
3.671875
4
my_site/migrations/0013_auto_20181018_1820.py
sch841466053/web
0
12790368
<reponame>sch841466053/web # -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2018-10-18 10:20 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('my_site', '0012_comments_time'), ] operations = [ ...
1.453125
1
django_migration_utils/rename_table.py
mcldev/django-migration-utils
0
12790369
def fwd_rename_app(apps, schema_editor, apps_to_rename): for old_appname, new_appname in apps_to_rename: # Renaming model from 'Foo' to 'Bar' schema_editor.execute("UPDATE django_migrations SET app_name = %s WHERE app_name = %s", [new_appname, old_appname]) schema_editor.execute("UPDATE...
2.34375
2
hostlists/plugins/plugintype.py
williamjoy/hostlists
13
12790370
#!/usr/bin/env python """ hostlists plugin to recursively query plugins based on type. This makes it possible to obtain lists of hosts by recursively querying multiple backends. For example: * Query dns for www.foo.com * Get a list of two hostnames back haproxy1.ny.foo.com and haproxy1.lax.foo.com. * Qu...
3.234375
3
test/test_instructions/test_stack_instructions.py
ronyhe/pyjvm
15
12790371
<gh_stars>10-100 from pyjvm.core.actions import Pop, DuplicateTop, Push from pyjvm.core.jvm_types import Integer, Long from test.utils import assert_incrementing_instruction, SOME_INT def _create_integers(amount): for i in range(amount): yield Integer.create_instance(i) def _translate_stack_string(text)...
2.4375
2
IreneUtility/util/u_biasgame.py
MujyKun/IreneUtility
1
12790372
import asyncio from PIL import Image from ..Base import Base class BiasGame(Base): def __init__(self, *args): super().__init__(*args) async def create_bias_game_image(self, first_idol_id, second_idol_id): """Uses thread pool to create bias game image to prevent IO blocking.""" # (sel...
2.984375
3
make-csv.py
mlizbeth/AdobeCSV
0
12790373
<reponame>mlizbeth/AdobeCSV import tabula import pandas import re df = tabula.read_pdf('1.pdf', encoding='utf-8', pages='1-2') temp = pandas.concat(df) temp.to_csv('output.csv', encoding='utf-8', index=False)
2.734375
3
early_projects/test_prefixes.py
JSBCCA/pythoncode
0
12790374
<filename>early_projects/test_prefixes.py import unittest import prefixes class TestPrefixes(unittest.TestCase): """Tests prefixes.""" def test_above_freezing_above(self): """Test a temperature that is above freezing.""" expected = True actual = temperature.above_freezing(5.2) ...
3.34375
3
dbx_api_primer/app.py
posita/dropbox-api-primer
0
12790375
# -*-mode: python; encoding: utf-8; test-case-name: tests.test_app-*- # ======================================================================== """ Copyright |(c)| 2017 `Dropbox, Inc.`_ .. |(c)| unicode:: u+a9 .. _`Dropbox, Inc.`: https://www.dropbox.com/ Please see the accompanying ``LICENSE`` and ``CREDIT...
1.6875
2
linter.py
CudaText-addons/cuda_lint_jslint
0
12790376
<filename>linter.py # Written by <NAME> # Copyright (c) 2013 <NAME> # License: MIT # Change for CudaLint: <NAME>. from cuda_lint import Linter, util class JSL(Linter): """Provides an interface to the jsl executable.""" syntax = 'JavaScript' cmd = 'jsl -stdin -nologo -nosummary' version_args = '' ...
2.4375
2
jurassic-journalists/classes.py
HypoT/code-jam-6
76
12790377
from PIL import ImageFont class Letter: """ letter class- each letter is one of these objects, and is rendered in order. """ def __init__(self,char,size,font,color = (255,255,255,255),b=False,i=False,u=False): """ char: character. size: size of letter. font: PIL truetype font obj...
3.625
4
src/kgextractiontoolbox/entitylinking/tagging/dictagger.py
torgbuiedunyenyo/KGExtractionToolbox
0
12790378
<reponame>torgbuiedunyenyo/KGExtractionToolbox from collections import defaultdict import itertools as it import os import pickle import re from abc import ABCMeta, abstractmethod from datetime import datetime from typing import List from kgextractiontoolbox.config import TMP_DIR, DICT_TAGGER_BLACKLIST from kgextract...
2.15625
2
pyctcdecode/tests/test_language_model.py
wannaphong/pyctcdecode
0
12790379
<gh_stars>0 # Copyright 2021-present Kensho Technologies, LLC. import os import re import unittest from hypothesis import given from hypothesis import strategies as st import kenlm from pygtrie import CharTrie from pyctcdecode.language_model import HotwordScorer, LanguageModel, MultiLanguageModel CUR_PATH = os.path...
2.40625
2
experiments/analyze_head_pose.py
TechieBoy/deepfake-detection
0
12790380
<gh_stars>0 import pandas as pd from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA import matplotlib.pyplot as plt from pandas.plotting import scatter_matrix from sklearn import svm from sklearn.model_selection import train_test_split def doPCA(df, n_components=2): array = df.v...
2.953125
3
src/0_processing_data.py
NationalLimerickProductions/seq2cite
1
12790381
<reponame>NationalLimerickProductions/seq2cite """ Assembling a parsed dataset of citation spans from the CORD-19 data """ import csv import json import sys import multiprocessing as mp from collections import namedtuple from typing import Union import pickle import tarfile from io import BytesIO from tqdm import tqdm...
2.515625
3
rpn/app.py
cleyon/rpn
1
12790382
''' ############################################################################# # # M A I N L O O P & P R I M A R Y F U N C T I O N S # ############################################################################# ''' import getopt import os import random import signal import sys try: import numpy...
1.914063
2
multi_tenant/tenant/models/tenant.py
AnsGoo/djangoMultiTenant
1
12790383
from datetime import datetime from typing import Dict, Tuple from django.db import models from multi_tenant.tenant.utils.pycrypt import crypt from multi_tenant.const import DEFAULT_DB_ENGINE_MAP from django.conf import settings DAFAULT_DB = settings.DATABASES['default'] class TenantManager(models.Manager): def ...
2.1875
2
src/main.py
GDSC-UIT/RealTime-Emotion-Recognizer
1
12790384
<gh_stars>1-10 import cv2 import numpy as np from tensorflow.keras.models import model_from_json from tensorflow.keras.preprocessing import image ''' Load model ''' trained_model = model_from_json(open("model/vgg-face-model.json", "r").read()) ''' Load weights ''' trained_model.load_weights('model/vgg-face.h5') cap ...
2.46875
2
linga/app.py
pageer/Linga
0
12790385
"""Main application initilization.""" import os.path from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager BOOK_PATH = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', 'books')) # Make sure to add your own secret key in config.py SECRET_KEY = "<KEY>"...
2.46875
2
models/model_utils.py
ARM-software/sesr
25
12790386
# Copyright 2021 Arm Inc. All Rights Reserved. # # 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 agree...
2.40625
2
Polynomial Generation.py
Sarder-Iftekhar/Numerical_Method
0
12790387
<filename>Polynomial Generation.py<gh_stars>0 import numpy as np # create as many polynomials as size of coeff_vector final_pol = np.polynomial.Polynomial([0.]) # our target polynomial n = coeff_vector.shape[0] # get number of coeffs for i in range(n): p = np.polynomial.Polynomial([1.]) # create a dummy polyno...
3.34375
3
tests/test_parser.py
b2wads/maas
0
12790388
<filename>tests/test_parser.py from aioresponses import aioresponses from asynctest import TestCase from yarl import URL from contrib.parser import Plus, Value, Minus, Divide, Times, Exponent from tests.util import ( plus_service_callback, minus_service_callback, divide_service_callback, multiply_servi...
2.75
3
Python/Weather Station.py
KaushikNeelichetty/IoT-Based-Weather-Station-with-Raspberry-Pi
3
12790389
<gh_stars>1-10 import urllib2, urllib #The libraries needed for the POST Request import sys # Importing the sys python package import Adafruit_BMP.BMP085 as BMP085 #Importing the package needed for the BMP Sensor import Adafruit_DHT #Importing the package needed for the DHT Sensor import serial#for interfacing with...
3
3
08 - Operators and Operands/operator and operands.py
kuyesu/Scripting-With-Python-BIT-II
1
12790390
""" These are operators in python -Comparison Operators -Arithmetic Operators -Membership Operators -Assignment Operators -Logical Operators """ """ Arithmetic Operators [ + / - * % ] """ """ Examples """ num1 = 2 num2 = 3 sum = num1 + num2 print(sum) """ Comparison Operators < ...
4.40625
4
Callproj/core/views.py
Prakhar-100/DjangoProject
0
12790391
<reponame>Prakhar-100/DjangoProject from django.shortcuts import render from django.http import HttpResponse # from django.views.decorators.csrf import csrf_exempt # from twilio.rest import TwilioRestClient as Call from twilio.rest import Client # from twilio.twiml.voice_response import VoiceResponse from core.forms im...
2.21875
2
cogs/utils/player.py
FrostiiWeeb/OpenRobot-Bot
8
12790392
<gh_stars>1-10 # Thanks to https://github.com/Axelware/Life-bot/blob/main/bot/utilities/custom/player.py from __future__ import annotations import discord import asyncio import yarl import humanize import datetime import slate import async_timeout import slate.obsidian from discord.components import SelectOption from...
2.078125
2
users/admin.py
shubhankar5/Mitron-Achatting-app-in-django
7
12790393
<reponame>shubhankar5/Mitron-Achatting-app-in-django from django.contrib import admin from .models import Profile, Address, Friends, BlockedUsers admin.site.register([Profile, Address, Friends, BlockedUsers])
1.4375
1
Core/LogicClass/MonteCarloClass/MonteCarloMove.py
Needoliprane/ThePhantomOfTheOpera
0
12790394
import random from LogicClass.MonteCarloClass.ArborescenteTree import ArborescenteTree class MonteCarloMove: def __init__(self, isInspector, isPhantom, numberOfRoom): self.tree = ArborescenteTree() self.isPhantom = isPhantom self.isInspector = isInspector self.numberOfRoom = number...
3.015625
3
Codes/Abaqus_Indentation/2D/scripts_2D/geom_tip_ball.py
materialsguy/Predict_Nanoindentation_Tip_Wear
0
12790395
<filename>Codes/Abaqus_Indentation/2D/scripts_2D/geom_tip_ball.py s1 = mdb.models['Model-1'].ConstrainedSketch(name='__profile__', sheetSize=200.0) g, v, d, c = s1.geometry, s1.vertices, s1.dimensions, s1.constraints s1.sketchOptions.setValues(viewStyle=AXISYM) s1.setPrimaryObject(option=STANDALONE) s1.ConstructionLine...
1.898438
2
external/colors_script.py
corey1218/ZetaSploit
1
12790396
<filename>external/colors_script.py #!/usr/bin/env python3 # # MIT License # # Copyright (c) 2020-2021 EntySec # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, includin...
2.296875
2
dicom_wsi/mods/mapping.py
m081429/dicom_wsi
0
12790397
<reponame>m081429/dicom_wsi import mods.utils # ===================================================================================== # Use this piece of code to automatically parse information from different slide types # ===================================================================================== def map_...
2.21875
2
make.py
skandupmanyu/facet
37
12790398
<filename>make.py<gh_stars>10-100 #!/usr/bin/env python3 """ call the Python make file for the common conda build process residing in 'pytools' """ import os import sys SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__)) PYTOOLS_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir, "pytools")) sys.path.insert...
2.21875
2
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/pavelib/paver_tests/test_database.py
osoco/better-ways-of-thinking-about-software
3
12790399
""" Tests for the Paver commands for updating test databases and its utility methods """ import os import shutil import tarfile from tempfile import mkdtemp from unittest import TestCase from unittest.mock import call, patch, Mock import boto from pavelib import database from pavelib.utils import db_utils from pave...
2.65625
3
nygame/font_cache.py
nfearnley/nygame
1
12790400
from functools import lru_cache from typing import Optional from pygame.freetype import get_default_font, SysFont font_cache = {} @lru_cache(100) def get_font(fontname: Optional[str] = None, size: int = 12, bold: bool = False, italic: bool = False): if fontname is None: fontname = get_default_font() ...
2.6875
3
ML/Regressions/DecisionTree/DecisionTree.py
acanozturk/ml-dl
0
12790401
<gh_stars>0 # Koltuk seviyesine göre fiyatlandırma import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.tree import DecisionTreeRegressor df = pd.read_csv("original.csv", sep =";", header = None) # Dataseti okuduk ve değerlerin ; ile ayrıldığını belirttik x = df.iloc[:,0].values.reshap...
3.296875
3
whatsgoingon/api/eventful.py
warisp/whatsgoingon
0
12790402
import requests def get_event(user_key, latitude, longitude): url = "http://api.eventful.com/json/events/search?" url += "&app_key=" + user_key url += "&date=Future" #+ date url += "&page_size=100" url += "&sort_order=popularity" url += "&sort_direction=descending" url += "&q=music" u...
3.09375
3
setup.py
erstrom/hexfilter
0
12790403
<reponame>erstrom/hexfilter #!/usr/bin/env python from setuptools import setup readme = open("README.rst").read() setup(name="hexfilter", version="0.2", description="A library/tool for extracting hex dumps from log files", url="https://github.com/erstrom/hexfilter", author="<NAME>", aut...
1.554688
2
packages/w3af/w3af/core/data/dc/utils/multipart.py
ZooAtmosphereGroup/HelloPackages
3
12790404
<filename>packages/w3af/w3af/core/data/dc/utils/multipart.py<gh_stars>1-10 """ multipart.py Copyright 2014 <NAME> This file is part of w3af, http://w3af.org/ . w3af 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 Foundatio...
2.40625
2
wikiquote/langs/fr.py
gcqmkm02/wikiquote
55
12790405
from typing import List, Text, Tuple import logging import re import lxml from .. import utils MAIN_PAGE = "Wikiquote:Accueil" logger = logging.getLogger(__name__) logger.addHandler(logging.NullHandler()) def extract_quotes(tree: lxml.html.HtmlElement, max_quotes: int) -> List[Text]: # French wiki uses a "ci...
3.21875
3
release/stubs/Autodesk/AutoCAD/Internal/DatabaseServices.py
paoloemilioserra/ironpython-stubs
0
12790406
<reponame>paoloemilioserra/ironpython-stubs<gh_stars>0 # encoding: utf-8 # module Autodesk.AutoCAD.Internal.DatabaseServices calls itself DatabaseServices # from Acmgd, Version=24.0.0.0, Culture=neutral, PublicKeyToken=null # by generator 1.145 # no doc # no imports # no functions # classes class EvalExpr(D...
1.921875
2
src/send_sms/send_sms.py
nvk1196/flashshipper
0
12790407
<reponame>nvk1196/flashshipper # Download the helper library from https://www.twilio.com/docs/python/install # Your Account Sid and Auth Token from twilio.com/console # DANGER! This is insecure. See http://twil.io/secure # my_msg = "This is my message with stuff and things" # send_to_phone_number = "+15184282729" # c...
2.375
2
tests/test_legendary_item.py
bonetou/GildedRose-Refactoring-Kata
0
12790408
<reponame>bonetou/GildedRose-Refactoring-Kata<filename>tests/test_legendary_item.py import pytest from src.items.legendary import LegendaryItem from src.items.exceptions.invalid_quality_value import InvalidQualityValue @pytest.fixture def sulfuras(): return LegendaryItem('Sulfuras', 10, 80) def test_should_not_c...
2.375
2
backend/src/baserow/contrib/database/migrations/0061_change_decimal_places.py
ashishdhngr/baserow
0
12790409
# Generated by Django 3.2.6 on 2022-02-14 13:25 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("database", "0060_set_ordering_on_tablewebhook_models"), ] operations = [ migrations.AlterField( model_name="numberfield", ...
1.734375
2
tests/integration/test_networks.py
unparalleled-js/ape
210
12790410
<filename>tests/integration/test_networks.py import pytest from eth_typing import HexStr @pytest.mark.parametrize("block_id", ("latest", 0, "0", "0x0", HexStr("0x0"))) def test_get_block(eth_tester_provider, block_id): latest_block = eth_tester_provider.get_block(block_id) # Each parameter is the same as req...
1.96875
2
job/sample_postgres_aws_sqs_job.py
Wonong/ab-metadata-publisher
1
12790411
<reponame>Wonong/ab-metadata-publisher<filename>job/sample_postgres_aws_sqs_job.py import textwrap import logging import logging.config import os from pyhocon import ConfigFactory from databuilder.extractor.postgres_metadata_extractor import PostgresMetadataExtractor from databuilder.extractor.sql_alchemy_extractor im...
1.742188
2
1 - EstruturaSequencial/ex_9.py
FelipeMontLima/Lista_de_exercicio_python_brasil
0
12790412
<filename>1 - EstruturaSequencial/ex_9.py<gh_stars>0 """ 9 -> Faça um Programa que peça a temperatura em graus Fahrenheit, transforme e mostre a temperatura em graus Celsius. """ while True: f = input('Digite a temperatura em graus Fahrenheit: ') if f.isdigit(): f = int(f) c = (f - 32) / 1.8 ...
3.5625
4
Exercise/_DCGAN_CIFAR10/DCGAN_CIFAR10.py
Ninei/GANs
0
12790413
from IPython import display from torch.utils.data import DataLoader from torchvision import transforms, datasets import os import tensorflow as tf from tensorflow import nn, layers from tensorflow.contrib import layers as clayers import numpy as np import errno import torchvision.utils as vutils from tensorboardX impo...
2.40625
2
run_gitlab_ci.py
Billmvp73/attention-sampling
0
12790414
<filename>run_gitlab_ci.py<gh_stars>0 #!/usr/bin/env python # # Copyright (c) 2019 Idiap Research Institute, http://www.idiap.ch/ # Written by <NAME> <<EMAIL>> # import argparse import os from os import path from subprocess import call import tempfile import yaml SCRIPT_TPL = """#!/bin/bash git clone . {dir}/projec...
2.59375
3
_includes/code/construct-binary-tree-from-preorder-and-inorder-traversal/solution.py
rajat19/interview-questions
0
12790415
<reponame>rajat19/interview-questions from typing import List, Optional # Definition for a binary tree node. class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def buildTree(self, preorder: List[int], i...
3.84375
4
lino_xl/lib/vat/__init__.py
khchine5/xl
1
12790416
# -*- coding: UTF-8 -*- # Copyright 2013-2017 <NAME> # License: BSD (see file COPYING for details) """See :doc:`/specs/vat`. .. autosummary:: :toctree: utils .. fixtures.novat fixtures.euvatrates """ from django.utils.translation import ugettext_lazy as _ from lino.api import ad import six class Plugin(a...
2.234375
2
Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/tvm/python/tvm/relay/ir_pass.py
mengkai94/training_results_v0.6
64
12790417
<reponame>mengkai94/training_results_v0.6<filename>Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/tvm/python/tvm/relay/ir_pass.py # pylint: disable=no-else-return, # pylint: disable=unidiomatic-typecheck """The set of passes for Relay. Exposes an interface for configuring the passes and scripting them in Pyt...
2.171875
2
code/insert_sensordata_from_azure_queue.py
jurjanbrust/wsl2_mysql_grafana
0
12790418
<reponame>jurjanbrust/wsl2_mysql_grafana<gh_stars>0 from azure.storage.queue import ( QueueClient, TextBase64EncodePolicy, TextBase64DecodePolicy ) import os, uuid, time, json import mysql.connector from datetime import datetime connect_str = "DefaultEndpointsProtocol=https;AccountName=replace...
2.09375
2
app/admin/__init__.py
RandyDeng/InterviewScheduler
0
12790419
from flask import Blueprint admin = Blueprint('admin', __name__, url_prefix='/admin', template_folder='templates')
1.59375
2
alipay/aop/api/domain/AlipayUserApplepayProvisioningbundleCreateModel.py
antopen/alipay-sdk-python-all
213
12790420
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayUserApplepayProvisioningbundleCreateModel(object): def __init__(self): self._alipay_user_identifier = None @property def alipay_user_identifier(self): return self._...
2.28125
2
e3nn/util/codegen/_mixin.py
simonbatzner/e3nn
0
12790421
from typing import Dict from ._eval import eval_code class CodeGenMixin: """Mixin for classes that dynamically generate some of their methods. This class manages evaluating generated code for subclasses while remaining pickle/deepcopy compatible. If subclasses need to override ``__getstate__``/``__setstate_...
2.859375
3
mysite/calls/migrations/0001_initial.py
gurupratap-matharu/django-calls-registration-app
0
12790422
# Generated by Django 2.1.5 on 2019-01-29 23:48 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Call', fields=[ ('id', models.AutoField(aut...
1.875
2
src/rgbw_colorspace_converter/randomcolor.py
fossabot/rgbw_colorspace_converter
0
12790423
<reponame>fossabot/rgbw_colorspace_converter<filename>src/rgbw_colorspace_converter/randomcolor.py<gh_stars>0 """ randomColor.py Python translation of randomColor.js http://llllll.li/randomColor/ https://github.com/davidmerfield/randomColor randomColor generates attractive colors by default. More specifically, it pro...
3.671875
4
ros/src/tl_detector/light_classification/tl_classifier.py
ahtchow/CarND-Capstone
0
12790424
<reponame>ahtchow/CarND-Capstone import os import cv2 import numpy as np import rospy import tensorflow as tf from cv_bridge import CvBridge from styx_msgs.msg import TrafficLight from sensor_msgs.msg import Image THRESHOLD_SCORE = 0.6 NUM_CLASSES = 4 class TLClassifier(object): def __init__(self, is_site): ...
2.328125
2
pipeline/ccf.py
rozmar/map-ephys
0
12790425
import csv import logging import numpy as np import datajoint as dj import pathlib import scipy.io as scio from tifffile import imread from . import InsertBuffer from .reference import ccf_ontology from . import get_schema_name schema = dj.schema(get_schema_name('ccf')) log = logging.getLogger(__name__) @schem...
2.109375
2
bot.py
shenkw1/gamelettr
1
12790426
import os import discord import requests import json from dotenv import load_dotenv from discord.ext import commands from datetime import datetime load_dotenv() TOKEN = os.getenv('DISCORD_TOKEN') API_KEY = os.getenv('API_KEY') HEADERS = { "x-api-key" : API_KEY } bot = commands.Bot(command_prefix = "-") ROOT_URL...
2.671875
3
common/appconf.py
JobtechSwe/sokannonser-api
14
12790427
import logging from common import settings from elasticapm.contrib.flask import ElasticAPM log = logging.getLogger(__name__) def configure_app(flask_app): flask_app.config.SWAGGER_UI_DOC_EXPANSION = settings.RESTPLUS_SWAGGER_UI_DOC_EXPANSION flask_app.config.RESTPLUS_VALIDATE = settings.RESTPLUS_VALIDATE ...
2.125
2
examples/house-credit-default/get_input.py
wqruan/tf-encrypted
825
12790428
"""CLI for data preparation and processing.""" import argparse from utils import data_prep from utils import read_one_row from utils import save_input parser = argparse.ArgumentParser() parser.add_argument( "--save_row", type=int, default="0", help="Saves a single row to a file defaults to row 0", ) p...
2.828125
3
Python-Classes/class9.py
ViFLara/Python-Classes
0
12790429
list = [1, 10] file = open('test.txt', 'r') try: text = file.read() division = 10 / 1 number = list[1] except ZeroDivisionError: print('Unable to perform a division by zero') except ArithmeticError: print('There was an error performing an arithmetic operation.') except IndexError: print("Error a...
3.671875
4
src/python/ch07/sec08.py
zhuyuanxiang/Dive-into-Deep-Learning
0
12790430
<filename>src/python/ch07/sec08.py # -*- encoding: utf-8 -*- """ @Author : zYx.Tom @Contact : <EMAIL> @site : https://zhuyuanxiang.github.io --------------------------- @Software : PyCharm @Project : Dive-into-Deep-Learning @File : sec0202.py @Version : v0.1 @Time : ...
2.71875
3
misc/python/detective.py
saranshbht/codes-and-more-codes
0
12790431
<filename>misc/python/detective.py n = int(input()) l = list(map(int, input().split())) lst = [] for i in range(0, n + 1): if i not in l: lst.append(str(i)) print(" ".join(lst))
3.3125
3
tests/blendernc_nodetree_settings.test.py
StephanSiemen/blendernc
39
12790432
import os import sys import unittest from io import StringIO import bpy import tests.test_utils as tutils from blendernc.preferences import get_addon_preference @tutils.refresh_state def create_nodes(file, var): node_groups = bpy.data.node_groups if tutils.is_blendernc_in_nodetree(node_groups): node...
2.109375
2
kaffepause/conftest.py
Eirsteir/kaffepause
0
12790433
from __future__ import print_function import os import warnings import pytest from graphene_django.utils.testing import graphql_query from graphql_jwt.settings import jwt_settings from graphql_jwt.shortcuts import get_token from neo4j.exceptions import ClientError as CypherError from neobolt.exceptions import ClientE...
1.851563
2
tests/test_json.py
bobhancock/proto-plus-python
0
12790434
# Copyright (C) 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 to in writi...
2.296875
2
src/consolidate_washington_timber_reports_2003-2017.py
Ecotrust/embodied_carbon
0
12790435
<reponame>Ecotrust/embodied_carbon<gh_stars>0 import os import re import glob import numpy as np import pandas as pd excel_files = glob.glob('../data/external/reports_2003-2017/*xl*') fnames = [os.path.basename(f) for f in excel_files] years = [int(re.findall('\d{4}', fname)[0]) for fname in fnames] OWNERS = {'Priva...
2.578125
3
04_Inspecao/4.1_Graficos_de_Dependencia_Parcial_e_Expectativa_Condicional_Individual/4.1.3_Definicao_Matematica.py
BrunoBertti/Scikit_Learning
0
12790436
<gh_stars>0 ########## 4.1.3. Definição matemática ########## # Seja X_S o conjunto de recursos de entrada de interesse (ou seja, o parâmetro de recursos) e seja X_C seu complemento. # A dependência parcial da resposta f em um ponto x_S é definida como: # \begin{split}pd_{X_S}(x_S) &\overset{def}{=}...
2.46875
2
src/dataset.py
prayashkrsaha/marketBias
22
12790437
import numpy as np import pandas as pd import sys import os from utils import DATA_DIR class Dataset(object): def __init__(self, DATA_NAME): self.DATA_NAME = DATA_NAME print("Initializing dataset:", DATA_NAME) sys.stdout.flush() data = pd.read_csv(os.path.join(DATA_DIR, "...
2.734375
3
pygramadan/xml_helpers.py
jimregan/pygramadan
0
12790438
<reponame>jimregan/pygramadan from .attributes import Gender, Strength from pygramadan.forms import Form, FormSg, FormPlGen import xml.etree.ElementTree as ET def write_sg(inlist, name, root): for form in inlist: seprops = {} seprops['default'] = form.value seprops['gender'] = 'fem' if for...
2.359375
2
setup.py
ElsevierSoftwareX/SOFTX_2019_323
0
12790439
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name='HPexome', version='1.2.1', author="<NAME>", author_email="<EMAIL>", description="An automated tool for processing whole-exome sequencing data", long_description=long_description, l...
1.578125
2
torchlib/dataloader.py
gkaissis/4P
7
12790440
import os import random import syft as sy import pandas as pd import numpy as np from PIL import Image from tqdm import tqdm from torch import ( # pylint:disable=no-name-in-module manual_seed, stack, cat, std_mean, save, is_tensor, from_numpy, randperm, default_generator, ) from tor...
2.1875
2
katas/kyu_7/formatting_decimal_places_1.py
the-zebulan/CodeWars
40
12790441
from math import trunc def two_decimal_places(number): factor = float(10 ** 2) return trunc(number * factor) / factor
2.640625
3
conplyent/console.py
joshijayesh/conplyent
0
12790442
<gh_stars>0 ''' :File: console.py :Author: <NAME> :Email: <EMAIL> ''' from subprocess import Popen, PIPE, STDOUT from threading import Thread from queue import Queue from ._decorators import timeout from .exceptions import ConsoleExecTimeout class ConsoleExecutor(): ''' Simple wrapper around subprocess to p...
3.21875
3
{{cookiecutter.project_name}}/tests/data/data_fib.py
michael-c-hoffman/python-best-practices-cookiecutter
0
12790443
# pylint: disable-all tests = [ (0, 0), (1, 1), (2, 1), (3, 2), (4, 3), (6, 8), (7, 13), (8, 21), (9, 34), (10, 55), (11, 89), (12, 144), (13, 233), (14, 377), (15, 610), (17, 1597), (18, 2584), (19, 4181), (20, 6765), ]
1.3125
1
predict_train_embeddings.py
simphide/Kaggle-2020-Alaska2
21
12790444
import warnings warnings.simplefilter("ignore", UserWarning) warnings.simplefilter("ignore", FutureWarning) import argparse import os import pandas as pd import numpy as np from torch import nn from torch.utils.data import DataLoader from tqdm import tqdm from collections import defaultdict from catalyst.utils impo...
1.976563
2
common/hil_slurm_client.py
mghpcc-projects/user_level_slurm_reservations
0
12790445
<filename>common/hil_slurm_client.py """ MassOpenCloud / Hardware Isolation Layer (MOC/HIL) HIL Client Interface August 2017, <NAME> <EMAIL> """ import urllib import time from hil.client.client import Client, RequestsHTTPClient from hil.client.base import FailedAPICallException from hil_slurm_logging import log_in...
2.40625
2
terra_sdk/core/auth/data/account.py
terra-money/terra.py
66
12790446
from abc import ABC, abstractmethod from terra_sdk.core.public_key import PublicKey from terra_sdk.util.json import JSONSerializable from .base_account import BaseAccount from .continuous_vesting_account import ContinuousVestingAccount from .delayed_vesting_account import DelayedVestingAccount from .periodic_vesting_...
2.421875
2
Course/models.py
Viet782000/CourseAPITest
0
12790447
from django.db import models class Course(models.Model): created = models.DateTimeField(auto_now_add=True) title = models.CharField(max_length=100, blank=True, default='') content = models.TextField() owner = models.ForeignKey('auth.User', related_name='Course', on_delete=models.CASCADE) class M...
2.15625
2
mll_calc/htc_prep.py
opotowsky/like-me-fuel
0
12790448
#! /usr/bin/env python3 import sys import csv import argparse import numpy as np import pandas as pd from mll_calc.all_jobs import parent_jobs, kid_jobs def row_calcs(ext_test): if 'no' in ext_test: #db_rows = 450240 #max_jobs = 9750 db_rows = 90048 * 4 max_jobs = 978 * 4 else:...
2.703125
3
MTCNN/data_set/preprocess.py
gm19900510/License_Plate_Detection_Pytorch
10
12790449
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jul 8 10:17:20 2019 The code is designed to split the data for train and validation @author: xingyu """ from imutils import paths import numpy as np import cv2 import os import argparse import random parser = argparse.ArgumentParser(de...
2.59375
3
2015/21/rpg.py
lvaughn/advent
0
12790450
<filename>2015/21/rpg.py #!/usr/bin/env python3 from collections import namedtuple from itertools import combinations Item = namedtuple('Item', ['name', 'cost', 'damage', 'armor']) boss_hp = 109 boss_damage = 8 boss_armor = 2 weapons = [ Item('Dagger', 8, 4, 0), Item('Shortsword', 10, 5, 0), Item('Warha...
3.0625
3