text
stringlengths
0
1.05M
meta
dict
from flask import * import redis from serverglob import * from encryption import * import requests import time application = Flask(__name__) @application.route("/") def root(): rcon = redis.StrictRedis(db=1) up = rcon.hget("stats", "uptime").decode('utf-8') users = rcon.hget("stats", "users").decode('utf-...
{ "repo_name": "ccubed/AngelBot", "path": "Web/angelweb.py", "copies": "1", "size": "3971", "license": "mit", "hash": 7265628327503317000, "line_mean": 51.9466666667, "line_max": 267, "alpha_frac": 0.6330899018, "autogenerated": false, "ratio": 3.495598591549296, "config_test": false, "has_no_...
from flask import * import RPi.GPIO as GPIO import os pins = [2, 3, 4, 17, 22, 10, 9, 11, 7, 8, 25, 24, 23, 18, 14 ] app = Flask(__name__) GPIO.setmode(GPIO.BCM) def allapotok(): buffer = [] for i in pins: GPIO.setup(int(i), GPIO.IN) buffer.append('GPIO '+ str(i) +' allapota: '+str(GPIO.input(...
{ "repo_name": "webmaster442/prog-elektonikak", "path": "Kodok/Raspberry/22/server.py", "copies": "1", "size": "1208", "license": "bsd-2-clause", "hash": -6935505289343700000, "line_mean": 24.7234042553, "line_max": 86, "alpha_frac": 0.5612582781, "autogenerated": false, "ratio": 2.796296296296296...
from flask import * import sqlite3 import random import time from hacks.kookooverify.helper import * from hacks.kookooverify.config import * app = Blueprint('kookooverify', __name__, template_folder='templates') ''' DB Message status 0 = Unverified 1 = Verified 2 = Cancelled through API 3 = Cancelled due to too many ...
{ "repo_name": "rakshakhegde/KookooVerify", "path": "hacks/kookooverify/__init__.py", "copies": "1", "size": "6205", "license": "mit", "hash": 2410482803254345000, "line_mean": 47.1007751938, "line_max": 170, "alpha_frac": 0.5666398066, "autogenerated": false, "ratio": 3.909892879647133, "config...
from flask import * import threading import lcm import forseti2 as fs2 import sys sys.path.append('../src') import settings import util import time import datetime app = Flask(__name__) @app.route('/') def serve_console(): return render_template('judge_console.html') @app.route('/clock') def serve_clock(): r...
{ "repo_name": "mnuyens/forseti2", "path": "judge/judge_flask.py", "copies": "1", "size": "3931", "license": "apache-2.0", "hash": 5880385334470849000, "line_mean": 27.4855072464, "line_max": 124, "alpha_frac": 0.6090053422, "autogenerated": false, "ratio": 3.030840400925212, "config_test": fals...
from flask import * import threading import socket import queue app = Flask(__name__) messages = queue.Queue() @app.route('/thread') def start_thread(): threading.Thread(target=socket_handler).start() return "Thread Started" def socket_handler(): serversocket = socket.socket( socket.AF_INET, socket.S...
{ "repo_name": "Lily418/AssassinPhoneGameServer", "path": "index.py", "copies": "3", "size": "1818", "license": "mit", "hash": 7088528614527340000, "line_mean": 25.347826087, "line_max": 70, "alpha_frac": 0.601210121, "autogenerated": false, "ratio": 3.6506024096385543, "config_test": false, "...
from flask import * import yaml from yelpapi import YelpAPI from flickrapi import FlickrAPI import geocoder from zillow_hackathon.dataset import Neighborhood from venues import * import string from pprint import pprint import pickle from recommender import Recommender, NumFeaturizer, SpecFeaturizer, Data app = Flask(...
{ "repo_name": "Derikulous/zillow_hackathon", "path": "web.py", "copies": "1", "size": "6016", "license": "mit", "hash": -1962625512604472000, "line_mean": 35.0239520958, "line_max": 150, "alpha_frac": 0.6496010638, "autogenerated": false, "ratio": 3.2102454642475986, "config_test": false, "ha...
from flask import ( jsonify, current_app, json) from jsonschema import ValidationError from jwt.exceptions import DecodeError, ExpiredSignatureError from sqlalchemy.exc import DataError, IntegrityError from sqlalchemy.orm.exc import NoResultFound from flask_jwt_extended.exceptions import ( JWTDecodeErro...
{ "repo_name": "NewAcropolis/api", "path": "app/errors.py", "copies": "1", "size": "4678", "license": "mit", "hash": -2874392883223137300, "line_mean": 34.4393939394, "line_max": 104, "alpha_frac": 0.680632749, "autogenerated": false, "ratio": 4.1955156950672645, "config_test": false, "has_no_...
from flask import ( jsonify, request, render_template ) from flask_login import ( current_user, login_required ) from app.agency.api import agency_api_blueprint from app.agency.api.utils import ( get_active_users_as_choices, get_letter_templates, get_reasons ) from app.models import Agen...
{ "repo_name": "CityOfNewYork/NYCOpenRecords", "path": "app/agency/api/views.py", "copies": "1", "size": "8238", "license": "apache-2.0", "hash": -4267267767664336400, "line_mean": 43.0534759358, "line_max": 113, "alpha_frac": 0.6183539694, "autogenerated": false, "ratio": 3.880357983984927, "co...
from flask import ( jsonify, session, redirect, render_template, url_for, ) from flask_login import login_required from notifications_utils.recipients import format_phone_number_human_readable from notifications_utils.template import SMSPreviewTemplate from app.main import main from app.main.forms i...
{ "repo_name": "gov-cjwaszczuk/notifications-admin", "path": "app/main/views/conversation.py", "copies": "1", "size": "4488", "license": "mit", "hash": 8469462275579734000, "line_mean": 32, "line_max": 109, "alpha_frac": 0.6653297683, "autogenerated": false, "ratio": 3.964664310954064, "config_t...
from flask import ( Markup, abort, flash, redirect, render_template, request, session, url_for, ) from flask_login import current_user from app import login_manager from app.main import main from app.main.forms import LoginForm from app.models.user import InvitedUser, User from app.util...
{ "repo_name": "alphagov/notifications-admin", "path": "app/main/views/sign_in.py", "copies": "1", "size": "2822", "license": "mit", "hash": 7829317549040366000, "line_mean": 32.5952380952, "line_max": 108, "alpha_frac": 0.5903614458, "autogenerated": false, "ratio": 3.941340782122905, "config_t...
from flask import ( Markup, abort, flash, redirect, render_template, request, url_for, ) from flask_login import current_user from app import ( api_key_api_client, current_service, notification_api_client, service_api_client, ) from app.formatters import email_safe from app....
{ "repo_name": "alphagov/notifications-admin", "path": "app/main/views/api_keys.py", "copies": "1", "size": "10684", "license": "mit", "hash": -6677587956030733000, "line_mean": 35.7862068966, "line_max": 116, "alpha_frac": 0.6228908886, "autogenerated": false, "ratio": 3.7067407922168174, "conf...
from flask import * class ControllerGeneric(object): @staticmethod def viewTest(): # render a view return render_template('GENERIC/CRUD.html'); @staticmethod def viewCreate(): # render a view return render_template('GENERIC/create.html'); @staticmethod def viewRead(): # render a view return rende...
{ "repo_name": "alanjames1987/How-to-Organize-Micro-Framework-Projects", "path": "Flask/controller/GENERIC.py", "copies": "1", "size": "1349", "license": "mit", "hash": 2785096313731921400, "line_mean": 16.75, "line_max": 49, "alpha_frac": 0.6812453669, "autogenerated": false, "ratio": 3.3725, "...
from flask import * from core import validation from models import messages, rooms, users def route(app, config): assert app is not None @app.route('/room/<roomID>/', methods=['GET']) def roomPage(roomID): """ Show the room page """ if not validation.validSession(session, doRaise=False)...
{ "repo_name": "MatthewJWalls/Spiel", "path": "Spiel/handlers/rooms.py", "copies": "1", "size": "2478", "license": "apache-2.0", "hash": 3980676122893426000, "line_mean": 29.2195121951, "line_max": 89, "alpha_frac": 0.5738498789, "autogenerated": false, "ratio": 3.9903381642512077, "config_test"...
from flask import * from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.assets import Environment, Bundle from htmlmin import minify from flask.ext.login import LoginManager,login_user,logout_user, current_user, login_required from flask_wtf import Form from wtforms import StringField, PasswordField from wtform...
{ "repo_name": "BenDoan/fhb", "path": "server.py", "copies": "1", "size": "4688", "license": "mit", "hash": 3784781068690771500, "line_mean": 31.5555555556, "line_max": 158, "alpha_frac": 0.6574232082, "autogenerated": false, "ratio": 3.55420773313116, "config_test": false, "has_no_keywords": ...
from flask import * from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.assets import Environment, Bundle from htmlmin import minify from flask.ext.login import LoginManager,login_user,logout_user, current_user, login_required from flask_wtf import Form from wtforms import StringField, PasswordField from wtfor...
{ "repo_name": "analogbit/urban-colonization", "path": "server.py", "copies": "2", "size": "7481", "license": "mit", "hash": 4872849227365714000, "line_mean": 32.850678733, "line_max": 180, "alpha_frac": 0.6582007753, "autogenerated": false, "ratio": 3.5522317188983856, "config_test": false, "...
from flask import * from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy import or_ from flask.ext.assets import Environment, Bundle from htmlmin import minify from flask.ext.login import LoginManager,login_user,logout_user, current_user, login_required from flask_wtf import Form from wtforms import StringField...
{ "repo_name": "BenDoan/SPA", "path": "server.py", "copies": "1", "size": "13692", "license": "mit", "hash": 4630626229153525000, "line_mean": 35.6096256684, "line_max": 132, "alpha_frac": 0.6612620508, "autogenerated": false, "ratio": 3.9515151515151516, "config_test": false, "has_no_keywords...
from flask import * from flask.ext.sqlalchemy import SQLAlchemy from validations import * from strategies import * from helpers import * from failovers import * import os basedir = os.path.abspath(os.path.dirname(__file__)) db_path = 'sqlite:///' + os.path.join(basedir, 'app.db') app = Flask(__name__) app.conf...
{ "repo_name": "andlogic/email_failover", "path": "app.py", "copies": "1", "size": "3680", "license": "mit", "hash": 1345300231604695800, "line_mean": 31.5663716814, "line_max": 155, "alpha_frac": 0.6331521739, "autogenerated": false, "ratio": 3.2974910394265233, "config_test": false, "has_no_...
from flask import * import collect_hs import collections import nltk import numpy from sklearn.feature_extraction.text import CountVectorizer from sklearn.decomposition import LatentDirichletAllocation app = Flask(__name__) ## common constructs stem = nltk.stem.snowball.SnowballStemmer('finnish') stopwords = map...
{ "repo_name": "matnel/hs-comments-visu", "path": "app/main.py", "copies": "1", "size": "2374", "license": "mit", "hash": 7678775080818856000, "line_mean": 21.6095238095, "line_max": 95, "alpha_frac": 0.5770850885, "autogenerated": false, "ratio": 3.762282091917591, "config_test": false, "has_...
from flask import * # NB: Order is important from models import * from schemas import * from graph import SyllabusGraph import json import urllib from collections import Counter def svg_response(svg): return Response(svg, mimetype='image/svg+xml') def addCategoryNodes(g, topics): category_topics = {} ...
{ "repo_name": "UoMCS/syllabus-visualisation", "path": "server/api.py", "copies": "1", "size": "8309", "license": "mit", "hash": -2604438916198948000, "line_mean": 28.8884892086, "line_max": 98, "alpha_frac": 0.6408713443, "autogenerated": false, "ratio": 3.384521384928717, "config_test": false,...
from flask import * import unittest import sys import json sys.path.insert(0, '../') from app import * class TestApp(unittest.TestCase): def setUp(self): TESTING = True WTF_CSRF_ENABLED = False SQLALCHEMY_DATABASE_URI = 'sqlite:///:memory:' self.app = app.test_client() self.headers =...
{ "repo_name": "andlogic/email_failover", "path": "tests/test_app.py", "copies": "1", "size": "1307", "license": "mit", "hash": 8946571717285974000, "line_mean": 25.6734693878, "line_max": 95, "alpha_frac": 0.5830145371, "autogenerated": false, "ratio": 3.522911051212938, "config_test": true, ...
from flask import * try: import git ## for versions repo = git.Repo("../") __version = str( repo.head.commit ) except: __version = 'no-version' app = Flask(__name__) @app.route("/") def index(): return send_from_directory( 'static' , 'index.html' ) ## NEVER USE FOR REAL ANALYSIS, A TOY EXAMPLE...
{ "repo_name": "HIIT/deliberation-classifier", "path": "app/main.py", "copies": "1", "size": "1025", "license": "mit", "hash": 3375902833051198000, "line_mean": 20.8085106383, "line_max": 72, "alpha_frac": 0.5697560976, "autogenerated": false, "ratio": 3.360655737704918, "config_test": false, ...
from flask import ( redirect, url_for, request, render_template, current_app, ) import urllib.parse import requests from ..local import core def make(app, admin): @admin.route('/baidupcs') def baidupcs(): return redirect('?'.join([ 'https://openapi.baidu.com/oauth/2.0/...
{ "repo_name": "Answeror/aip", "path": "aip/admin/views.py", "copies": "1", "size": "2311", "license": "mit", "hash": 1847200422029904400, "line_mean": 29.8133333333, "line_max": 79, "alpha_frac": 0.4742535699, "autogenerated": false, "ratio": 4.194192377495463, "config_test": false, "has_no_k...
from flask import ( redirect, url_for, session, flash, render_template, abort, current_app ) from itsdangerous import SignatureExpired from markupsafe import Markup from notifications_utils.url_safe_token import check_token from flask_login import current_user from app.main import main from...
{ "repo_name": "gov-cjwaszczuk/notifications-admin", "path": "app/main/views/invites.py", "copies": "1", "size": "3701", "license": "mit", "hash": -5030374785463501000, "line_mean": 40.1, "line_max": 114, "alpha_frac": 0.6180048662, "autogenerated": false, "ratio": 3.9101479915433406, "config_te...
from flask import ( redirect, url_for, request, current_app, render_template_string, abort ) from flask.globals import _app_ctx_stack, _request_ctx_stack from werkzeug.urls import url_parse from quokka.core.templates import render_template def dispatch_aliases(): """ When ALIASES_ENABLED == True This...
{ "repo_name": "chansource/brother", "path": "quokka/utils/aliases.py", "copies": "2", "size": "3495", "license": "mit", "hash": -6353269073486286000, "line_mean": 35.7894736842, "line_max": 79, "alpha_frac": 0.5596566524, "autogenerated": false, "ratio": 4.3632958801498125, "config_test": false...
from flask import ( redirect, url_for, request, current_app, render_template_string, abort, render_template ) from flask.globals import _app_ctx_stack, _request_ctx_stack from werkzeug.urls import url_parse def dispatch_aliases(): """ When ALIASES_ENABLED == True This method handle 3 Lingobarter feat...
{ "repo_name": "LeightonStreet/LeightonStreet", "path": "lingobarter/utils/aliases.py", "copies": "2", "size": "3464", "license": "apache-2.0", "hash": -8457815271731415000, "line_mean": 35.8510638298, "line_max": 91, "alpha_frac": 0.5568706697, "autogenerated": false, "ratio": 4.3682219419924335,...
from flask import ( render_template, redirect, request, url_for, flash, ) from flask_admin.contrib.sqla import ModelView from flask_login import login_user, logout_user, login_required, current_user from ..extensions import db from labsys.utils.email import send_email from . import blueprint from ....
{ "repo_name": "gems-uff/labsys", "path": "labsys/auth/views.py", "copies": "1", "size": "3594", "license": "mit", "hash": -7059958382588620000, "line_mean": 30.9910714286, "line_max": 79, "alpha_frac": 0.6567122523, "autogenerated": false, "ratio": 3.72840790842872, "config_test": false, "has...
from flask import ( render_template, redirect, request, url_for, session, flash, abort, ) from flask_login import ( login_required, current_user ) from notifications_utils.field import Field from notifications_utils.clients import DeskproError from notifications_python_client.error...
{ "repo_name": "gov-cjwaszczuk/notifications-admin", "path": "app/main/views/service_settings.py", "copies": "1", "size": "30799", "license": "mit", "hash": 9007236818800528000, "line_mean": 38.4782051282, "line_max": 119, "alpha_frac": 0.673627123, "autogenerated": false, "ratio": 3.6462995855535...
from flask import ( render_template, redirect, session, url_for, current_app ) from flask_login import ( current_user, login_required ) from notifications_python_client.errors import HTTPError from werkzeug.exceptions import abort from app.main import main from app.main.forms import Create...
{ "repo_name": "gov-cjwaszczuk/notifications-admin", "path": "app/main/views/add_service.py", "copies": "1", "size": "3626", "license": "mit", "hash": -413375813301628300, "line_mean": 30.7894736842, "line_max": 111, "alpha_frac": 0.6484547461, "autogenerated": false, "ratio": 3.6203796203796204, ...
from flask import ( render_template, redirect, session, url_for ) from app import user_api_client from app.main import main from app.main.forms import TextNotReceivedForm from app.utils import redirect_to_sign_in @main.route('/resend-email-verification') @redirect_to_sign_in def resend_email_verifica...
{ "repo_name": "gov-cjwaszczuk/notifications-admin", "path": "app/main/views/code_not_received.py", "copies": "1", "size": "2231", "license": "mit", "hash": 3285801212878322000, "line_mean": 34.9838709677, "line_max": 102, "alpha_frac": 0.7055132228, "autogenerated": false, "ratio": 3.310089020771...
from flask import ( render_template, redirect, url_for, session, flash, request, abort, Markup ) from flask_login import ( current_user, ) from app import ( login_manager, user_api_client, invite_api_client ) from app.main import main from app.main.forms import LoginF...
{ "repo_name": "gov-cjwaszczuk/notifications-admin", "path": "app/main/views/sign_in.py", "copies": "1", "size": "3124", "license": "mit", "hash": -8057375051620350000, "line_mean": 28.7523809524, "line_max": 108, "alpha_frac": 0.6017925736, "autogenerated": false, "ratio": 3.607390300230947, "c...
from flask import ( render_template, request, redirect, session, url_for, Blueprint, make_response, ) from models.user import User from utils import log main = Blueprint('index', __name__) def current_user(): uid = session.get('user_id', -1) u = User.find_by(id=uid) return u ...
{ "repo_name": "chidaobanjiu/MANA2077", "path": "routes/index.py", "copies": "3", "size": "1457", "license": "mit", "hash": 768798184285233500, "line_mean": 19.7285714286, "line_max": 56, "alpha_frac": 0.5968297726, "autogenerated": false, "ratio": 3.3279816513761467, "config_test": false, "ha...
from flask import ( render_template, request, redirect, url_for, Blueprint, abort, ) # 一次性引入多个 flask 里面的名字 # 注意最后一个后面也应该加上逗号 # 这样的好处是方便和一致性 from routes import current_user from models.category import Category from models.blog import Blog import os from werkzeug.utils import secure_filename fro...
{ "repo_name": "chidaobanjiu/Loocat.cc", "path": "routes/admin.py", "copies": "3", "size": "4055", "license": "mit", "hash": 3434353864675266600, "line_mean": 23.5555555556, "line_max": 106, "alpha_frac": 0.6117676641, "autogenerated": false, "ratio": 3.1563492063492062, "config_test": false, ...
from flask import ( render_template, url_for ) from flask_login import login_required from werkzeug.utils import redirect from app.main import main from app.main.forms import ProviderForm from app.utils import user_has_permissions from app import provider_client @main.route("/providers") @login_required @use...
{ "repo_name": "gov-cjwaszczuk/notifications-admin", "path": "app/main/views/providers.py", "copies": "1", "size": "2000", "license": "mit", "hash": -8252079043365465000, "line_mean": 35.3636363636, "line_max": 95, "alpha_frac": 0.7175, "autogenerated": false, "ratio": 3.795066413662239, "config...
from flask import ( render_template, redirect, make_response, request) from flask.ext.appbuilder.models.sqla.interface import SQLAInterface from flask.ext.appbuilder import ModelView from flask.ext.appbuilder.baseviews import expose_api from flask.ext.appbuilder.actions import action from app import appbuilder, db ...
{ "repo_name": "sintax1/beaconlp", "path": "app/views.py", "copies": "1", "size": "12575", "license": "mit", "hash": 4144239846888361500, "line_mean": 35.3439306358, "line_max": 78, "alpha_frac": 0.6003180915, "autogenerated": false, "ratio": 4.006052883083784, "config_test": false, "has_no_ke...
from flask import ( render_template, redirect, url_for, abort, flash, request, current_app, make_response) from flask_login import login_required, current_user from flask_sqlalchemy import get_debug_queries from . import main from .forms import EditProfileAdminForm, ClassifyForm from .. import db from ..models ...
{ "repo_name": "ukgovdatascience/classifyintentsapp", "path": "app/main/views.py", "copies": "1", "size": "6644", "license": "mit", "hash": 5504727739008038000, "line_mean": 30.1924882629, "line_max": 78, "alpha_frac": 0.6333534016, "autogenerated": false, "ratio": 3.6505494505494505, "config_te...
from flask import ( render_template, request, send_from_directory, make_response, g) import flask import os import logging import uuid from ..app import bokeh_app from .. import wsmanager from ..models import convenience from ..models import docs from ... import protocol from .bbauth import (check_read_...
{ "repo_name": "sahat/bokeh", "path": "bokeh/server/views/backbone.py", "copies": "1", "size": "8907", "license": "bsd-3-clause", "hash": 6556847167119423000, "line_mean": 39.3031674208, "line_max": 90, "alpha_frac": 0.6780060626, "autogenerated": false, "ratio": 3.4617178390983288, "config_test...
from flask import ( request, jsonify ) from flask_login import current_user from app.agency import agency from app.agency.utils import ( update_agency_active_status, get_agency_features, get_agency_feature ) from app.constants.agency_features import AGENCY_FEATURES # TODO: Manage agency features w...
{ "repo_name": "CityOfNewYork/NYCOpenRecords", "path": "app/agency/views.py", "copies": "1", "size": "2072", "license": "apache-2.0", "hash": 8784050502124928000, "line_mean": 27, "line_max": 105, "alpha_frac": 0.6718146718, "autogenerated": false, "ratio": 3.654320987654321, "config_test": fals...
from flask import ( request, render_template, jsonify, Response, url_for, current_app, send_file, redirect, abort) from sqlalchemy.engine.reflection import Inspector import io, os, glob, json, datetime from src.main import db from src.pdfhook import ( blueprint, serializers, models ) from src.pdfpar...
{ "repo_name": "codeforamerica/pdfhook", "path": "src/pdfhook/views.py", "copies": "1", "size": "4279", "license": "mit", "hash": 8536352477623407000, "line_mean": 32.1705426357, "line_max": 84, "alpha_frac": 0.6583313858, "autogenerated": false, "ratio": 3.4314354450681637, "config_test": false...
from flask import ( request, render_template, jsonify, Response, url_for, current_app, send_file, redirect) from sqlalchemy.engine.reflection import Inspector import io, os, glob, json, datetime from src.main import db from src.pdfhook import ( blueprint, serializers, models ) from src.pdftk_wrapper...
{ "repo_name": "gauravmk/pdfhook", "path": "src/pdfhook/views.py", "copies": "1", "size": "3918", "license": "mit", "hash": -3712331062247125500, "line_mean": 31.1147540984, "line_max": 84, "alpha_frac": 0.6559469117, "autogenerated": false, "ratio": 3.4158674803836093, "config_test": false, "...
from flask import ( request, render_template, redirect, session, flash, url_for) from SteamScout import app, db, login_manager, flask_bcrypt from SteamScout.forms import LoginForm, SignUpForm, AmountPref, GamesSearch, ContactForm from SteamScout.models import Games, Preferences, User from SteamScout.helpers imp...
{ "repo_name": "ChanChar/SteamScout", "path": "SteamScout/views.py", "copies": "1", "size": "7188", "license": "mit", "hash": -4372267712996505600, "line_mean": 37.4385026738, "line_max": 102, "alpha_frac": 0.6449638286, "autogenerated": false, "ratio": 3.659877800407332, "config_test": false, ...
from flask import ( request, session, redirect, url_for, abort, render_template, flash, g ) from flask_themes import render_theme_template, get_theme, get_themes_list from mead import app from mead.plugins.content.models.page import Page from .available import defaults from mead.plugins.admin.models ...
{ "repo_name": "kennethreitz-archive/mead", "path": "mead/plugins/content/views/content.py", "copies": "1", "size": "1126", "license": "isc", "hash": 5741470876889316000, "line_mean": 25.1860465116, "line_max": 74, "alpha_frac": 0.690053286, "autogenerated": false, "ratio": 3.254335260115607, "c...
from flask import ( Response, request, ) import requests from config import PROXY_HOST, PROXY_URL response_blacklist = ( 'accept-ranges', 'connection', 'content-encoding', 'content-length', 'expires', 'set-cookie', 'transfer-encoding', ) request_blacklist = ('content-length', 'hos...
{ "repo_name": "lunixbochs/microlathe", "path": "src/proxy.py", "copies": "1", "size": "1900", "license": "mit", "hash": 758311055252473300, "line_mean": 22.1707317073, "line_max": 71, "alpha_frac": 0.6005263158, "autogenerated": false, "ratio": 3.632887189292543, "config_test": false, "has_no...
from flask import ( session, render_template, redirect, request, url_for, current_app, jsonify ) from ..util import send_file from . import youtube_service from .view_decorators import login_required, logout_required from oauth2client import client from . import models from .models import ( YOUTUBE_CLIENT_I...
{ "repo_name": "nvlbg/gepify", "path": "gepify/services/youtube/views.py", "copies": "1", "size": "7960", "license": "mit", "hash": -360313821371318460, "line_mean": 32.4453781513, "line_max": 78, "alpha_frac": 0.6359296482, "autogenerated": false, "ratio": 4.100978876867594, "config_test": fals...
from flask import redirect, abort import SPI.utils import config from SPI.modules.base_spi import BaseSPI from aws.awsutils import get_or_create_bucket from models import Channel import hashlib class AWSSPI(BaseSPI): """ Implements BaseSPI for AWS CloudFront integration. On event will upload/delete the SI/PI...
{ "repo_name": "ebu/radiodns-plugit", "path": "RadioDns-PlugIt/SPI/modules/aws_spi.py", "copies": "1", "size": "9117", "license": "bsd-3-clause", "hash": -5308077420659644000, "line_mean": 47.2380952381, "line_max": 124, "alpha_frac": 0.5582976856, "autogenerated": false, "ratio": 4.11974694984184...
from flask import redirect, flash from flask.ext.appbuilder.models.sqla.interface import SQLAInterface from flask.ext.appbuilder import ModelView from flask.ext.appbuilder.actions import action from models import Job from app import appbuilder, db """ Create your Views:: class MyModelView(ModelView): ...
{ "repo_name": "rpiotti/Flask-AppBuilder", "path": "examples/issue_188/app/views.py", "copies": "3", "size": "1731", "license": "bsd-3-clause", "hash": -1709649777350223600, "line_mean": 30.4727272727, "line_max": 125, "alpha_frac": 0.6112073946, "autogenerated": false, "ratio": 3.7066381156316917...
from flask import redirect, flash, session, g, url_for, request, make_response from application import app, authomatic, db from authomatic.adapters import WerkzeugAdapter from authomatic.exceptions import FailureError, ConfigError from application.helpers import is_safe_url, credentials, is_valid_credentials @app.rou...
{ "repo_name": "pawl/CalendarAdmin", "path": "application/views/subaccount_login.py", "copies": "1", "size": "4001", "license": "mit", "hash": -8804025862261185000, "line_mean": 56.9855072464, "line_max": 195, "alpha_frac": 0.5776055986, "autogenerated": false, "ratio": 4.495505617977528, "confi...
from flask import redirect, flash, session, g, url_for, request, make_response from flask.ext.login import login_user from application import app, authomatic, db from authomatic.adapters import WerkzeugAdapter from authomatic.exceptions import FailureError from sqlalchemy.orm.exc import NoResultFound from application.h...
{ "repo_name": "pawl/CalendarAdmin", "path": "application/views/login.py", "copies": "1", "size": "2275", "license": "mit", "hash": -7913513081678947000, "line_mean": 44.5, "line_max": 153, "alpha_frac": 0.6738461538, "autogenerated": false, "ratio": 4.252336448598131, "config_test": false, "h...
from flask import redirect, flash, session, g, url_for, request from application import app, db from application.helpers import is_valid_credentials @app.route('/subaccount_logout/<provider_name>/', methods=['GET', 'POST']) def subaccount_logout(provider_name): if g.user and is_valid_credentials(): if get...
{ "repo_name": "pawl/CalendarAdmin", "path": "application/views/subaccount_logout.py", "copies": "1", "size": "1055", "license": "mit", "hash": 4304621866747692500, "line_mean": 46.9545454545, "line_max": 100, "alpha_frac": 0.6360189573, "autogenerated": false, "ratio": 3.996212121212121, "confi...
from flask import redirect, g from flask_appbuilder import expose from flask_appbuilder.models.sqla.interface import SQLAInterface from flask_babel import gettext as __ from flask_babel import lazy_gettext as _ from superset import appbuilder from superset.models.sql_lab import Query, SavedQuery from .base import Su...
{ "repo_name": "lina9527/easybi", "path": "views/sql_lab.py", "copies": "1", "size": "2576", "license": "mit", "hash": 7582571055575394000, "line_mean": 27.6222222222, "line_max": 75, "alpha_frac": 0.613742236, "autogenerated": false, "ratio": 3.592747559274756, "config_test": false, "has_no_k...
from flask import redirect, g from flask_appbuilder import expose from flask_appbuilder.models.sqla.interface import SQLAInterface from flask_babel import gettext as __ from superset import appbuilder from superset.models.sql_lab import Query, SavedQuery from .base import SupersetModelView, BaseSupersetView, DeleteM...
{ "repo_name": "robert-digit/superset", "path": "superset/views/sql_lab.py", "copies": "5", "size": "1992", "license": "apache-2.0", "hash": 7858328581460943000, "line_mean": 27.4571428571, "line_max": 75, "alpha_frac": 0.6596385542, "autogenerated": false, "ratio": 3.43448275862069, "config_tes...
from flask import redirect from flask_admin import Admin, AdminIndexView, expose from flask_admin.menu import url_for from flask_login import current_user from plenario.database import postgres_session from plenario.models.SensorNetwork import FeatureMeta, NetworkMeta, NodeMeta, SensorMeta from .admin_views import adm...
{ "repo_name": "UrbanCCD-UChicago/plenario", "path": "plenario/apiary/blueprints.py", "copies": "1", "size": "1238", "license": "mit", "hash": 2675173008800001500, "line_mean": 29.95, "line_max": 88, "alpha_frac": 0.7245557351, "autogenerated": false, "ratio": 3.7177177177177176, "config_test": ...
from flask import redirect from flask_appbuilder import ModelView from flask_appbuilder.models.sqla.interface import SQLAInterface from flask_appbuilder.actions import action from app import appbuilder from .models import ContactGroup class GroupModelView(ModelView): datamodel = SQLAInterface(ContactGroup) l...
{ "repo_name": "dpgaspar/Flask-AppBuilder", "path": "examples/quickactions/app/views.py", "copies": "1", "size": "1067", "license": "bsd-3-clause", "hash": -6599807653492442000, "line_mean": 26.358974359, "line_max": 88, "alpha_frac": 0.6579194002, "autogenerated": false, "ratio": 3.90842490842490...
from flask import redirect from flask import render_template from flask import url_for from flask_login import current_user from flask_login import login_user from flask_login import logout_user from werkzeug.exceptions import Unauthorized from config import TRACKER_PASSWORD_LENGTH_MAX from config import TRACKER_PASSW...
{ "repo_name": "jelly/arch-security-tracker", "path": "tracker/view/login.py", "copies": "3", "size": "1569", "license": "mit", "hash": -2254303077505628000, "line_mean": 33.1086956522, "line_max": 97, "alpha_frac": 0.6564690886, "autogenerated": false, "ratio": 4.217741935483871, "config_test":...
from flask import redirect from flask import render_template from flask_login import current_user, login_user, logout_user from eat.forms.auth import SignIn, SignUp from eat.models.user import User def register_routes(app): @app.route('/login', methods=['GET', 'POST']) @app.route('/signin', methods=['GET', '...
{ "repo_name": "Lunchable/eat", "path": "src/eat/views/auth.py", "copies": "1", "size": "1302", "license": "mit", "hash": 6185867506718596000, "line_mean": 27.9555555556, "line_max": 63, "alpha_frac": 0.5844854071, "autogenerated": false, "ratio": 4.05607476635514, "config_test": false, "has_n...
from flask import redirect from flask import url_for from flask import render_template from flask import Blueprint from wordbook.domain.repo.cardlist import CardlistRepo from wordbook.forms.cardlist import CardlistForm manage = Blueprint('manage', __name__, url_prefix='/manage') @manage.route('/') def index(): r...
{ "repo_name": "lizardschool/wordbook", "path": "wordbook/flaskapp/manage_views.py", "copies": "1", "size": "1232", "license": "mit", "hash": -6561524083881030000, "line_mean": 25.7826086957, "line_max": 73, "alpha_frac": 0.6810064935, "autogenerated": false, "ratio": 3.623529411764706, "config_...
from flask import redirect from flask import url_for from flask_login import current_user from functools import wraps, partial def is_logged_in(is_admin=False): """用户是否登录""" logged_in = current_user.is_authenticated == True and \ current_user.is_active == True if is_admin: logg...
{ "repo_name": "lambda47/LightBlog", "path": "app/lib/auth.py", "copies": "1", "size": "1379", "license": "apache-2.0", "hash": 7996026388303687000, "line_mean": 28.7391304348, "line_max": 69, "alpha_frac": 0.5544989027, "autogenerated": false, "ratio": 4.044378698224852, "config_test": false, ...
from flask import redirect from flask_views.base import TemplateResponseMixin, View from flask_views.db.mongoengine.detail import BaseDetailView, SingleObjectMixin from flask_views.edit import FormMixin, ProcessFormMixin class ModelFormMixin(FormMixin, SingleObjectMixin): """ Mixin for handling model-form pr...
{ "repo_name": "brocaar/flask-views", "path": "flask_views/db/mongoengine/edit.py", "copies": "1", "size": "7485", "license": "bsd-3-clause", "hash": -7946632745048547000, "line_mean": 26.0216606498, "line_max": 79, "alpha_frac": 0.6200400802, "autogenerated": false, "ratio": 4.402941176470589, ...
from flask import redirect from framework.auth import cas from framework.auth import decorators from framework.auth import views as auth_views from website.util import web_url_for def connected_tools(): return _landing_page(title='Connected Tools', content_path='/public/pages/help/addon...
{ "repo_name": "KAsante95/osf.io", "path": "website/landing_pages.py", "copies": "17", "size": "1101", "license": "apache-2.0", "hash": 5292260449269932000, "line_mean": 31.3823529412, "line_max": 81, "alpha_frac": 0.6412352407, "autogenerated": false, "ratio": 3.783505154639175, "config_test": ...
from flask import redirect from framework.auth import cas from framework.auth import views as auth_views from framework.auth.decorators import collect_auth from website.util import web_url_for def connected_tools(): return _landing_page(title='Connected Tools', content_path='/public/pag...
{ "repo_name": "caseyrygt/osf.io", "path": "website/landing_pages.py", "copies": "25", "size": "1103", "license": "apache-2.0", "hash": 2507680899471765500, "line_mean": 31.4411764706, "line_max": 81, "alpha_frac": 0.6409791478, "autogenerated": false, "ratio": 3.7645051194539247, "config_test":...
from flask import redirect, render_template, abort, request, url_for from flask_user import current_user, login_required from flask_babel import format_date from flask.helpers import safe_join, send_from_directory from models.meta import Campaign from bootstrap import app, db from config import GEOTAGS_API_PREFIX impor...
{ "repo_name": "mapkiwiz/geotags", "path": "geotags-api/controllers/main.py", "copies": "1", "size": "3026", "license": "mit", "hash": 7814971870472048000, "line_mean": 25.0948275862, "line_max": 102, "alpha_frac": 0.6949768672, "autogenerated": false, "ratio": 2.895693779904306, "config_test": ...
from flask import redirect, render_template, abort, url_for, Response from werkzeug.http import http_date from uchan import app from uchan.lib import validation from uchan.lib.model import BoardConfigModel, BoardModel, CatalogModel from uchan.lib.moderator_request import get_authed, request_moderator from uchan.lib.se...
{ "repo_name": "Floens/uchan", "path": "uchan/view/thread.py", "copies": "1", "size": "4095", "license": "mit", "hash": -6236197587666529000, "line_mean": 33.4117647059, "line_max": 111, "alpha_frac": 0.6446886447, "autogenerated": false, "ratio": 3.7261146496815285, "config_test": true, "has_...
from flask import redirect, render_template, Blueprint from flask import request, url_for, abort from flask_user import current_user, login_required from app import app, db from app.core.forms import CollectionForm from app.models.collections import Collection from app.models.users import User from app.initializers.se...
{ "repo_name": "UCL-CS35/incdb-poc", "path": "app/controllers/contribute.py", "copies": "1", "size": "6358", "license": "bsd-2-clause", "hash": 3929432384666297000, "line_mean": 30.4752475248, "line_max": 78, "alpha_frac": 0.636992765, "autogenerated": false, "ratio": 4.060025542784164, "config_...
from flask import redirect, render_template, Blueprint from flask import request, url_for from flask_user import current_user, login_required from app import app, db from app.core.forms import UserProfileForm from app.models.collections import Collection from app.models import * from app.initializers import mycelery ...
{ "repo_name": "UCL-CS35/incdb-poc", "path": "app/controllers/user.py", "copies": "1", "size": "2453", "license": "bsd-2-clause", "hash": 7546113504299995000, "line_mean": 30.4487179487, "line_max": 91, "alpha_frac": 0.7130044843, "autogenerated": false, "ratio": 3.995114006514658, "config_test"...
from flask import redirect, render_template, flash, g, session, url_for, request, jsonify from flask.ext.login import current_user, login_required from . import main from .forms import TodoForm from .. import db from ..models import User, Todo from collections import Counter @main.app_errorhandler(404) def page_not_f...
{ "repo_name": "harshays/prioritize", "path": "app/main/views.py", "copies": "1", "size": "2746", "license": "mit", "hash": -2153968819876845000, "line_mean": 35.1315789474, "line_max": 140, "alpha_frac": 0.6573197378, "autogenerated": false, "ratio": 3.1930232558139533, "config_test": false, ...
from flask import redirect, render_template from flask.views import MethodView from werkzeug.exceptions import Gone from .exceptions import ImproperlyConfigured class BaseView(MethodView): methods = ["GET", "POST", "PUT", "DELETE", "HEAD", "OPTIONS", "TRACE"] class TemplateResponseMixin(object): template_n...
{ "repo_name": "gsiegman/flask-generic-cbvs", "path": "flask_generic_cbvs/base.py", "copies": "1", "size": "1579", "license": "mit", "hash": 2653472870069994000, "line_mean": 25.3333333333, "line_max": 81, "alpha_frac": 0.607979734, "autogenerated": false, "ratio": 4.473087818696884, "config_tes...
from flask import redirect, render_template, render_template_string, Blueprint from flask import request, url_for, flash, Response, jsonify import time from app.utils import tag from app.init_app import app import random from celery import Celery celery = Celery(app.import_name, backend='redis://localhost:6379/0', ...
{ "repo_name": "iRapha/search_within_videos", "path": "app/views.py", "copies": "1", "size": "2395", "license": "mit", "hash": -3200384098226487300, "line_mean": 29.3164556962, "line_max": 84, "alpha_frac": 0.5778705637, "autogenerated": false, "ratio": 3.6789554531490016, "config_test": false, ...
from flask import redirect, render_template, request from jinja2 import Markup from zeus import auth from zeus.constants import Result from zeus.models import Build from zeus.notifications.email import build_message class MailPreview(object): def __init__(self, msg): self.msg = msg @property def...
{ "repo_name": "getsentry/zeus", "path": "zeus/web/debug/notification.py", "copies": "1", "size": "1086", "license": "apache-2.0", "hash": -3894796871534743600, "line_mean": 23.1333333333, "line_max": 87, "alpha_frac": 0.6445672192, "autogenerated": false, "ratio": 3.851063829787234, "config_tes...
from flask import redirect, render_template, request from rewot import app import rewot.id from rewot.log import Log @app.route("/") def index(): return render_template("index.html") @app.route("/+<replayid>", methods=["GET"]) def replay(replayid): return render_template("replay.html", replayid=replayid) @app....
{ "repo_name": "wutmod/rewot", "path": "rewot/views.py", "copies": "1", "size": "1470", "license": "mit", "hash": 3227921502381143000, "line_mean": 27.2692307692, "line_max": 131, "alpha_frac": 0.6523809524, "autogenerated": false, "ratio": 2.854368932038835, "config_test": false, "has_no_keyw...
from flask import redirect, render_template, request, \ url_for, Blueprint, jsonify, session, Response from project import utils, database_wrapper from project.services.auth import Auth from flask.ext.api import FlaskAPI, exceptions from flask.ext.api.status import * from models import user from bson.objectid impor...
{ "repo_name": "AustinStoneProjects/Founderati-Server", "path": "project/api/users.py", "copies": "1", "size": "6880", "license": "apache-2.0", "hash": -8368375734196529000, "line_mean": 29.8520179372, "line_max": 111, "alpha_frac": 0.642005814, "autogenerated": false, "ratio": 3.6989247311827955,...
from flask import redirect, render_template, request, session from flask_jsontools import jsonapi from app import app from app.facts import Factoid from app.lastfm import LastFm from app.manager import create_history, get_match, get_recent_history, get_song, parseId3Tags, \ scanDirectory, setAlbumArtist, setAlbumN...
{ "repo_name": "Tjorriemorrie/speler", "path": "app/views.py", "copies": "1", "size": "5906", "license": "mit", "hash": -1436587774945202400, "line_mean": 28.3830845771, "line_max": 96, "alpha_frac": 0.5751777853, "autogenerated": false, "ratio": 3.661500309981401, "config_test": false, "has_n...
from flask import redirect, render_template, request, session, url_for from flask_login import login_required from app import letter_jobs_client from app.main import main from app.utils import user_has_permissions @main.route("/letter-jobs", methods=['GET', 'POST']) @login_required @user_has_permissions(admin_overri...
{ "repo_name": "gov-cjwaszczuk/notifications-admin", "path": "app/main/views/letter_jobs.py", "copies": "1", "size": "1170", "license": "mit", "hash": -3409077577852375000, "line_mean": 31.5, "line_max": 100, "alpha_frac": 0.6316239316, "autogenerated": false, "ratio": 3.5240963855421685, "confi...
from flask import redirect, render_template, request, session, url_for from app import user_api_client from app.main import main from app.main.forms import TextNotReceivedForm from app.models.user import User from app.utils.login import redirect_to_sign_in @main.route('/resend-email-verification') @redirect_to_sign_...
{ "repo_name": "alphagov/notifications-admin", "path": "app/main/views/code_not_received.py", "copies": "1", "size": "2324", "license": "mit", "hash": 8208271757279953000, "line_mean": 37.0983606557, "line_max": 102, "alpha_frac": 0.7125645439, "autogenerated": false, "ratio": 3.4126284875183552, ...
from flask import redirect, render_template, request, url_for, flash, session from hashlib import sha1 from time import time import random, string, re from pyfsw import app, db from pyfsw import Account, Player, LoginHistory from pyfsw import login_required, current_user, check_captcha from pyfsw import CAPTCHA_SITE_K...
{ "repo_name": "diath/pyfsw", "path": "pyfsw/views/account.py", "copies": "1", "size": "13918", "license": "mit", "hash": 7460879384067388000, "line_mean": 29.3886462882, "line_max": 163, "alpha_frac": 0.6992383963, "autogenerated": false, "ratio": 3.1827120969586096, "config_test": false, "ha...
from flask import redirect, render_template, request, url_for, flash, session from sqlalchemy import func from time import time from pyfsw import app, db from pyfsw import admin_required, current_user from pyfsw import Account, LoginHistory, PayPalHistory, ZayPayHistory # Handle Login Logs @app.route('/admin/logs/lo...
{ "repo_name": "diath/pyfsw", "path": "pyfsw/views/admin/logs.py", "copies": "1", "size": "7951", "license": "mit", "hash": 3988539855599878000, "line_mean": 30.804, "line_max": 122, "alpha_frac": 0.7190290529, "autogenerated": false, "ratio": 3.1022239563012097, "config_test": false, "has_no_...
from flask import redirect, render_template, request, url_for, flash, session from pyfsw import app, db from pyfsw import admin_required, current_user from pyfsw import ShopCategory, ShopItem, ShopOrder @app.route('/admin/shop/categories') @admin_required(5) def route_admin_shop_categories(): categories = ShopCatego...
{ "repo_name": "diath/pyfsw", "path": "pyfsw/views/admin/shop.py", "copies": "1", "size": "4538", "license": "mit", "hash": 9070003042782130000, "line_mean": 27.3625, "line_max": 77, "alpha_frac": 0.7031732041, "autogenerated": false, "ratio": 3.0072895957587806, "config_test": false, "has_no_...
from flask import redirect, render_template, request, url_for, flash, session from pyfsw import app, db from pyfsw import admin_required from pyfsw import Library @app.route('/admin/community/library') @admin_required(5) def route_admin_library(): pages = Library.query.all() return render_template( 'admin/commun...
{ "repo_name": "diath/pyfsw", "path": "pyfsw/views/admin/community.py", "copies": "1", "size": "1986", "license": "mit", "hash": -8919347662375137000, "line_mean": 26.5833333333, "line_max": 77, "alpha_frac": 0.7004028197, "autogenerated": false, "ratio": 3.0790697674418603, "config_test": false...
from flask import redirect, render_template, request, url_for, flash, session from time import time from pyfsw import app, db from pyfsw import admin_required, current_user from pyfsw import ForumCategory, ForumBoard @app.route('/admin/forum/categories') @admin_required(5) def route_admin_forum_categories(): catego...
{ "repo_name": "diath/pyfsw", "path": "pyfsw/views/admin/forum.py", "copies": "1", "size": "4352", "license": "mit", "hash": 3706987657984308000, "line_mean": 26.8974358974, "line_max": 105, "alpha_frac": 0.7127757353, "autogenerated": false, "ratio": 3.1130185979971388, "config_test": false, ...
from flask import redirect, render_template, request, url_for, flash, session from time import time from pyfsw import app, db from pyfsw import admin_required, current_user from pyfsw import News, ForumBoard, ForumThread, Player @app.route('/admin/news/compose', methods=['GET']) @admin_required(5) def route_admin_ne...
{ "repo_name": "diath/pyfsw", "path": "pyfsw/views/admin/news.py", "copies": "1", "size": "3776", "license": "mit", "hash": 4307973208329771500, "line_mean": 26.7647058824, "line_max": 119, "alpha_frac": 0.6941207627, "autogenerated": false, "ratio": 3.035369774919614, "config_test": false, "h...
from flask import redirect, render_template, request, url_for from flask_login import current_user, login_required from laserpony import app from laserpony.views.scaffold import BaseView from laserpony.models.project import Project from laserpony.models.post import Post from laserpony.forms.project import ProjectForm ...
{ "repo_name": "JackRamey/LaserPony", "path": "laserpony/views/project.py", "copies": "1", "size": "2218", "license": "mit", "hash": -1930331743368929500, "line_mean": 34.2063492063, "line_max": 90, "alpha_frac": 0.6361587015, "autogenerated": false, "ratio": 3.8844133099824867, "config_test": f...
from flask import redirect, render_template, request, url_for from flask_login import current_user, login_required from app.main import main from app.main.forms import TodoForm, TodoListForm from app.models import Todo, TodoList @main.route("/") def index(): form = TodoForm() if form.validate_on_submit(): ...
{ "repo_name": "0xfoo/flask-todolist", "path": "app/main/views.py", "copies": "2", "size": "1857", "license": "mit", "hash": 6109862373423833000, "line_mean": 32.1607142857, "line_max": 75, "alpha_frac": 0.675821217, "autogenerated": false, "ratio": 3.2984014209591472, "config_test": false, "h...
from flask import redirect, render_template, request, url_for from flask_login import login_required, current_user from bson.objectid import ObjectId from laserpony import app from laserpony.views.scaffold import BaseView from laserpony.models.post import Post #Posts class PostsView(BaseView): methods = ['GET'] ...
{ "repo_name": "JackRamey/LaserPony", "path": "laserpony/views/post.py", "copies": "1", "size": "3349", "license": "mit", "hash": -3296908702633118000, "line_mean": 33.5257731959, "line_max": 102, "alpha_frac": 0.5861451179, "autogenerated": false, "ratio": 3.8187001140250856, "config_test": fal...
from flask import redirect, render_template, request, url_for from flask_login import login_user, logout_user from app.auth import auth from app.auth.forms import LoginForm, RegistrationForm from app.models import User @auth.route("/login", methods=["GET", "POST"]) def login(): form = LoginForm() if form.val...
{ "repo_name": "0xfoo/flask-todolist", "path": "app/auth/views.py", "copies": "2", "size": "1546", "license": "mit", "hash": 8109848054306389000, "line_mean": 32.6086956522, "line_max": 87, "alpha_frac": 0.6319534282, "autogenerated": false, "ratio": 3.6985645933014353, "config_test": false, "...
from flask import redirect, render_template, request, url_for from flask.views import MethodView from flask_login import current_user from sqlalchemy.exc import IntegrityError, SQLAlchemyError from werkzeug import exceptions from warmsea import db from warmsea.models import Image, ImageStatus from warmsea.admin import...
{ "repo_name": "warmsea/warmsea.net", "path": "warmsea/admin/views/images.py", "copies": "1", "size": "6474", "license": "mit", "hash": 2371658168358433300, "line_mean": 33.4361702128, "line_max": 92, "alpha_frac": 0.5429409947, "autogenerated": false, "ratio": 4.650862068965517, "config_test": ...
from flask import redirect, render_template, request, url_for from flask.views import View from flask_login import login_user, logout_user from laserpony import app from laserpony.views.scaffold import BaseView from laserpony.models.post import Post from laserpony.models.user import User #Views class IndexView(BaseVie...
{ "repo_name": "JackRamey/LaserPony", "path": "laserpony/views/index.py", "copies": "1", "size": "3161", "license": "mit", "hash": 3533622970555029500, "line_mean": 36.1882352941, "line_max": 93, "alpha_frac": 0.5893704524, "autogenerated": false, "ratio": 4.021628498727735, "config_test": false...
from flask import redirect, render_template, session, request from oidc_rp import app, client @app.route('/') def index(): return render_template('index.html') @app.route('/authenticate') def authenticate(): redirect_url = client.authenticate(session) return redirect(redirect_url) @app.route('/repost_fra...
{ "repo_name": "daserzw/oidcprimer", "path": "oidc-python-rp/oidc_rp/webserver.py", "copies": "1", "size": "1225", "license": "bsd-2-clause", "hash": -421701563697328450, "line_mean": 31.2368421053, "line_max": 93, "alpha_frac": 0.6791836735, "autogenerated": false, "ratio": 3.6135693215339235, ...
from flask import redirect, render_template, session, url_for from flask_login import current_user from app import status_api_client from app.main import main from app.models.organisation import Organisations from app.utils import PermanentRedirect from app.utils.user import user_is_logged_in @main.route("/services"...
{ "repo_name": "alphagov/notifications-admin", "path": "app/main/views/choose_account.py", "copies": "1", "size": "2113", "license": "mit", "hash": 4870438773318662000, "line_mean": 35.4310344828, "line_max": 114, "alpha_frac": 0.7117841931, "autogenerated": false, "ratio": 3.6243567753001713, "...
from flask import redirect, render_template, url_for, abort, send_from_directory from app.models import Loan, Borrower, Employee from flask_login import login_required, current_user from . import reports @reports.route('/view-loans-report') @login_required def view_report(): if not current_user.is_admin: ...
{ "repo_name": "Kimanicodes/wananchi", "path": "app/reports/views.py", "copies": "1", "size": "2172", "license": "mit", "hash": -3986359335291098600, "line_mean": 34.0322580645, "line_max": 80, "alpha_frac": 0.6408839779, "autogenerated": false, "ratio": 3.39375, "config_test": false, "has_no_...
from flask import redirect, render_template, url_for, request, flash from time import time from pyfsw import app, db from pyfsw import Player, ShopCategory, ShopItem, ShopOrder, ShopHistory from pyfsw import login_required, current_user @app.route('/shop/offer') def route_shop(): categories = db.session.query(ShopCa...
{ "repo_name": "diath/pyfsw", "path": "pyfsw/views/shop.py", "copies": "1", "size": "2399", "license": "mit", "hash": -3290204861994522000, "line_mean": 28.256097561, "line_max": 95, "alpha_frac": 0.7123801584, "autogenerated": false, "ratio": 3.215817694369973, "config_test": false, "has_no_k...
from flask import redirect, render_template, url_for, session, flash, \ request from recipe_app import app # import class objects from classes.app import App from classes.user import User from classes.recipe_category import RecipeCategory from classes.recipe import Recipe # creating App object reci...
{ "repo_name": "PatrickCmd/Yummy-Recipes-App", "path": "recipe_app/views.py", "copies": "1", "size": "10673", "license": "mit", "hash": -6709214210477557000, "line_mean": 35.3027210884, "line_max": 77, "alpha_frac": 0.5933664387, "autogenerated": false, "ratio": 4.352773246329527, "config_test":...
from flask import redirect, request, jsonify, session, render_template, url_for from urllib.parse import parse_qs, urlparse from ..models import Course, Paper, Note, User, Post, Comment, School from . import cos from .. import basic from _datetime import datetime @cos.route('/<c_id>') def course_play(c_id): ...
{ "repo_name": "A1014280203/elearning", "path": "app/cos/api.py", "copies": "1", "size": "8041", "license": "mit", "hash": 5985259485903434000, "line_mean": 35.676056338, "line_max": 103, "alpha_frac": 0.5333333333, "autogenerated": false, "ratio": 3.4033078880407124, "config_test": false, "ha...
from flask import redirect, request, render_template, url_for, g from flask_login import login_user from wtforms import Form, PasswordField, StringField, BooleanField, validators from wtforms.fields.html5 import EmailField from redash import settings from redash.tasks.general import subscribe from redash.handlers.base...
{ "repo_name": "luozhanxin/redash-docker", "path": "redash/handlers/setup.py", "copies": "4", "size": "2162", "license": "bsd-2-clause", "hash": -8669750261905148000, "line_mean": 37.6071428571, "line_max": 127, "alpha_frac": 0.7081406105, "autogenerated": false, "ratio": 3.930909090909091, "con...
from flask import redirect, request, session from flask.ext.classy import FlaskView, route from machete.base.response import success from machete.base.routes import UUIDConverter from machete.templating import render from machete.projects.models import Project from machete.users.models import User class ProjectConve...
{ "repo_name": "rustyrazorblade/machete", "path": "machete/projects/blueprints.py", "copies": "1", "size": "1377", "license": "bsd-3-clause", "hash": 7151496202970015000, "line_mean": 24.5, "line_max": 71, "alpha_frac": 0.6463326071, "autogenerated": false, "ratio": 4.086053412462908, "config_te...
from flask import redirect, request, session from flask.ext.jsonpify import jsonify from .. import preprocessors, responses from ...database import NotFoundError def configure(bp, config, db): @bp.route("/users/", methods=["GET"]) def get_users(): """ Returns a list of user_ids that have eve...
{ "repo_name": "Cladis/wikilabels", "path": "wikilabels/wsgi/routes/users.py", "copies": "1", "size": "2141", "license": "mit", "hash": -4882894573482149000, "line_mean": 31.4393939394, "line_max": 79, "alpha_frac": 0.5357309668, "autogenerated": false, "ratio": 3.906934306569343, "config_test":...
from flask import redirect, request, session from flask.ext.jsonpify import jsonify from .. import preprocessors, responses def configure(bp, config, oauth): @bp.route("/auth/") def auth_index(): info = "Welcome to the auth module. You can /auth/initiate an " + \ "oauth handshake. Y...
{ "repo_name": "Cladis/wikilabels", "path": "wikilabels/wsgi/routes/auth.py", "copies": "1", "size": "2167", "license": "mit", "hash": 8171815245635249000, "line_mean": 27.5131578947, "line_max": 81, "alpha_frac": 0.5366866636, "autogenerated": false, "ratio": 4.449691991786447, "config_test": f...
from flask import redirect, request, session, url_for from flask_admin import Admin, AdminIndexView, expose from flask_admin.contrib import sqla from flask_login import current_user from .account.models import OAuth from .auth import current_user_is_roadie from .db import postgres from .members.models import EmailAddr...
{ "repo_name": "jazzband/website", "path": "jazzband/admin.py", "copies": "1", "size": "2880", "license": "mit", "hash": 2327254336714396700, "line_mean": 27.5148514851, "line_max": 75, "alpha_frac": 0.6583333333, "autogenerated": false, "ratio": 3.6875800256081948, "config_test": false, "has_...
from flask import redirect, request, session, url_for from flask_jsonpify import jsonify from .. import preprocessors, responses def configure(bp, config, oauth): @bp.route("/auth/") def auth_index(): info = "Welcome to the auth module. You can /auth/initiate an " + \ "oauth handshak...
{ "repo_name": "wiki-ai/wikilabels", "path": "wikilabels/wsgi/routes/auth.py", "copies": "1", "size": "2607", "license": "mit", "hash": -4479786344215581700, "line_mean": 30.4096385542, "line_max": 77, "alpha_frac": 0.5316455696, "autogenerated": false, "ratio": 4.448805460750854, "config_test":...
from flask import redirect, request, url_for, Blueprint, request, jsonify, session, Response from flask.ext.login import login_user, login_required, logout_user, abort from project import utils, database_wrapper from project.services.auth import Auth from flask.ext.api import FlaskAPI, exceptions from flask.ext.api.sta...
{ "repo_name": "AustinStoneProjects/Founderati-Server", "path": "project/api/invites.py", "copies": "1", "size": "2204", "license": "apache-2.0", "hash": 9153063584882095000, "line_mean": 31.8955223881, "line_max": 92, "alpha_frac": 0.6932849365, "autogenerated": false, "ratio": 3.5837398373983738...
from flask import redirect, request, url_for, current_app from rauth import OAuth2Service import json class OAuthSignIn(object): providers = None def __init__(self, provider_name): self.provider_name = provider_name credentials = current_app.config['OAUTH_CREDENTIALS'][provider_name] s...
{ "repo_name": "Curso-TII/Portal-TII", "path": "app/auth/oauth.py", "copies": "1", "size": "2554", "license": "apache-2.0", "hash": -3837327821849092600, "line_mean": 32.1688311688, "line_max": 90, "alpha_frac": 0.5712607674, "autogenerated": false, "ratio": 4.053968253968254, "config_test": fal...
from flask import redirect, request, url_for from pelicansqlgenerator.models import Content from playhouse.flask_utils import get_object_or_404 from slugify import slugify from plume.app import app from plume.utils import templated from plume.forms import PageForm __all__ = ["page", "page_create", "page_edit", "page_...
{ "repo_name": "gkrnours/plume", "path": "src/plume/views/page.py", "copies": "1", "size": "1523", "license": "mit", "hash": 487161838512756700, "line_mean": 27.2037037037, "line_max": 66, "alpha_frac": 0.6152330926, "autogenerated": false, "ratio": 3.4771689497716896, "config_test": false, "h...
from flask import redirect, Response from flask import Flask import urllib2 import json import traceback from google.appengine.api import urlfetch import sys app = Flask(__name__) app.config['DEBUG'] = True # Note: We don't need to call run() since our application is embedded within # the App Engine WSGI application...
{ "repo_name": "kholia/daily-builds", "path": "main.py", "copies": "1", "size": "3960", "license": "apache-2.0", "hash": 392297001254711800, "line_mean": 34.3571428571, "line_max": 110, "alpha_frac": 0.5755050505, "autogenerated": false, "ratio": 4.125, "config_test": true, "has_no_keywords": ...