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
analysis_scripts/plot_gender.py
dezeraecox/Behind-the-scenes---Investigator-Grants-2019
0
12778451
from wordcloud import WordCloud, STOPWORDS import os import re import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from matplotlib.patches import Patch from loguru import logger from GEN_Utils import FileHandling from GEN_Utils.HDF5_Utils import hdf_to_dict logger.info('Impor...
2.53125
3
natlas-server/app/auth/email.py
pryorda/natlas
0
12778452
<reponame>pryorda/natlas<filename>natlas-server/app/auth/email.py<gh_stars>0 from flask import render_template, current_app, flash from app.email import send_email from app.models import User def validate_email(addr): validemail = User.validate_email(addr) if not validemail: flash( f"{addr...
2.078125
2
backend2/src/api/api_v1/endpoints/user_subscription.py
alexxxnf/VirusMutationsAI
1
12778453
<gh_stars>1-10 from typing import Any from fastapi import APIRouter, Depends, status, Query from sqlalchemy.orm import Session from sqlalchemy import exc, asc from src.api import deps from src.db import models from src.schemas import PaginatedList router = APIRouter() @router.put("/subscriptions/{mutation}", respo...
2.1875
2
src/jk_simplexml/HToolkit_Write_HTML.py
jkpubsrc/python-module-jk-simplexml
0
12778454
from jk_hwriter import HWriter from jk_rawhtml.htmlgeneral import * from jk_rawhtml._HTMLElementProto import _HTMLElementProto, HTMLElement from jk_rawhtml._HTMLCommentProto import _HTMLCommentProto, HTMLComment from jk_rawhtml._HTMLRawTextProto import _HTMLRawTextProto, HTMLRawText from jk_rawhtml._HTMLRawCSSPro...
2.578125
3
tests/seahub/views/sysadmin/test_sysadmin.py
samuelduann/seahub
420
12778455
<filename>tests/seahub/views/sysadmin/test_sysadmin.py<gh_stars>100-1000 import os import openpyxl from io import BytesIO from mock import patch from django.urls import reverse from seahub.base.accounts import User from seahub.options.models import (UserOptions, KEY_FORCE_PASSWD_CHANGE) from seahub.test_utils import B...
2.078125
2
main/contact.py
gae-init/phonebook
10
12778456
<filename>main/contact.py # coding: utf-8 from flask.ext import wtf import flask import wtforms import auth import model import util from main import app class ContactUpdateForm(wtf.Form): name = wtforms.StringField('Name', [wtforms.validators.required()]) email = wtforms.StringField('Email', [wtforms.validato...
2.71875
3
New.py
UJJWAL97/MAJORPYTHON
0
12778457
<gh_stars>0 import sys try: from Tkinter import * except ImportError: from tkinter import * try: import ttk py3 = False except ImportError: import tkinter.ttk as ttk py3 = True import tkintergui from featureextractor import featureextractor from scipy.special import expit import numpy as np...
2.328125
2
src/waldur_core/structure/migrations/0007_customer_blocked.py
geant-multicloud/MCMS-mastermind
26
12778458
# Generated by Django 1.11.18 on 2019-03-04 10:28 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('structure', '0006_customer_backend_id'), ] operations = [ migrations.AddField( model_name='customer', name='blocked...
1.671875
2
src/app/c/frontend/__main__.py
lfvilella/dunder-interpreter
0
12778459
import logging import antlr4 from antlr4.error.ErrorListener import ErrorListener import click from .antlr.CLexer import CLexer from .antlr.CParser import CParser logger = logging.getLogger(__name__) class MyErrorListener(ErrorListener): def syntaxError(self, recognizer, offendingSymbol, line, column, msg, e)...
2.421875
2
p3/management/commands/users_with_unassigned_tickets.py
judy2k/epcon
0
12778460
# -*- coding: utf-8 -*- """ Print information of the users who got unassigned tickets.""" from django.core.management.base import BaseCommand, CommandError from django.conf import settings from p3 import models as p3_models from assopy import models as assopy_models from optparse import make_option ### Globals ###...
2.296875
2
manila_tempest_tests/tests/api/test_share_types_negative.py
openstack/manila-tempest-plugin
9
12778461
<filename>manila_tempest_tests/tests/api/test_share_types_negative.py # Copyright 2014 OpenStack Foundation # 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 # #...
1.78125
2
Training/multipleInheritance.py
srikanteswartalluri/pyutils
0
12778462
<reponame>srikanteswartalluri/pyutils<filename>Training/multipleInheritance.py<gh_stars>0 class A: def Am(self): print self.__class__, '=>I am in A' class B(A): def Am(self): print self.__class__, '=>I am in Am' def Bm(self): print self.__class__, '=>I am in Bm' class C(A, B): de...
2.890625
3
test/test_delete_group.py
mihushynmaksym/Python_Training
0
12778463
from random import randrange __author__ = 'Max' def test_delete_some_group(app): app.group.find_group_button() # find button "group" on the page app.group.if_not_group_create_group() # if not have any groups = create group old_groups = app.group.get_group_list() # Check lists - 1 (delete gr...
2.765625
3
refinery218/jobs/andes-thermal-perjob-time.py
at-aaims/sc21_summit_power_analysis_artifacts
1
12778464
<filename>refinery218/jobs/andes-thermal-perjob-time.py<gh_stars>1-10 #!../.venv.andes/bin/python3 #SBATCH -M andes #SBATCH -N 32 #SBATCH -J andes-thermal-perjob-time #SBATCH -t 8:00:00 #SBATCH -A stf218 #SBATCH -o ../logs/andes-thermal-perjob-time-%J.out import os import sys import time import glob from itertools impo...
1.65625
2
src/server/models/caso.py
AssisDev/CT-I
0
12778465
<gh_stars>0 from databases.config import db # from datetime import datetime class Caso(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) caso = db.Column(db.String(150), nullable=False) n_sipia = db.Column(db.String(30)) conselheiro = db.Column(db.String(150)) local_guarda...
2.375
2
askapp/models.py
alexpirine/askapp
0
12778466
<reponame>alexpirine/askapp<filename>askapp/models.py import os import sys import logging from django.db import models from django.contrib.auth.models import User from django.db.models.signals import post_save, pre_delete from django.dispatch import receiver from django_countries.fields import CountryField from django...
1.992188
2
src/aspire/utils/matrix.py
janden/ASPIRE-Python
0
12778467
<reponame>janden/ASPIRE-Python """ Utilties for arrays/n-dimensional matrices. """ import numpy as np from scipy.linalg import eigh from aspire.utils import ensure from aspire.utils.matlab_compat import m_reshape SQRT2 = np.sqrt(2) SQRT2_R = 1/SQRT2 def unroll_dim(X, dim): # TODO: dim is still 1-indexed like i...
2.953125
3
dcgan/utils.py
verysage/logo-gen
80
12778468
<reponame>verysage/logo-gen<filename>dcgan/utils.py<gh_stars>10-100 """ Some codes from https://github.com/Newmu/dcgan_code """ from __future__ import division import os import math import pprint import scipy.misc import scipy.stats as stats import numpy as np from time import gmtime, strftime from six.moves import xr...
1.742188
2
cv/blog/models.py
Trianglium/artist-cv
2
12778469
<reponame>Trianglium/artist-cv from django.db import models from django.conf import settings from django.contrib.contenttypes.fields import GenericRelation from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from base.models import BaseContent, Bas...
2.203125
2
uploads/core/forms.py
lindsay777/ITRI_hospital_UI
0
12778470
from django import forms from uploads.core.models import Document #from uploads.core.models import File # 創造一個依照model的form,會繼承欄位description document class DocumentForm(forms.ModelForm): class Meta: model = Document fields = ('description', 'document', ) class nameForm(forms.Form): rename=form...
2.25
2
troposphere_mate/cloudformation.py
MacHu-GWU/troposphere_mate-project
10
12778471
# -*- coding: utf-8 -*- """ This code is auto generated from troposphere_mate.code_generator.__init__.py scripts. """ import sys if sys.version_info.major >= 3 and sys.version_info.minor >= 5: # pragma: no cover from typing import Union, List, Any import troposphere.cloudformation from troposphere.cloudformati...
1.976563
2
Python/generate-parentheses.py
sm2774us/leetcode_interview_prep_2021
0
12778472
# # A famous ancient question in this context is: # "How many distinct arrangements of n pairs of left-right parentheses are there all of which close?" # The answer to this question is called the n-th Catalan number, C(n). # Here are the first few answers: # * C(1)=1 ( ) # * C(2)=2 ()() and (())...
3.578125
4
api/src/routes/healthcheck.py
rbipin/cidr-ip-calculator
0
12778473
from fastapi import APIRouter from src.controllers import healthcheck router = APIRouter( prefix="/healthcheck", tags=["healthcheck"] ) @router.get("", name="Health check", response_model=str) async def runGetHealthCheck(): return healthcheck.getHealthCheck()
2.296875
2
raco/myrial/query_tests.py
uwescience/raco
61
12778474
# -*- coding: UTF-8 -*- import collections import math import md5 from nose.tools import nottest import raco.algebra import raco.fakedb import raco.myrial.interpreter as interpreter import raco.scheme as scheme import raco.myrial.groupby import raco.myrial.myrial_test as myrial_test from raco.algebra import Apply fro...
2.171875
2
testing/cdutil/test_gen_mask.py
xylar/cdat
62
12778475
import cdms2,sys,cdutil,os,cdat_info f=cdms2.open(os.path.join(cdat_info.get_sampledata_path(),"navy_land.nc")) navy_frac = f("sftlf")/100. target = cdms2.open(os.path.join(cdat_info.get_sampledata_path(),'clt.nc'))("clt",slice(0,1)).getGrid() mask = cdutil.generateLandSeaMask(target,navy_frac) target = cdms2.open(os...
2.109375
2
iRODS/scripts/python/validate_json.py
wtsi-npg/irods
0
12778476
<gh_stars>0 from __future__ import print_function import json import sys import requests if len(sys.argv) != 3: sys.exit('Usage: {0} <configuration_file> <schema_url>'.format(sys.argv[0])) config_file = sys.argv[1] schema_uri = sys.argv[2] def print_error(*args, **kwargs): print(*args, file=sys.stderr, **kw...
2.328125
2
saleor/plugins/webhook/const.py
victor-abz/saleor
1,392
12778477
CACHE_EXCLUDED_SHIPPING_KEY = "webhook_exclude_shipping_id_" CACHE_EXCLUDED_SHIPPING_TIME = 60 * 3 EXCLUDED_SHIPPING_REQUEST_TIMEOUT = 2
0.75
1
pvn3d/eval_icp.py
hajar2016/hajar
0
12778478
<reponame>hajar2016/hajar #!/usr/bin/env python3 import os import cv2 import random from random import shuffle import os.path import nori2 import numpy as np import pickle as pkl from PIL import Image from queue import Queue from common import Config from argparse import ArgumentParser import sys from tqdm import tqdm ...
1.703125
2
tests/load_balancer.py
NaHCO314/api-client
38
12778479
<reponame>NaHCO314/api-client<filename>tests/load_balancer.py #!/usr/bin/env python3 import argparse import pathlib def main(): parser = argparse.ArgumentParser(description='Categorize and list test files in the tests/ directory') parser.add_argument('keyword', choices=('stable', 'unstable')) args = parse...
2.65625
3
tests/test_api_request.py
wkgreen/python-idex
0
12778480
<reponame>wkgreen/python-idex #!/usr/bin/env python # coding=utf-8 from idex.client import Client from idex.exceptions import IdexAPIException, IdexRequestException import pytest import requests_mock client = Client() def test_invalid_json(): """Test Invalid response Exception""" with pytest.raises(IdexRe...
2.53125
3
ooobuild/lo/awt/x_toolkit.py
Amourspirit/ooo_uno_tmpl
0
12778481
# coding: utf-8 # # Copyright 2022 :Barry-Thomas-Paul: Moss # # 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 applicab...
1.71875
2
crispy_forms/tests/urls.py
iedparis8/crispy-forms
3
12778482
import django if django.get_version() >= '1.5': from django.conf.urls import patterns, url else: from django.conf.urls.defaults import patterns, url urlpatterns = patterns('', url(r'^simple/action/$', 'simpleAction', name = 'simpleAction'), )
1.953125
2
resc/resc.py
hboshnak/pipenv-template
1
12778483
<reponame>hboshnak/pipenv-template """ Some math functions. """ def add(a_num, b_num): """Adds two numbers.""" return a_num + b_num def sub(a_num, b_num): """Subtract two numbers.""" return a_num - b_num
2.15625
2
scripts/emit_step08_postprocess_linearity.py
emit-sds/emit-sds-l1b
0
12778484
# <NAME> import numpy as np import pylab as plt from spectral.io import envi import os, sys sys.path.append('../utils') from fpa import FPA I = envi.open('../data/EMIT_LinearityMap_20220117.hdr').load() thresh = 20 fpa = FPA('../config/tvac2_config.json') for band in range(I.shape[2]): x = np.squeeze(I[:,:,band])...
2.171875
2
tools/main.py
reduf/Headquarter
1
12778485
from process import * import sys import time import signal def main(argv): # proc = Process.from_name('Gw.exe') proc = Process(3356) dbg = ProcessDebugger(proc) scanner = ProcessScanner(proc) def signal_handler(signal, frame): dbg.detach() signal.signal(signal.SIGINT, signal_handler)...
2.265625
2
tests/__init__.py
shizhao/pywikibot-core
0
12778486
<filename>tests/__init__.py<gh_stars>0 # -*- coding: utf-8 -*- # # (C) Pywikipedia bot team, 2007 # # Distributed under the terms of the MIT license. # __version__ = '$Id: 0487fc48520b7ec1775d23b30a33c986a52eba49 $' import os import pywikibot.data.api from pywikibot.data.api import Request as _original_Request from p...
2.421875
2
gpio_device_tools/config.py
alexeiken/gpio-device-tools
0
12778487
import ConfigParser import os import re # date format dt_format = "%Y-%m-%dT%H:%M:%S" # boolean states _boolean_states = {'1': True, 'yes': True, 'y': True, 'true': True, 't': True, 'on': True, 'high': True, '0': False, 'no': False, 'n': False, 'false': False, 'f': False, 'off': False, 'low': False...
2.515625
3
subfinder/subfinder_gevent.py
ttimasdf/subfinder
3
12778488
# -*- coding: utf8 -*- """ SunFinder 的协程版本 """ from __future__ import unicode_literals from gevent.pool import Pool from .subfinder import SubFinder class SubFinderGevent(SubFinder): """ SubFinder Thread version """ def _init_pool(self): self.pool = Pool(10)
1.710938
2
bot/cogs/birthday.py
janaSunrise/HotWired-Bot
16
12778489
<reponame>janaSunrise/HotWired-Bot import asyncio import datetime import itertools import contextlib import json from discord import Color, Embed, Channel, Forbidden, HTTPException, Role, utils from discord.ext.commands import Cog, Context, group, has_permissions from bot.core import Bot BDAY_JSON_PATH = "assets/bd...
2.59375
3
Controls/env/Lib/site-packages/PySide/examples/hyperui/hyperuilib/pageview.py
LoicBoileau/Projet-S4---Robot-Delta
32
12778490
""" /* * This file is part of PySide: Python for Qt * * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <<EMAIL>> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as pu...
1.84375
2
leetcode/ag_213.py
baobei813214232/common-alglib
4
12778491
<filename>leetcode/ag_213.py import copy class Solution(object): def roobbb(self, nums): dp = [] for i in range(0,len(nums)): dp.append(0) if len(nums) == 0: return 0 if len(nums) == 1: return nums[0] if len(nums) == 2: return max(nums[0],nums[1]) last =...
3.140625
3
enote.py
mperbil/Pretvornik-enot
0
12778492
import bottle import model result = '' kolicina2 = 0 st = 0 vhodna = '' izhodna = '' @bottle.get('/') def index(): return bottle.template('index.tpl', result=result) @bottle.get('/pretvori/') def pretvori(): kolicina = kolicina2 global st st = float(bottle.request.query['st']) ...
2.109375
2
python/serpent.py
niccokunzmann/ping
1
12778493
<reponame>niccokunzmann/ping """ ast.literal_eval() compatible object tree serialization. Serpent serializes an object tree into bytes (utf-8 encoded string) that can be decoded and then passed as-is to ast.literal_eval() to rebuild it as the original object tree. As such it is safe to send serpent data to other machi...
2.078125
2
mbusi_surveys/surveys/build_survey.py
patrick310/flask-wtform-tutorial
0
12778494
<reponame>patrick310/flask-wtform-tutorial import json import os import os.path import uuid from .forms import SelectForm, MultiForm, TextForm, EmailForm, PhoneForm from dotenv import load_dotenv load_dotenv() # DATA_DIRECTORY = os.getenv('DATA_DIRECTORY') DATA_DIRECTORY = os.environ.get("DATA_DIRECTORY") SURVEY_DIRE...
3.0625
3
worktory/connection/__init__.py
renatoalmeidaoliveira/Worktory
4
12778495
<gh_stars>1-10 from worktory.connection.wrappers import *
1.109375
1
autoposter/bot.py
PhantomInsights/reddit-bots
13
12778496
<reponame>PhantomInsights/reddit-bots """ Takes the top 3 Google News and posts them to Reddit. """ import xml.etree.ElementTree as ET import praw import requests import config LOG_FILE = "./processed_urls.txt" NEWS_URL = "https://news.google.com/rss/search?q=ecatepec+when:1d&hl=es-419&gl=MX" def load_log(): ...
2.921875
3
xinshuo_io/test/images_io/test_load_image.py
xinshuoweng/cv_ml_tool
31
12778497
# Author: <NAME> # email: <EMAIL> import numpy as np import init_paths from images_io import load_image from xinshuo_visualization import visualize_image def test_load_image(): image_path = '../lena.png' print('basic') img = load_image(image_path) assert img.shape == (512, 512, 3) print('testing for resizing'...
2.5625
3
utils/utils.py
mansum6/iNNfer
15
12778498
<reponame>mansum6/iNNfer import os.path as osp from os import walk as osw import cv2 import numpy as np import torch import torch.nn.functional as F from .colors import * try: import rawpy rawpy_available = True except ImportError: rawpy_available = False MODEL_EXTENSIONS = ['.pth', '.pt'] IMG_EXTENSIO...
2.21875
2
app/thirdparty/dropbox_upload.py
aroranipun04/CloudCV-Old
11
12778499
__author__ = 'dexter' import dropbox import os import sys path = os.environ.get('CLOUDCVPATH') if path not in sys.path: sys.path.append(path) os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' def upload_files_to_dropbox(userid, jobid, result_path, dropbox_token=None): try: response = '' if ...
2.609375
3
learner_node.py
neka-nat/distributed_rl
72
12778500
<reponame>neka-nat/distributed_rl<filename>learner_node.py # -*- coding: utf-8 -*- import argparse import gym import torch import torch.optim as optim import visdom from distributed_rl.ape_x.learner import Learner from distributed_rl.libs import models, wrapped_env device = torch.device("cuda" if torch.cuda.is_availabl...
2.15625
2
modules/conditions/keywords.py
thevickypedia/jarvis
0
12778501
<gh_stars>0 # noinspection PyUnresolvedReferences """List of keywords for each variable which is condition matched in the main module. >>> Keywords """ current_date = ["today's date", "current date", "what is the date", "what's the date", "todays date", "whats the date"] current_time = ["current time", "time now", ...
2.40625
2
tests/unit/api/decorators/test_validation.py
chadlung/pywebhooks
94
12778502
<gh_stars>10-100 # Standard lib imports from http import client import unittest from unittest.mock import patch # Third party imports # None # Project level imports from pywebhooks.app import create_wsgi_app from pywebhooks import DEFAULT_ACCOUNTS_TABLE from pywebhooks.api.decorators.validation import validate_id_par...
2.265625
2
print.py
MileyWright/Intro-Python1-Notes
0
12778503
x = 2 y = 5 z = "Test" # This way of printing is older # The number after the '%' represent how much "padding" # we want to print that value with print("x is %2d, y is %6f, z is %13s" % (x, y, z)) # x is 2, y is 5.00000, z is Test # '%d' stands for 'decimal' # '%f' stands for 'float' # '%s' stands for 'stri...
4.25
4
workflow/__main__.py
trecvt-oss/workflow
183
12778504
<gh_stars>100-1000 #!/usr/bin/python # -*- coding: utf-8 -*- # License: 3-clause BSD License # Author: <NAME> <<EMAIL>> # Read-more: https://github.com/mdipierro/workflow import sys, os, shelve, glob, time, shlex, subprocess, logging, re, optparse re_line = re.compile('(?P<n>\w+):\s*(?P<p>.+?)\s*(\[(?P<dt>\w+)\]\s*)...
2.09375
2
chapter9/django_admin/app01/admin.py
MMingLeung/Python_Study
3
12778505
<filename>chapter9/django_admin/app01/admin.py<gh_stars>1-10 from django.contrib import admin from django.http import HttpResponse from app01 import models from django.utils.safestring import mark_safe from types import FunctionType # Register your models here. from django.forms import widgets from django.utils.html im...
2.28125
2
pipe_code/scripts/junction_saturation.py
ShaopengLiu1/RNA_seq_analysis_pipe
3
12778506
<reponame>ShaopengLiu1/RNA_seq_analysis_pipe #!/usr/bin/env python ''' Check if sequencing depth is saturated or not, based on the idea that when sequencing depth is approaching saturation, less NEW junctions will be detected. See http://rseqc.sourceforge.net/ for details. ''' #import built-in modules import os,sys ...
2.109375
2
pypy/module/cpyext/test/test_module.py
SeraphRoy/PyPy-Functional
0
12778507
<gh_stars>0 from pypy.module.cpyext.modsupport import PyModule_New from pypy.module.cpyext.test.test_api import BaseApiTest from rpython.rtyper.lltypesystem import rffi class TestModuleObject(BaseApiTest): def test_module_new(self, space): with rffi.scoped_str2charp('testname') as buf: w_mod =...
2
2
UrsinaShaderBuilder/shader_instructions.py
Werxzy/UrsinaShaderBuilder
3
12778508
# this may need to represent in a better way DataTypes = [ 'float', 'vec2', 'vec3', 'vec4', 'int', 'ivec2', 'ivec3', 'ivec4', 'uint', 'uvec2', 'uvec3', 'uvec4', 'bool', 'bvec2', 'bvec3', 'bvec4', 'mat2', 'mat3', 'mat4', 'mat...
2.015625
2
WrapBigARTM/model.py
JessikaSmith/WrapBigARTM
1
12778509
<reponame>JessikaSmith/WrapBigARTM<filename>WrapBigARTM/model.py # Currently only main and back topics and text modality are supported import os import numpy as np import artm from WrapBigARTM.scores import return_all_tokens_coherence class Topic_model: def __init__(self, experiments_path, S=100, decor_test=Fal...
2.203125
2
idaes/tests/test_headers.py
OOAmusat/idaes-pse
0
12778510
################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021 # by the softwar...
1.96875
2
Competitive Programming/System Design/Design Parking System.py
shreejitverma/GeeksforGeeks
2
12778511
'''https://leetcode.com/problems/design-parking-system/ 1603. Design Parking System Easy 451217Add to ListShare Design a parking system for a parking lot. The parking lot has three kinds of parking spaces: big, medium, and small, with a fixed number of slots for each size. Implement the ParkingSystem class: • Parking...
4.03125
4
aspects.py
alexeifigueroa/ASEPetSynthesizer
0
12778512
''' Created on Feb 5, 2018 @author: <NAME> ''' import CONSTANTS,time def log_arguments(f): """ @f: Function to be wrapped with the logging of it's arguments """ def logger(*args,**kwargs): """ wrapping function, it logs the arguments of the decorated function """ if CON...
3.609375
4
botlistbot/search.py
Rostgnom/BotListBot
66
12778513
<filename>botlistbot/search.py import re from peewee import fn from botlistbot import settings from botlistbot.models import Bot from botlistbot.models import Category from botlistbot.models import Keyword from botlistbot.models.revision import Revision def search_bots(query): query = query.lower().strip() ...
2.390625
2
mae_envs/modules/__init__.py
bglick13/multi-agent-emergence-environments
1,317
12778514
from .module import * from .util import *
1.140625
1
mopidy_mopify/mem.py
dirkgroenen/mopidy-mopify
504
12778515
<reponame>dirkgroenen/mopidy-mopify queuemanager = None localfiles = None
1.0625
1
nose_config.py
alazanman/py_epg_tests
0
12778516
# -*- coding: utf-8 -*- # from nose.tools import * # import nose # from nose import * # import pytest import nose import json import os.path import importlib import jsonpickle from time import sleep from fixture.app import Application from fixture.db import DbFixture from fixture.rest import RestApi config_file = Non...
1.953125
2
Project 1 - Data Modeling with PostgreSQL/sql_queries.py
gitHub882000/Data-Engineering-Nanodegree
2
12778517
# DROP TABLES songplay_table_drop = "DROP TABLE IF EXISTS songplays;" user_table_drop = "DROP TABLE IF EXISTS users;" song_table_drop = "DROP TABLE IF EXISTS songs;" artist_table_drop = "DROP TABLE IF EXISTS artists;" time_table_drop = "DROP TABLE IF EXISTS time;" # CREATE TABLES songplay_table_create = (""" CREATE ...
2.625
3
examples/shadowing2.py
joeldentici/python_stepper
1
12778518
(lambda x: lambda x: x + x)(5)(5)
1.414063
1
tests/testDifferences.py
yusufsarikaya/Image_Comparison
19
12778519
<filename>tests/testDifferences.py<gh_stars>10-100 ############################### # # (c) <NAME> 2017 # Student No: C14714071 # Course: DT228 # Date: 14-10-2017 # # Title: Testing methods for finding differences between images import numpy as np import cv2 import easygui imagesPath = 'images/' outputPath = '...
3
3
ctutils/driver/parallel_free_flame.py
Combustion-Zhen/pyutils
0
12778520
<reponame>Combustion-Zhen/pyutils import numpy as np from mpi4py import MPI from pyutils.ctutils.driver.chem_uq import free_flame import matplotlib.pyplot as plt # parallel init comm = MPI.COMM_WORLD size = comm.Get_size() rank = comm.Get_rank() n = 10 sl, dl = free_flame(n, 'H2', T=300, p=101325., phi=0.6) # data ...
2.015625
2
util.py
samirsen/image-generator
10
12778521
''' util.py ''' import os.path import h5py import numpy as np import constants import skimage.io import skimage.transform from scipy.io import loadmat import glob import os import cPickle as pickle import torch from itertools import izip_longest from glove import Glove import torch import torch.nn as nn # Makes the ...
2.1875
2
setup.py
flyingcircusio/pinner
0
12778522
# Always prefer setuptools over distutils from setuptools import setup, find_packages from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='pinner...
1.492188
1
erin/db/abc.py
DiscordFederation/Enigma
6
12778523
from abc import ABC, abstractmethod class DatabaseDriverBase(ABC): """ Force implementation of some methods in the event a new driver is added to the database package. """ @abstractmethod async def upsert(self, entity, states): pass @abstractmethod async def get(self, entity,...
3.234375
3
kodi_watched_2_plex.py
stevezau/kodi_watched_2_plex
0
12778524
#!/usr/bin/env python import re import logging import argparse import requests from plexapi.myplex import MyPlexAccount logging.basicConfig(format='%(message)s', level=logging.INFO) logging.getLogger('plexapi').setLevel(logging.CRITICAL) log = logging.getLogger(__name__) parser = argparse.ArgumentParser() parser.add...
2.53125
3
code/Experiments/Tutorials/nn-from-scratch/Stanford_linearClassifier.py
matthijsvk/convNets
53
12778525
import numpy as np from sklearn import datasets, linear_model import matplotlib.pyplot as plt N = 100 # number of points per class D = 2 # dimensionality K = 3 # number of classes X = np.zeros((N*K,D)) # data matrix (each row = single example) y = np.zeros(N*K, dtype='uint8') # class labels for j in xrange(K): ix = ...
3.46875
3
articles/imp/genfigs/flights_pdp.py
parrt/stratx
54
12778526
<reponame>parrt/stratx from sklearn.utils import resample from sklearn.model_selection import train_test_split from sklearn.preprocessing import normalize from sklearn.ensemble import RandomForestRegressor from timeit import default_timer as timer from sklearn.utils import resample import shap from support import * f...
2.375
2
planner/web/api.py
anzodev/planner
0
12778527
<gh_stars>0 import logging from flask import Blueprint from flask import Flask from flask import Response from flask import abort from flask import current_app from flask import g from flask import redirect from flask import render_template from flask import request from flask import url_for from werkzeug.exceptions i...
2.03125
2
puppeteer/fileops.py
haani-niyaz/puppeteer
25
12778528
import os import yaml class FileOps(object): def __init__(self, path): """Set path to file Args: path (str): file path """ self._infile = path def _validate_path(self): """Validate path to file Raises: YAMLFileError: notify user that the file does not exist """ ...
3.5
4
tests/test_byol.py
kitfactory/tftk
6
12778529
from tftk.image.dataset import Mnist from tftk.image.dataset import Food101 from tftk.image.dataset import ImageDatasetUtil from tftk.image.model.classification import SimpleClassificationModel from tftk.callback import CallbackBuilder from tftk.optimizer import OptimizerBuilder from tftk import Context from tftk.ima...
2.5625
3
pkg/gmail.py
rmc8/bibliography_alert
0
12778530
<reponame>rmc8/bibliography_alert import os import ssl import smtplib from typing import Optional, List from email.utils import formatdate from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.application import MIMEApplication class Gmail: def __init__(self, from_: ...
2.53125
3
modules/AR_Scheduler.py
deepsphere/deepsphere-weather
38
12778531
<gh_stars>10-100 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jan 23 11:31:21 2021 @author: ghiggi """ import numpy as np from cycler import cycler import matplotlib.pyplot as plt ##----------------------------------------------------------------------------. ### Check AR weights def check_ar_w...
2.953125
3
ejercicio5-condicionales.py
raformatico/5-ejemplos-if-elif-else
0
12778532
<reponame>raformatico/5-ejemplos-if-elif-else # SEÑALES ENVIADAS POR EL CHAT # > LAMADA DEL CHAT A LA CREACIÓN DEL CAMINO def on_chat_crea_camino(): agent.teleport(world(44, 4, 7), SOUTH) crea_camino() player.on_chat("crea_camino", on_chat_crea_camino) # > LAMADA DEL CHAT A LA CREACIÓN DEL CAMINO def on_chat_re...
3.375
3
tests/test_utils.py
logics4ai-sapienza/hoa2dot
0
12778533
<reponame>logics4ai-sapienza/hoa2dot<filename>tests/test_utils.py # -*- coding: utf-8 -*- # This file is part of hoa-utils. # # hoa-utils 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 the...
1.75
2
substra/sdk/rest_client.py
cupcicm/substra
0
12778534
<reponame>cupcicm/substra # Copyright 2018 Owkin, inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
2
2
test/lv1/lv2/include_lv2.py
pavelkukov/fsimport
0
12778535
<gh_stars>0 def get_text(): return 'text from lv2'
1.054688
1
krules_core/base_functions/processing.py
airspot-dev/krules-core
4
12778536
# Copyright 2019 The KRules 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 required by applicable law or agreed to in writing,...
1.757813
2
drepr/old_code/prototype/drepr/services/ra_reader/net_cdf_reader.py
scorpio975/d-repr
5
12778537
<reponame>scorpio975/d-repr<gh_stars>1-10 from pathlib import Path from typing import List, Any, Union import netCDF4 import numpy from drepr.models import Variable, Location from drepr.services.ra_reader.ra_reader import RAReader from drepr.services.ra_reader.tensor_ra_reader import TensorRAReader class NetCDFRARe...
2.078125
2
utils.py
laituan245/BLINK
0
12778538
<gh_stars>0 def visualize_el_preds(data_and_predictions, output_fp='visualization.html'): f = open(output_fp, 'w+') for data in data_and_predictions: inst_type = data['type'] ctx_left = data['context_left'] mention = data['mention'] ctx_right = data['context_right'] # In...
2.671875
3
src/adobe/pdfservices/operation/pdfops/options/extractpdf/extract_pdf_options.py
hvntravel/pdfservices-python-sdk
2
12778539
# Copyright 2021 Adobe. All rights reserved. # This file is licensed to you 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...
2.171875
2
equipment/framework/Mail/SMTPMail.py
didacelgueta/equipment
1
12778540
<reponame>didacelgueta/equipment import mail1 from equipment.framework.Log.AbstractLog import AbstractLog from equipment.framework.Config.AbstractConfig import AbstractConfig from equipment.framework.Mail.AbstractMail import AbstractMail from typing import Union from equipment.framework.Mail.Email.Email import Email fr...
2.5625
3
rorolite/utils.py
anandology/rorolite
30
12778541
<filename>rorolite/utils.py import logging from fabric import io OutputLooper = io.OutputLooper class RoroliteOutputLooper(OutputLooper): """Replacement to OutputLooper of Fabric that doesn't print prefix in the output. """ def __init__(self, *args, **kwargs): OutputLooper.__init__(self, *args...
2.609375
3
house_robber_ii/solution.py
mahimadubey/leetcode-python
528
12778542
""" Note: This is an extension of House Robber. After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. This time, all houses at this place are arranged in a circle. That means the first house is the neighbor of the last one. Meanw...
3.8125
4
base.py
justicedundas/research-python
0
12778543
import datetime import time from urllib.parse import urlencode import requests from pandas import read_csv from geodataimport.compat import StringIO, binary_type, bytes_to_str from geodataimport.utils import RemoteDataError, _init_session, _sanitize_dates class _GeoData(object): """ Parameters ---------...
3.078125
3
add_user.py
phaughney22/insightCloudSec_Scripts
0
12778544
import requests import params base_url = params.url url = base_url+"v2/public/user/create" user_email_domain = params.email_domain # User Inputs first_name = input("Type user's first name: ") last_name = input("Type user's last name: ") # Create user creds from inputs full_name = first_name + " " + las...
3.015625
3
ckanext/datapusher/logic/auth.py
dassolkim/default-ckan
1
12778545
<reponame>dassolkim/default-ckan<filename>ckanext/datapusher/logic/auth.py # encoding: utf-8 import ckanext.datastore.logic.auth as auth import ckan.plugins as p def datapusher_submit(context, data_dict): return auth.datastore_auth(context, data_dict) def datapusher_status(context, data_dict): return auth.d...
1.507813
2
spyder_terminal/server/rest/__init__.py
mrclary/spyder-terminal
169
12778546
# -*- coding: utf-8 -*- """ rest module. ========= Provides: 1. Asynchronous execution of JSON services How to use the documentation ---------------------------- Documentation is available in one form: docstrings provided with the code Copyright (c) 2016, <NAME>. MIT, see LICENSE for more details. """ from . ...
1.625
2
Twitch.py
borgej/BrexBot
0
12778547
__author__ = "<NAME>, <NAME>" __copyright__ = "Copyright 2019, Brexit boy and SaLmon king" __credits__ = ["<NAME>, <NAME>"] __license__ = "Apache License" __version__ = "2.0" __maintainer__ = "<NAME>, <NAME>" __status__ = "Development" import logging from twitch.api import v3
1.039063
1
Ch02/kNN.py
uncarman2017/MLBeginner
0
12778548
''' Created on Sep 16, 2010 kNN: k Nearest Neighbors Input: inX: vector to compare to existing dataset (1xN) dataSet: size m data set of known vectors (NxM) labels: data set labels (1xM vector) k: number of neighbors to use for comparison (should be an odd number) Output: ...
3.546875
4
CQS/util/verification.py
avijitshee/cartan-quantum-synthesizer
5
12778549
<reponame>avijitshee/cartan-quantum-synthesizer<gh_stars>1-10 #import sys #sys.path.append('c:\\Users\\Thoma\\OneDrive\\Documents\\2021_ORNL\\CartanCodeGit\\cartan-quantum-synthesizer') # -*- coding: utf-8 -*- __docformat__ = 'google' """ A collection of functions useful for exact diagonalization and converting KHK dec...
2.84375
3
newrelic.py
devopstguru/aws-infra
3
12778550
#!/usr/bin/python from os import environ import requests import click import databag import base64 admin_key = environ.get("NEWRELIC_API_KEY") def create_synthetics_monitor(monitor_name, monitor_url, monitor_type="BROWSER", monitor_frequency=15): """ Source: https://docs.newrelic.com/docs/apis/synthetics-rest-api...
2.203125
2