text
stringlengths
0
1.05M
meta
dict
from flask import render_template, url_for, redirect, g, abort from app import app from forms import TaskForm import rethinkdb as r from rethinkdb.errors import RqlRuntimeError # rethink config RDB_HOST = 'localhost' RDB_PORT = 28015 TODO_DB = 'todo' # db setup; only run once def dbSetup(): connection = r.connect...
{ "repo_name": "HiroIshikawa/21playground", "path": "flask-rethink/app/views.py", "copies": "1", "size": "1326", "license": "mit", "hash": -5935649152169869000, "line_mean": 25, "line_max": 70, "alpha_frac": 0.7179487179, "autogenerated": false, "ratio": 3.0482758620689654, "config_test": false,...
from flask import render_template, url_for, redirect, g, request, flash, jsonify from flask.ext.login import login_user, logout_user, current_user, login_required from hackathon_project import app, db, lm from forms import LoginForm, SignupForm from models import User import os #################Message Handling Functi...
{ "repo_name": "f-enye/hackathon", "path": "hackathon_project/hackathon_project/views.py", "copies": "1", "size": "3077", "license": "mit", "hash": 5146799325500618000, "line_mean": 27.7570093458, "line_max": 81, "alpha_frac": 0.674358141, "autogenerated": false, "ratio": 3.1623843782117165, "co...
from flask import render_template, url_for, redirect, g, request, flash from flask.ext.login import login_user, logout_user, current_user, login_required from flask_initial_setup import app, db, lm from forms import LoginForm, SignupForm from models import User #################Template Rendering Functions###########...
{ "repo_name": "f-enye/flask_initial_setup", "path": "flask_initial_setup/views.py", "copies": "1", "size": "1783", "license": "mit", "hash": 1750713259048605400, "line_mean": 26.4307692308, "line_max": 81, "alpha_frac": 0.6853617499, "autogenerated": false, "ratio": 3.2126126126126127, "config_...
from flask import render_template, url_for, redirect, g, request, flash, session, abort from werkzeug.security import generate_password_hash from auth import app, db from forms import LoginForm, RegistrationForm, IdentityTokenForm from hooks import admin_required, login_required from models import User, IdentityToken, ...
{ "repo_name": "fogleman/LoginServer", "path": "auth/views.py", "copies": "1", "size": "5637", "license": "mit", "hash": -5450286877136482000, "line_mean": 33.1636363636, "line_max": 101, "alpha_frac": 0.6398793685, "autogenerated": false, "ratio": 3.8636052090472925, "config_test": false, "ha...
from flask import render_template, url_for, redirect, request, flash from app import app from database import db as database SITE_URL = "localhost:5000" db = database() # App Routes @app.route('/') def index(): error = check_for_errors() return render_template('index.html', error=error) @app.route('/quest...
{ "repo_name": "cmutti/deadpoll", "path": "views.py", "copies": "1", "size": "3359", "license": "mit", "hash": -6853287676156186000, "line_mean": 30.3925233645, "line_max": 77, "alpha_frac": 0.5671330753, "autogenerated": false, "ratio": 3.8127128263337116, "config_test": false, "has_no_keywor...
from flask import render_template, url_for, redirect, request, flash from ..models import User from . import auth from .. import db from .forms import LoginForm, RegistrationForm, ChangePasswordForm, \ PasswordResetRequestForm, PasswordResetForm, ChangeEmailForm from flask.ext.login import login_user, login_require...
{ "repo_name": "caser789/xuejiao-blog", "path": "app/auth/views.py", "copies": "1", "size": "6021", "license": "mit", "hash": 743692612730518900, "line_mean": 38.6118421053, "line_max": 81, "alpha_frac": 0.6384321541, "autogenerated": false, "ratio": 3.9533814839133288, "config_test": false, "...
from flask import render_template, url_for, redirect, request, flash, render_template_string from forms import LoginForm, SearchForm, genSearchForm from hello import app, db, login_manager, db_connection from models import UserProfile, User from flask.ext.login import LoginManager, UserMixin, login_required, login_user...
{ "repo_name": "oracle/json-in-db", "path": "Python-Demo-App/hello/views.py", "copies": "1", "size": "6302", "license": "mit", "hash": 2473469870992442400, "line_mean": 41.0133333333, "line_max": 271, "alpha_frac": 0.6661377341, "autogenerated": false, "ratio": 3.4064864864864863, "config_test":...
from flask import render_template, url_for, redirect, request, g,\ make_response from datetime import datetime, timedelta, timezone import libforget.twitter import libforget.mastodon from libforget.auth import require_auth, csrf,\ get_viewer from model import Session, TwitterArchi...
{ "repo_name": "codl/forget", "path": "routes/__init__.py", "copies": "1", "size": "7976", "license": "isc", "hash": -7742114081402335000, "line_mean": 28.984962406, "line_max": 94, "alpha_frac": 0.6021815446, "autogenerated": false, "ratio": 3.92133726647001, "config_test": false, "has_no_key...
from flask import render_template, url_for, request, flash, send_file, make_response, redirect from logging import DEBUG from werkzeug import secure_filename from formgen import pomxmlForm, LoginForm, SignupForm, searchForm from reason import app, db, login_manager from reason import ALLOWED_EXTENSIONS from reason impo...
{ "repo_name": "pombredanne/reason", "path": "reason/views.py", "copies": "2", "size": "4384", "license": "mit", "hash": -2412962475440005000, "line_mean": 29.6573426573, "line_max": 122, "alpha_frac": 0.6763229927, "autogenerated": false, "ratio": 3.731063829787234, "config_test": false, "has...
from flask import render_template, url_for, request from flask_login import current_user from werkzeug.utils import redirect import helper.generic_helper as helper from db_handler import db_session from models import Round, Question, User, Participation, Description def handle_admin(): rounds = db_session.query(...
{ "repo_name": "NemoNessuno/SecretSanta", "path": "admin.py", "copies": "1", "size": "4457", "license": "mit", "hash": 7535862830404810000, "line_mean": 34.656, "line_max": 115, "alpha_frac": 0.6098272381, "autogenerated": false, "ratio": 3.9723707664884134, "config_test": false, "has_no_keywo...
from flask import render_template, url_for, request, redirect, flash, abort from flask_login import login_required from . import main from .forms import PostForm, AddCategoryForm from ..models import * @main.route('/') def index(): page = request.args.get('page', 1, type=int) pagination = Post.query.order_by...
{ "repo_name": "loveofmaria/gallery", "path": "app/main/views.py", "copies": "1", "size": "1815", "license": "apache-2.0", "hash": -3348092871010123000, "line_mean": 32.8679245283, "line_max": 81, "alpha_frac": 0.6590529248, "autogenerated": false, "ratio": 3.465250965250965, "config_test": fals...
from flask import render_template, url_for, request, redirect from flask.ext.login import login_required, current_user import rfk import rfk.site import rfk.database import rfk.liquidsoap from rfk.site.helper import permission_required from rfk.site.forms.stream import new_stream from rfk.database.streaming import Str...
{ "repo_name": "buckket/PyRfK", "path": "lib/rfk/site/admin/streams.py", "copies": "4", "size": "1726", "license": "bsd-3-clause", "hash": -372057384359213300, "line_mean": 34.2244897959, "line_max": 117, "alpha_frac": 0.7039397451, "autogenerated": false, "ratio": 3.7685589519650655, "config_te...
from flask import render_template, url_for, request, session, jsonify, redirect, flash import pusher from datetime import datetime from time import time from app import app, facebook @app.route('/') def index(): if session.get('oauth_token'): return redirect(url_for('chat')) return render_template('ma...
{ "repo_name": "HeewonLee/facebook-likelion", "path": "app/controllers.py", "copies": "1", "size": "2753", "license": "apache-2.0", "hash": 7925844705675790000, "line_mean": 28.9239130435, "line_max": 99, "alpha_frac": 0.600072648, "autogenerated": false, "ratio": 3.476010101010101, "config_test...
from flask import render_template, url_for, request, session, redirect, jsonify,\ make_response,current_app from . import main from .runCode import pmlchecker, pml_to_dot, pml_to_json from .forms import LoginForm, RegisterForm,PasswordResetForm,PasswordChangeForm from .. import db, login_manager, oauth, mail from flas...
{ "repo_name": "mereckaj/CS4098-Group-E", "path": "app/main/views.py", "copies": "2", "size": "19289", "license": "mit", "hash": 2294364688582504400, "line_mean": 32.722027972, "line_max": 90, "alpha_frac": 0.7134636321, "autogenerated": false, "ratio": 3.1751440329218106, "config_test": true, ...
from flask import request, abort, current_app as app, make_response from feedrsub.utils.security import require_cron_api_key from feedrsub.utils.websub import secret_too_big, parse_lease_seconds, Mode from feedrsub.websub import websub_blueprint as bp from feedrsub.websub.tasks import ( task_hub_subscribe, tas...
{ "repo_name": "DBeath/flask-feedrsub", "path": "feedrsub/websub/views.py", "copies": "1", "size": "3003", "license": "mit", "hash": 5763107540891437000, "line_mean": 28.4411764706, "line_max": 86, "alpha_frac": 0.6653346653, "autogenerated": false, "ratio": 3.4556962025316458, "config_test": fa...
from flask import request, abort, current_app, has_request_context from .utils import unknown_value from .ctx import FlagContextStack from werkzeug.exceptions import HTTPException from dateutil.parser import parse as parse_date import functools import inspect try: from marshmallow import Schema as MarshmallowSche...
{ "repo_name": "frascoweb/frasco", "path": "frasco/request_params.py", "copies": "1", "size": "11387", "license": "mit", "hash": 210031670575142820, "line_mean": 32.7893175074, "line_max": 106, "alpha_frac": 0.5978747695, "autogenerated": false, "ratio": 4.1392221010541626, "config_test": false,...
from flask import request, abort, current_app import status from werkzeug import BaseResponse from renderers import JSONRenderer, JSONPRenderer, BrowsableAPIRenderer default_renderers = [JSONRenderer(), JSONPRenderer(), BrowsableAPIRenderer()] class ApiView(): ''' Class for wrapping view_functions, use the ...
{ "repo_name": "robvanmieghem/flask-jigger", "path": "flask_jigger/views.py", "copies": "1", "size": "2055", "license": "apache-2.0", "hash": 5217338576920260000, "line_mean": 36.3818181818, "line_max": 144, "alpha_frac": 0.5922141119, "autogenerated": false, "ratio": 4.597315436241611, "config_...
from flask import request, abort, g from . import User, Token, Resource import bcrypt from functools import wraps def verify(function): @wraps(function) def wrapper(*args, **kwargs): token = request.headers.get('X-Authentication-Token') if token is None: abort(401) else...
{ "repo_name": "citruspi/Fangorn", "path": "api/users.py", "copies": "1", "size": "2577", "license": "unlicense", "hash": 3107218983672347600, "line_mean": 24.0194174757, "line_max": 77, "alpha_frac": 0.5595653861, "autogenerated": false, "ratio": 4.481739130434782, "config_test": false, "has_...
from flask import request, abort, jsonify, current_app import json, gzip from sqlalchemy import or_, and_ import numpy as np from shared import * from ..models import * import StringIO import urllib, urllib2, base64 from ..data_publisher import data_publisher from datetime import datetime, timedelta # Radio Observatio...
{ "repo_name": "WildflowerSchools/sensei", "path": "app/api/radio_observations.py", "copies": "1", "size": "7359", "license": "mit", "hash": -4196772731004294700, "line_mean": 36.1666666667, "line_max": 154, "alpha_frac": 0.5941024596, "autogenerated": false, "ratio": 3.9227078891257996, "config...
from flask import request, abort, jsonify, g from .. import db from ..auth import token_auth, token_optional_auth from ..models import Message from ..utils import timestamp, url_for from ..tasks import async from . import api @api.route('/messages', methods=['POST']) @token_auth.login_required @async def new_message...
{ "repo_name": "send2zhao/boilerplate", "path": "flack/api/messages.py", "copies": "1", "size": "2137", "license": "mit", "hash": 6950562903816467000, "line_mean": 28.6805555556, "line_max": 76, "alpha_frac": 0.6574637342, "autogenerated": false, "ratio": 3.5616666666666665, "config_test": false...
from flask import request, abort, jsonify, g from .. import db from ..auth import token_auth, token_optional_auth from ..models import User from ..utils import url_for from . import api @api.route('/users', methods=['POST']) def new_user(): """ Register a new user. This endpoint is publicly available. ...
{ "repo_name": "send2zhao/boilerplate", "path": "flack/api/users.py", "copies": "1", "size": "2147", "license": "mit", "hash": -7356039678897212000, "line_mean": 29.2394366197, "line_max": 76, "alpha_frac": 0.6450861667, "autogenerated": false, "ratio": 3.4573268921095006, "config_test": false, ...
from flask import request, abort, jsonify from flask_login import current_user from wikked.web import app, get_wiki from wikked.webimpl import url_from_viewarg from wikked.webimpl.decorators import requires_permission from wikked.webimpl.history import ( get_site_history, get_page_history, read_page_rev...
{ "repo_name": "ludovicchabant/Wikked", "path": "wikked/api/history.py", "copies": "1", "size": "2647", "license": "apache-2.0", "hash": -6368975558502983000, "line_mean": 28.0879120879, "line_max": 70, "alpha_frac": 0.6369474877, "autogenerated": false, "ratio": 3.2679012345679013, "config_test...
from flask import request, abort, jsonify import json, gzip from sqlalchemy import or_, and_ from datetime import datetime,timedelta import numpy as np from shared import * from ..models import * from ..analysis.interaction_periods import generate_interaction_periods_for_relationship import StringIO # Interaction Peri...
{ "repo_name": "WildflowerSchools/sensei", "path": "app/api/interaction_periods.py", "copies": "1", "size": "4825", "license": "mit", "hash": 5579611404342326000, "line_mean": 36.1153846154, "line_max": 112, "alpha_frac": 0.6169948187, "autogenerated": false, "ratio": 4.078613693998309, "config_...
from flask import request, abort, jsonify import json, gzip from sqlalchemy import or_, and_ import numpy as np from shared import * from ..models import * import dateutil.parser import StringIO def assert_iso8601_time_param(name): datestring = request.args.get(name) if not datestring: abort(400, "Mis...
{ "repo_name": "WildflowerSchools/sensei", "path": "app/api/interaction_totals.py", "copies": "1", "size": "3241", "license": "mit", "hash": 4306821094728585000, "line_mean": 35.8295454545, "line_max": 108, "alpha_frac": 0.6140080222, "autogenerated": false, "ratio": 4.128662420382166, "config_t...
from flask import request, abort, jsonify import json, gzip from sqlalchemy import or_, and_ import numpy as np from shared import * from ..models import * import StringIO # Accelerometer Events upload # @api.route('/api/v1/accelerometer_events', methods=['POST']) @api_auth.requires_auth def post_accelerometer_events(...
{ "repo_name": "WildflowerSchools/sensei", "path": "app/api/accelerometer_events.py", "copies": "1", "size": "2867", "license": "mit", "hash": 7297663085309435000, "line_mean": 30.5054945055, "line_max": 112, "alpha_frac": 0.6253923962, "autogenerated": false, "ratio": 3.46256038647343, "config_...
from flask import request, abort, jsonify import json, gzip from sqlalchemy import or_, and_ import numpy as np from shared import * from ..models import * import StringIO # Accelerometer Observations upload # @api.route('/api/v1/accelerometer_observations', methods=['POST']) @api_auth.requires_auth def post_accelerom...
{ "repo_name": "WildflowerSchools/sensei", "path": "app/api/accelerometer_observations.py", "copies": "1", "size": "3649", "license": "mit", "hash": 7571466229604019000, "line_mean": 33.4245283019, "line_max": 118, "alpha_frac": 0.6346944368, "autogenerated": false, "ratio": 3.5844793713163066, ...
from flask import request, abort, jsonify, render_template from flask.ext.sqlalchemy import BaseQuery import math class PaginatedQuery(object): def __init__(self, query_or_model, paginate_by, page_var='page', check_bounds=False): self.paginate_by = paginate_by self.page_var = page...
{ "repo_name": "pbecotte/devblog", "path": "backend/blog/utils.py", "copies": "1", "size": "2165", "license": "mit", "hash": 1714761490939532000, "line_mean": 29.4929577465, "line_max": 78, "alpha_frac": 0.6087759815, "autogenerated": false, "ratio": 3.6757215619694397, "config_test": false, "...
from flask import request, abort, jsonify, Response, render_template, Blueprint, current_app from functools import wraps from models.temperature import Temperature from models.event import Event, EventType from models.users import User from app.factory import socketio, db, arduino import arrow import json blueprint = ...
{ "repo_name": "Teddy-Schmitz/temperature_admin", "path": "app/views.py", "copies": "1", "size": "5656", "license": "mit", "hash": -5702756531619751000, "line_mean": 28.1546391753, "line_max": 99, "alpha_frac": 0.650106082, "autogenerated": false, "ratio": 3.8450033990482666, "config_test": fals...
from flask import request, abort from beavy.app import db, current_user from beavy.utils import fallbackRender from flask.ext.security import login_required from .blueprint import hn_bp from .models import Topic, Link from .schemas import topic as topic_schema, link as link_schema @hn_bp.route("/l/<model:link>/") # ...
{ "repo_name": "beavyHQ/beavy", "path": "beavy_apps/hacker_news/views.py", "copies": "1", "size": "1534", "license": "mpl-2.0", "hash": -2546914261061708000, "line_mean": 29.68, "line_max": 76, "alpha_frac": 0.6440677966, "autogenerated": false, "ratio": 3.567441860465116, "config_test": false, ...
from flask import request, abort from decimal import Decimal from e.model.model import Model from e.model.prediction import Prediction from e.utils import serialize_response @serialize_response def add_model_prediction(mid): model = Model.objects.get_or_404(id=mid) # request.form is immutable :( # TODO(...
{ "repo_name": "MLEval/eval", "path": "e/controller/prediction.py", "copies": "1", "size": "1984", "license": "mit", "hash": 7416908706301619000, "line_mean": 32.6271186441, "line_max": 78, "alpha_frac": 0.6769153226, "autogenerated": false, "ratio": 4.257510729613734, "config_test": false, "h...
from flask import request, abort from functools import wraps from data.user import UserData from data.role import RoleData from common.session import verify_session_id, SessionExpired, BadSession def protected_resource(permission_string): def decorator(func): @wraps(func) def check_has_permission(...
{ "repo_name": "ONSdigital/nsdc", "path": "server/api/protected_resource.py", "copies": "1", "size": "1357", "license": "mit", "hash": 6287739626989508000, "line_mean": 37.7714285714, "line_max": 95, "alpha_frac": 0.6278555637, "autogenerated": false, "ratio": 4.569023569023569, "config_test": f...
from flask import request, abort from functools import wraps import main import string import random # for unique key gen import calendar import datetime import uuid from app import app def unix_timestamp(fromdatetime=False): if not fromdatetime: return calendar.timegm(datetime.datetime.utcnow().timetup...
{ "repo_name": "westerncapelabs/promopuffin-core", "path": "web/promopuffincore/shareddefs.py", "copies": "1", "size": "2122", "license": "bsd-3-clause", "hash": 867125430029446700, "line_mean": 30.2058823529, "line_max": 114, "alpha_frac": 0.6041470311, "autogenerated": false, "ratio": 3.92962962...
from flask import request, abort from jsonschema import _validators from collections import defaultdict from werkzeug.utils import cached_property import re import json import jsonschema import uuid # ToDo: Check format checkers # ToDo: URL Prefix (?) # ToDo: Log missing schema for appro-pro routes class ValidationE...
{ "repo_name": "rhyselsmore/flask-schema", "path": "flask_schema.py", "copies": "1", "size": "7210", "license": "isc", "hash": 4485845480032918000, "line_mean": 30.9026548673, "line_max": 79, "alpha_frac": 0.5588072122, "autogenerated": false, "ratio": 4.191860465116279, "config_test": false, ...
from flask import request, abort from lib import get_time, ARCHIVE_PERIOD, PING_PERIOD from lib.messages import send_message def ping(redis, chat, session, chat_type): online_state = get_online_state(redis, chat, session.session_id) if online_state=='offline': # Don't let the user in if there are more ...
{ "repo_name": "MSPARP/MSPARP", "path": "lib/api.py", "copies": "1", "size": "3398", "license": "mit", "hash": -7725702877200614000, "line_mean": 51.2769230769, "line_max": 163, "alpha_frac": 0.634490877, "autogenerated": false, "ratio": 3.524896265560166, "config_test": false, "has_no_keyword...
from flask import request, abort from .models import Event from ..mail.models import Mail from .. import api from ..decorators import json, collection from ... import db from ... import cache @api.route('/mails/<int:id>/events/', methods=['GET']) @json @cache.memoize(timeout=10) @collection(Event) def get_events(id):...
{ "repo_name": "prisconapoli/mercury", "path": "app/api_1_0/event/view.py", "copies": "1", "size": "1052", "license": "mit", "hash": 4892671547148893000, "line_mean": 24.6585365854, "line_max": 73, "alpha_frac": 0.6454372624, "autogenerated": false, "ratio": 3.178247734138973, "config_test": fal...
from flask import request, abort, session from functools import wraps import logging import urllib.request as urllib2 import numpy as np import cv2 import random from annotator_supreme.views import error_views from io import StringIO from PIL import Image from annotator_supreme import app import os import base64 def r...
{ "repo_name": "meerkat-cv/annotator-supreme", "path": "annotator_supreme/views/view_tools.py", "copies": "1", "size": "5904", "license": "mit", "hash": 7931758712709666000, "line_mean": 33.5263157895, "line_max": 84, "alpha_frac": 0.5843495935, "autogenerated": false, "ratio": 3.9571045576407506,...
from flask import request as flask_request from flask.sessions import SecureCookieSessionInterface class SeparateLocaleCookieSessionInterface(SecureCookieSessionInterface): """ Store a user's locale preference in a separate, unencrypted cookie. """ def _copy_session(self, session, data): """ ...
{ "repo_name": "agdsn/sipa", "path": "sipa/session.py", "copies": "3", "size": "2079", "license": "mit", "hash": -3221071090184642600, "line_mean": 38.2264150943, "line_max": 76, "alpha_frac": 0.6204906205, "autogenerated": false, "ratio": 4.404661016949152, "config_test": false, "has_no_keywo...
from flask import request as request_ctx from uchan import logger from uchan.lib.exceptions import ArgumentError def get_request_ip4_str(request=None): # You must set the correct config.USE_PROXY_FIXER and config.PROXY_FIXER_NUM_PROXIES settings for this to return # the correct value return request.remot...
{ "repo_name": "Floens/uchan", "path": "uchan/lib/proxy_request.py", "copies": "1", "size": "1052", "license": "mit", "hash": 2193493492426036700, "line_mean": 27.4324324324, "line_max": 116, "alpha_frac": 0.6140684411, "autogenerated": false, "ratio": 3.382636655948553, "config_test": false, ...
from flask import request as rq from flask import abort, jsonify from flask.views import MethodView from werkzeug.security import check_password_hash from gestion.models import User from gestion.database import session as ss from gestion.utils import Token from gestion.views.check_authorize import check_authorize cla...
{ "repo_name": "swkoubou/gestion-api", "path": "gestion/views/authorize.py", "copies": "1", "size": "1156", "license": "mit", "hash": 8115308691370467000, "line_mean": 31.4, "line_max": 74, "alpha_frac": 0.6463844797, "autogenerated": false, "ratio": 3.7058823529411766, "config_test": false, "...
from flask import request as rq from flask import abort, jsonify from flask.views import MethodView from werkzeug.security import generate_password_hash, check_password_hash from gestion.models import Group, User, Stress from gestion.database import session as ss from gestion.utils import Token from gestion.views.check...
{ "repo_name": "swkoubou/gestion-api", "path": "gestion/views/stress.py", "copies": "1", "size": "1218", "license": "mit", "hash": -8670084534417406000, "line_mean": 38.0666666667, "line_max": 84, "alpha_frac": 0.6578498294, "autogenerated": false, "ratio": 3.3295454545454546, "config_test": fal...
from flask import request as rq from flask import abort, jsonify from flask.views import MethodView from werkzeug.security import generate_password_hash from gestion.models import Group, User, AttendanceRecord from gestion.database import session as ss from gestion.utils import Token from gestion.views.check_authorize ...
{ "repo_name": "swkoubou/gestion-api", "path": "gestion/views/attendance_records.py", "copies": "1", "size": "2814", "license": "mit", "hash": 2801413441665874400, "line_mean": 35.8648648649, "line_max": 84, "alpha_frac": 0.5912756598, "autogenerated": false, "ratio": 3.479591836734694, "config_...
from flask import request as rq from flask import abort, jsonify from flask.views import MethodView from werkzeug.security import generate_password_hash from gestion.models import Group, User from gestion.database import session as ss from gestion.utils import Token from gestion.views.check_authorize import check_autho...
{ "repo_name": "swkoubou/gestion-api", "path": "gestion/views/groups.py", "copies": "1", "size": "3616", "license": "mit", "hash": 5632714306518788000, "line_mean": 37.7857142857, "line_max": 83, "alpha_frac": 0.5798035605, "autogenerated": false, "ratio": 2.9672131147540983, "config_test": fals...
from flask import request as rq from flask import abort, jsonify from gestion.database import session as ss from gestion.models import User from gestion.utils import Token def parse_authorize_header(): # ヘッダ形式はRFC6750参照 authorization = rq.headers['Authorization'] scheme, access_token = authorization.split...
{ "repo_name": "swkoubou/gestion-api", "path": "gestion/views/check_authorize.py", "copies": "1", "size": "1626", "license": "mit", "hash": -139787581634265860, "line_mean": 26.7142857143, "line_max": 73, "alpha_frac": 0.6318114875, "autogenerated": false, "ratio": 2.4646098003629766, "config_te...
from flask import request, Blueprint, abort from flask_security import current_user from sqlalchemy import desc from sqlalchemy.orm import defer, noload from sqlalchemy.sql.expression import nullslast from pmg import cache, cache_key, should_skip_cache from pmg.models import Committee, CommitteeMeeting, CommitteeMeeti...
{ "repo_name": "Code4SA/pmg-cms-2", "path": "pmg/api/v2.py", "copies": "1", "size": "7153", "license": "apache-2.0", "hash": 1223949864082476800, "line_mean": 29.8318965517, "line_max": 114, "alpha_frac": 0.6674122746, "autogenerated": false, "ratio": 3.3238847583643123, "config_test": false, ...
from flask import request, Blueprint, current_app, Response, abort from flask.ext.cors import CORS import json import traceback import sys from jsonschema import ValidationError from .api import APIRequest api_tree = Blueprint('api', __name__) def init(app): if hasattr(app.suite, 'max_content_length'): ...
{ "repo_name": "JeffHeard/sondra", "path": "sondra/flask.py", "copies": "1", "size": "4474", "license": "apache-2.0", "hash": 8659809999455026000, "line_mean": 26.9625, "line_max": 80, "alpha_frac": 0.50245865, "autogenerated": false, "ratio": 4.1930646672914715, "config_test": false, "has_no_...
from flask import request, Blueprint from shelf.endpoint_decorators import decorators import shelf.response_map as response_map artifact = Blueprint("artifact", __name__) @artifact.route("/<bucket_name>/artifact/", methods=["GET", "HEAD"], defaults={"path": "/"}) @artifact.route("/<bucket_name>/artifact/<path:path>"...
{ "repo_name": "not-nexus/shelf", "path": "shelf/routes/artifact.py", "copies": "2", "size": "5229", "license": "mit", "hash": 4755239638220954000, "line_mean": 32.3057324841, "line_max": 98, "alpha_frac": 0.7075922739, "autogenerated": false, "ratio": 3.9434389140271495, "config_test": false, ...
from flask import request, Blueprint from werkzeug.exceptions import BadRequest from app.libs.api_response import ApiResponse from app.libs.jwt_handler import api_required from app.libs.datetime_formatter import format_date, format_time from app.model.daily_sales import DailySalesSearchOption from app.model.mapper.sale...
{ "repo_name": "KentaYamada/Siphon", "path": "app/controller/daily_sales.py", "copies": "1", "size": "1664", "license": "mit", "hash": 4819056418244215000, "line_mean": 32.28, "line_max": 74, "alpha_frac": 0.6568509615, "autogenerated": false, "ratio": 3.570815450643777, "config_test": false, ...
from flask import request, Blueprint from werkzeug.exceptions import ( BadRequest, Conflict, NotFound ) from app.libs.api_response import ApiResponse from app.libs.jwt_handler import api_required from app.model.category import ( Category, CategorySearchOption ) from app.model.mapper.category_mapper ...
{ "repo_name": "KentaYamada/Siphon", "path": "app/controller/category.py", "copies": "1", "size": "2372", "license": "mit", "hash": -5835103970078734000, "line_mean": 23.2921348315, "line_max": 67, "alpha_frac": 0.6558741906, "autogenerated": false, "ratio": 3.251127819548872, "config_test": fal...
from flask import request, Blueprint from .._config import AUTH, GRANULAR_SENSOR_AUTH_TOKENS, OPEN_SENSORS from .._validate import ( require_all, extract_strings, extract_integers, resolve_auth_token, ) from .._query import filter_strings, execute_query, filter_integers from .._exceptions import EpiDat...
{ "repo_name": "cmu-delphi/delphi-epidata", "path": "src/server/endpoints/sensors.py", "copies": "1", "size": "6244", "license": "mit", "hash": 7059486393306853000, "line_mean": 45.9473684211, "line_max": 370, "alpha_frac": 0.6880204997, "autogenerated": false, "ratio": 3.9518987341772154, "conf...
from flask import request, Blueprint, Response from flask import current_app, g import datetime import json # This is the blueprint object that gets registered into the app in # blueprints.py. general = Blueprint('general', __name__) @general.route("/health") def check_status(): return Response(response=json.dum...
{ "repo_name": "matthew-shaw/thing-api", "path": "thing_api/views/general.py", "copies": "1", "size": "5860", "license": "mit", "hash": -2166749824177080000, "line_mean": 47.8333333333, "line_max": 119, "alpha_frac": 0.5209897611, "autogenerated": false, "ratio": 4.599686028257457, "config_test"...
from flask import request, Blueprint, Response import json import csv # Import the database object (db) from the main application module # and the app object to initialize the flask_login manager from app import app, db # Import module models (i.e. User) from app.models.tweets_model import Tweet from app.models.labels_...
{ "repo_name": "THSUPRM/ths-client", "path": "app/controllers/tweets_controller.py", "copies": "1", "size": "2912", "license": "mit", "hash": -4242777562867598000, "line_mean": 31.7191011236, "line_max": 111, "alpha_frac": 0.6559065934, "autogenerated": false, "ratio": 3.282976324689966, "config...
from flask import request, Blueprint, Response import csv # Import the database object (db) from the main application module # and the app object to initialize the flask_login manager from app import app, db # Import module models (i.e. User) from app.models.tweets_model import Tweet from app.models.labels_model impor...
{ "repo_name": "THSUPRM/ths-client", "path": "app/controllers/home_controller.py", "copies": "1", "size": "3050", "license": "mit", "hash": -5323675470978007000, "line_mean": 37.125, "line_max": 100, "alpha_frac": 0.6544262295, "autogenerated": false, "ratio": 3.24468085106383, "config_test": fa...
from flask import request, Blueprint, Response # Import the database object (db) from the main application module # and the app object to initialize the flask_login manager from app import app, db # Import module models (i.e. User) from app.models.tweets_model import Tweet from app.models.labels_model import Label imp...
{ "repo_name": "THSUPRM/ths-client", "path": "app/controllers/labels_controller.py", "copies": "1", "size": "3852", "license": "mit", "hash": -3230448251923024000, "line_mean": 32.7894736842, "line_max": 111, "alpha_frac": 0.6586188993, "autogenerated": false, "ratio": 3.4796747967479673, "confi...
from flask import _request_ctx_stack as stack, request, abort from werkzeug.local import LocalProxy from functools import wraps import jwt from tenant import Tenant def require_tenant(func): @wraps(func) def inner(*args, **kwargs): assert tenant return func(*args, **kwargs) return inne...
{ "repo_name": "congocongo/flask-hipchat-addon", "path": "flask_hipchat_addon/auth.py", "copies": "1", "size": "1954", "license": "apache-2.0", "hash": -5523985365399185000, "line_mean": 26.9285714286, "line_max": 84, "alpha_frac": 0.5690890481, "autogenerated": false, "ratio": 3.764932562620424, ...
from flask import request, current_app, g from flask.ext.restful import Resource, marshal from ..services import categories, journals from ..core import auth from ..tasks import send_email from .fields import category_fields, full_journal_fields class CategoryListAPI(Resource): """API :class:`Resource` for a li...
{ "repo_name": "dedalusj/PaperChase", "path": "backend/paperchase/api/journals.py", "copies": "1", "size": "1694", "license": "mit", "hash": -2479818325170329600, "line_mean": 24.6666666667, "line_max": 80, "alpha_frac": 0.6688311688, "autogenerated": false, "ratio": 3.9212962962962963, "config_...
from flask import request, current_app, g from flask_restful import abort import jwt import cryptography from cryptography.hazmat.backends import default_backend from functools import wraps from anonymonkey_authority.schemas import User def check_jwt(): if 'Authorization' not in request.headers or request.headers...
{ "repo_name": "hugoatease/anonymonkey-authority", "path": "anonymonkey_authority/api/auth.py", "copies": "1", "size": "1366", "license": "apache-2.0", "hash": -749512155347884300, "line_mean": 30.7674418605, "line_max": 142, "alpha_frac": 0.6647144949, "autogenerated": false, "ratio": 3.815642458...
from flask import request, current_app, g from flask_restful import Resource, marshal_with, reqparse, abort from flask_login import current_user, login_required from atrium.schemas import Media from .fields import news_fields import arrow import bleach from .bleachconfig import ALLOWED_TAGS, ALLOWED_STYLES, ALLOWED_ATT...
{ "repo_name": "hugoatease/atrium", "path": "atrium/api/news.py", "copies": "1", "size": "4660", "license": "apache-2.0", "hash": 2865614813374195000, "line_mean": 35.4140625, "line_max": 136, "alpha_frac": 0.6225321888, "autogenerated": false, "ratio": 3.6635220125786163, "config_test": false, ...
from flask import request, current_app, jsonify from flask.views import MethodView from werkzeug.utils import secure_filename from backend.extensions import mail import os ALLOWED_EXTENSIONS = set(['pdf', 'png', 'jpg', 'jpeg', 'gif']) class Upload(MethodView): def post(self): # check if the post request ...
{ "repo_name": "TornikeNatsvlishvili/writing.skivri.ge", "path": "backend/backend/api/views/upload.py", "copies": "1", "size": "1447", "license": "mit", "hash": 1612358846378962200, "line_mean": 35.2, "line_max": 94, "alpha_frac": 0.6171389081, "autogenerated": false, "ratio": 4.384848484848485, ...
from flask import request, current_app, jsonify from werkzeug.utils import secure_filename from . import api from .errors import bad_request import os import hashlib # upload pdf files @api.route('/upload-file', methods=['POST']) def upload_file(): if request.method == 'POST': # check if the post request ...
{ "repo_name": "conferency/find-my-reviewers", "path": "app/api/upload.py", "copies": "1", "size": "1719", "license": "mit", "hash": -9029623330434420000, "line_mean": 38.0681818182, "line_max": 99, "alpha_frac": 0.6428155905, "autogenerated": false, "ratio": 3.82, "config_test": false, "has_n...
from flask import request, current_app from ..app import sapb1Adaptor from flask_jwt import jwt_required, current_identity from flask_restful import Resource import json import traceback class InfoAPI(Resource): def __init__(self): super(InfoAPI, self).__init__() @jwt_required() def get(self): ...
{ "repo_name": "ideabosque/SAP-B1-RESTful", "path": "flask/api/v1/sapb1api.py", "copies": "1", "size": "6299", "license": "mit", "hash": 2885551582528371700, "line_mean": 35.6220930233, "line_max": 119, "alpha_frac": 0.508652167, "autogenerated": false, "ratio": 4.238896366083446, "config_test":...
from flask import request, current_app from blinker import Namespace from . import models, ext from LOFTER.config import LOFTERSettings search_engine_submit_urls = LOFTERSettings['search_engine_submit_urls'] lofter_signals = Namespace() post_visited = lofter_signals.signal('post-visited') post_pubished = lofter_sign...
{ "repo_name": "0x0004/LOFTER", "path": "app/main/signals.py", "copies": "1", "size": "1641", "license": "apache-2.0", "hash": 3999524805171508000, "line_mean": 29.9811320755, "line_max": 73, "alpha_frac": 0.689213894, "autogenerated": false, "ratio": 3.4547368421052633, "config_test": false, ...
from flask import request, current_app from cifsdk.client.zeromq import ZMQ as Client from cifsdk.client.dummy import Dummy as DummyClient from cif.constants import ROUTER_ADDR from cifsdk.exceptions import TimeoutError, AuthError from ..common import pull_token, jsonify_unauth, jsonify_unknown, jsonify_success from fl...
{ "repo_name": "csirtgadgets/bearded-avenger", "path": "cif/httpd/views/ping.py", "copies": "1", "size": "1096", "license": "mpl-2.0", "hash": -6141129722672551000, "line_mean": 29.4444444444, "line_max": 81, "alpha_frac": 0.651459854, "autogenerated": false, "ratio": 3.9424460431654675, "config...
from flask import request, current_app from cifsdk.client.zeromq import ZMQ as Client from cifsdk.exceptions import AuthError from ..common import pull_token, jsonify_success, jsonify_unauth, jsonify_unknown from flask.views import MethodView from cif.constants import ROUTER_ADDR import logging remote = ROUTER_ADDR T...
{ "repo_name": "csirtgadgets/bearded-avenger", "path": "cif/httpd/views/tokens.py", "copies": "1", "size": "2194", "license": "mpl-2.0", "hash": 5806642561562595000, "line_mean": 23.1098901099, "line_max": 81, "alpha_frac": 0.5838650866, "autogenerated": false, "ratio": 4.203065134099617, "confi...
from flask import request, current_app from datetime import datetime, timedelta from exceptions.handler import UserAlreadyExists from models import db, User, Session import hashlib import jwt def register(username, password): """ Registers a user """ user = User.query.filter_by(username=username).first() ...
{ "repo_name": "andela-ggikera/Bucket-list-app-API", "path": "app/auth.py", "copies": "1", "size": "2069", "license": "mit", "hash": 8857152362637918000, "line_mean": 29.8805970149, "line_max": 74, "alpha_frac": 0.662638956, "autogenerated": false, "ratio": 3.8818011257035647, "config_test": fal...
from flask import request, current_app from marshmallow import fields, pre_dump from sqlalchemy.orm import subqueryload_all from typing import Optional, Tuple from zeus.config import nplusone from zeus.models import Repository, Revision from zeus.utils.builds import fetch_builds_for_revisions from zeus.vcs import vcs_...
{ "repo_name": "getsentry/zeus", "path": "zeus/api/resources/repository_revisions.py", "copies": "1", "size": "3634", "license": "apache-2.0", "hash": -9134344349216593000, "line_mean": 32.3394495413, "line_max": 107, "alpha_frac": 0.578150798, "autogenerated": false, "ratio": 4.051282051282051, ...
from flask import request, current_app from werkzeug.wrappers import Response as ResponseBase from formencode.api import Invalid from sqlalchemy.exc import IntegrityError from werkzeug.exceptions import HTTPException from sqlalchemy import desc, asc from ..common.helper import jsonify_status_string, model_to_dict fro...
{ "repo_name": "pprolancer/flexrest", "path": "flexrest/api/rest_api.py", "copies": "1", "size": "18860", "license": "mit", "hash": -1277781195857022500, "line_mean": 31.5172413793, "line_max": 78, "alpha_frac": 0.5536585366, "autogenerated": false, "ratio": 4.101783384080035, "config_test": fal...
from flask import request, current_app import flask_jigger.views import re class SwaggerDoc(object): def _generate_parameter(self, argument, rule): import werkzeug.routing if isinstance(rule._converters[argument],werkzeug.routing.FloatConverter): datatype = "float" ...
{ "repo_name": "robvanmieghem/flask-jigger", "path": "flask_jigger/livedoc/swagger.py", "copies": "1", "size": "4387", "license": "apache-2.0", "hash": -6695124881305352000, "line_mean": 31.7462686567, "line_max": 93, "alpha_frac": 0.4552085708, "autogenerated": false, "ratio": 5.167255594817433, ...
from flask import request, current_app from sqlalchemy.exc import OperationalError from models import Hunt, Participant, Item, Admin, Setting from hunt import bcrypt import copy import time def valid_login(admin, email, password): return admin and bcrypt.check_password_hash( admin.pw_hash, password) ...
{ "repo_name": "Saltbox/mobile-scavenger-hunt", "path": "utils.py", "copies": "1", "size": "4131", "license": "apache-2.0", "hash": 2595533779751255000, "line_mean": 27.6875, "line_max": 94, "alpha_frac": 0.6434277415, "autogenerated": false, "ratio": 3.4168734491315136, "config_test": false, ...
from flask import request, current_app, render_template, redirect, url_for, \ abort, flash, make_response from flask.ext.login import current_user, login_required from flask.ext.sqlalchemy import get_debug_queries from .. import db from ..decorators import admin_required, permission_required from ..models import User,...
{ "repo_name": "lancecopper/flasky_blog", "path": "app/main/views.py", "copies": "1", "size": "8941", "license": "mit", "hash": -4229357855445406700, "line_mean": 33.92578125, "line_max": 94, "alpha_frac": 0.7232971703, "autogenerated": false, "ratio": 3.0873618784530388, "config_test": true, ...
from flask import request, current_app, render_template, url_for, jsonify from flask_restful import Resource, reqparse, marshal_with, abort, marshal from flask_login import current_user, login_required from .fields import survey_fields from anonymonkey.schemas import Survey, Question, QuestionOption, User, Answer impor...
{ "repo_name": "hugoatease/anonymonkey", "path": "anonymonkey/api/survey.py", "copies": "1", "size": "3115", "license": "apache-2.0", "hash": -7061438788385821000, "line_mean": 32.4946236559, "line_max": 93, "alpha_frac": 0.5833065811, "autogenerated": false, "ratio": 4.284731774415405, "config_...
from flask import request, current_app, url_for, jsonify, g from . import api from .. import db from ..models import Post, Comment # 获取分页评论 @api.route('/comments/') def get_comments(): # 获取当前页 page = request.args.get('page', 1, type=int) pagination = Comment.query.order_by(Comment.timestamp.desc()).pagina...
{ "repo_name": "Widiot/simpleblog", "path": "simple/api_1_0/comments.py", "copies": "1", "size": "2268", "license": "mit", "hash": -9114337522576631000, "line_mean": 27.4210526316, "line_max": 78, "alpha_frac": 0.6273148148, "autogenerated": false, "ratio": 3.004172461752434, "config_test": fals...
from flask import request,current_app,url_for,jsonify from ..models import Comment,Post,db from authentication import api from decorators import permission_required from ..models import Permission @api.route('/comments/') def get_comments(): page = request.args.get('page',1,type=int) pagination =Comment.quer...
{ "repo_name": "Unicomcat/flask_test", "path": "app/api_1_0/comments.py", "copies": "1", "size": "2410", "license": "mit", "hash": 7742944004372662000, "line_mean": 34.9701492537, "line_max": 118, "alpha_frac": 0.6049792531, "autogenerated": false, "ratio": 3.7019969278033793, "config_test": fal...
from flask import request, current_app, url_for from flask_jsonschema import validate from .. import db from ..models import AHBot as Bot from .decorators import json_response from . import api @api.route('/abusehelper', methods=['GET']) @json_response def get_abusehelper(): """Return a list of available abusehel...
{ "repo_name": "certeu/do-portal", "path": "app/api/abusehelper.py", "copies": "1", "size": "5478", "license": "bsd-3-clause", "hash": 1798716680388777200, "line_mean": 22.7142857143, "line_max": 71, "alpha_frac": 0.5996714129, "autogenerated": false, "ratio": 3.752054794520548, "config_test": f...
from flask import request, flash from marketing_notifications_python.forms import SendMessageForm from marketing_notifications_python.models import init_models_module from marketing_notifications_python.twilio import init_twilio_module from marketing_notifications_python.view_helpers import twiml, view from flask impor...
{ "repo_name": "devopsec/threatdetectionservice", "path": "api/notification/twilio/views.py", "copies": "1", "size": "2739", "license": "apache-2.0", "hash": -2651495589161869000, "line_mean": 39.8955223881, "line_max": 116, "alpha_frac": 0.6600949252, "autogenerated": false, "ratio": 4.3201892744...
from flask import request, flash, redirect, render_template, url_for, current_app, session from flask.ext.login import login_user, logout_user, current_user, login_required from flask.ext.bcrypt import Bcrypt from vmb_db.user_info import get_user_by_name # from db import loadUserByUsername from .. import db def logi...
{ "repo_name": "cindy-zimmerman/vmb-mrest", "path": "flask_mrest/actions/authentication.py", "copies": "1", "size": "1458", "license": "mit", "hash": 8136789810986569000, "line_mean": 28.7551020408, "line_max": 98, "alpha_frac": 0.6899862826, "autogenerated": false, "ratio": 3.826771653543307, "...
from flask import request, flash, redirect, session, current_app, Blueprint from frasco.helpers import url_for from frasco.ext import get_extension_state from frasco.users.user import login_user, is_user_logged_in, current_user, validate_user_email from frasco.users.model import UserEmailValidatedMixin from frasco.mode...
{ "repo_name": "frascoweb/frasco", "path": "frasco/users/auth/oauth.py", "copies": "1", "size": "7479", "license": "mit", "hash": -2814068135123378000, "line_mean": 35.842364532, "line_max": 147, "alpha_frac": 0.6567722958, "autogenerated": false, "ratio": 3.6842364532019705, "config_test": fals...
from flask import request, flash, redirect, url_for from flask.ext.login import login_user, logout_user, login_required, current_user from psbackend import app from psbackend import templateutil from psbackend.models.user import * from psbackend.forms.user import RegisterForm, LoginForm @app.route('/user') @login_req...
{ "repo_name": "aabmass/pswebsite", "path": "psbackend/views/userviews.py", "copies": "1", "size": "2091", "license": "apache-2.0", "hash": -5142028092984391000, "line_mean": 33.2786885246, "line_max": 81, "alpha_frac": 0.6867527499, "autogenerated": false, "ratio": 3.886617100371747, "config_te...
from flask import request, flash, render_template, redirect, url_for from markov import MarkovGenerator from model import Resource from webapp import app, text_files, db from webapp.forms import UploadForm, GeneratorForm def get_generator_form(): files = Resource.query.all() if len(files) == 0: return...
{ "repo_name": "httpPrincess/b2report", "path": "webapp/views.py", "copies": "1", "size": "1984", "license": "bsd-2-clause", "hash": 2214431200377587500, "line_mean": 29.5230769231, "line_max": 75, "alpha_frac": 0.6123991935, "autogenerated": false, "ratio": 4.048979591836734, "config_test": fal...
from flask import request, flash, render_template, url_for, redirect, abort, Blueprint, g from aalert import app, db from flask_login import login_required, logout_user, login_user, current_user from aalert.forms import * from aalert.models import * from sqlalchemy_searchable import search from flask_admin import Admin...
{ "repo_name": "nravic/py-amber_alert", "path": "aalert/views.py", "copies": "1", "size": "2721", "license": "mit", "hash": -8558211985902294000, "line_mean": 33.0125, "line_max": 89, "alpha_frac": 0.6692392503, "autogenerated": false, "ratio": 3.7273972602739724, "config_test": false, "has_no...
from flask import request, flash, url_for, current_app as app from flask_admin import expose from flask_login import current_user from werkzeug.utils import redirect from feedrsub.admin.forms import SubscribeForm from feedrsub.admin.views import SecuredView from feedrsub.feeds.search_manager import FeedSearchManager f...
{ "repo_name": "DBeath/flask-feedrsub", "path": "feedrsub/admin/views/subscribe_view.py", "copies": "1", "size": "2490", "license": "mit", "hash": -3261537117816640500, "line_mean": 39.8196721311, "line_max": 84, "alpha_frac": 0.5751004016, "autogenerated": false, "ratio": 4.227504244482173, "co...
from flask import request, flash, url_for, redirect, render_template, abort, g, Blueprint, Response from app import db, app, login_manager from app.helpers import get_following_posts, get_self_posts, Messages from app.user.models import User from app.posts.models import Posts from flask.ext.login import login_user, log...
{ "repo_name": "hassaanaliw/flaskbook", "path": "app/user/views.py", "copies": "1", "size": "5636", "license": "mit", "hash": 2196840809051175400, "line_mean": 30.138121547, "line_max": 99, "alpha_frac": 0.6541873669, "autogenerated": false, "ratio": 3.6860693263570963, "config_test": false, "...
from flask import request, flash, url_for, render_template from flask import url_for, get_flashed_messages from flask import redirect as flask_redirect from flask import jsonify as flask_jsonify def abs_url_for(*args, **kwargs): return "http://tardyrush.com%s" % url_for(*args, **kwargs) def jsonify(*args, **kwarg...
{ "repo_name": "kenrobbins/tardyrush", "path": "tardyrush/helpers/__init__.py", "copies": "1", "size": "1140", "license": "mit", "hash": 3778250750774219000, "line_mean": 33.5454545455, "line_max": 76, "alpha_frac": 0.6464912281, "autogenerated": false, "ratio": 3.6538461538461537, "config_test"...
from flask import Request, Flask, flash, session, redirect, render_template, request, url_for, Blueprint, g from flask.ext.login import login_user, logout_user, current_user, login_required from app import mongo, lm from .forms import LoginForm, SignupForm, NewCharacterTemplateForm, NewCharacterForm from datetime impor...
{ "repo_name": "redvox/turbosheet", "path": "app/views.py", "copies": "1", "size": "4475", "license": "bsd-3-clause", "hash": -3683002689015608300, "line_mean": 30.9642857143, "line_max": 107, "alpha_frac": 0.5881564246, "autogenerated": false, "ratio": 4.049773755656108, "config_test": false, ...
from flask import request, Flask from flask.ext.admin import Admin, BaseView, expose, AdminIndexView from flask import redirect, url_for import logging # Importing local files import sys import os path = os.path.dirname(__file__) if path not in sys.path: sys.path.append(path) import models import settings # The...
{ "repo_name": "gregorymfoster/honeypot", "path": "honeypot/honeypot/www/app.py", "copies": "1", "size": "3130", "license": "apache-2.0", "hash": 855635221842975100, "line_mean": 29.3883495146, "line_max": 77, "alpha_frac": 0.6041533546, "autogenerated": false, "ratio": 3.83108935128519, "config...
from flask import request, Flask from st2reactor.sensor.base import Sensor class EchoFlaskSensor(Sensor): def __init__(self, sensor_service, config): super(EchoFlaskSensor, self).__init__( sensor_service=sensor_service, config=config ) self._host = "127.0.0.1" self._p...
{ "repo_name": "StackStorm/st2", "path": "contrib/examples/sensors/echo_flask_app.py", "copies": "3", "size": "1392", "license": "apache-2.0", "hash": 5843047052747821000, "line_mean": 26.2941176471, "line_max": 71, "alpha_frac": 0.5682471264, "autogenerated": false, "ratio": 4.218181818181818, ...
from flask import request, g, abort, jsonify from pyinfraboxutils import get_env, print_stackdriver, get_logger from pyinfraboxutils.ibflask import token_required, app logger = get_logger('docker-registry-auth') @app.route('/ping') def ping(): return jsonify({'status': 200}) @app.route('/v2/') # prevent 301 red...
{ "repo_name": "InfraBox/infrabox", "path": "src/docker-registry/auth/server.py", "copies": "1", "size": "3609", "license": "mit", "hash": 7748097465665416000, "line_mean": 27.4173228346, "line_max": 76, "alpha_frac": 0.5544472153, "autogenerated": false, "ratio": 3.720618556701031, "config_test...
from flask import request, g, abort from flask_restplus import Resource, fields from pyinfraboxutils.ibflask import auth_required, OK from pyinfraboxutils.ibrestplus import api from api.namespaces import project as ns collaborator_model = api.model('Collaborator', { 'name': fields.String(required=True), 'id'...
{ "repo_name": "InfraBox/infrabox", "path": "src/api/handlers/projects/collaborators.py", "copies": "1", "size": "3112", "license": "mit", "hash": 2744147248768861000, "line_mean": 28.6380952381, "line_max": 97, "alpha_frac": 0.5777634961, "autogenerated": false, "ratio": 3.726946107784431, "con...
from flask import request, g, abort from flask_restplus import Resource, fields from pyinfrabox.utils import validate_uuid4 from pyinfraboxutils.ibflask import auth_required, OK from pyinfraboxutils.ibrestplus import api from pyinfraboxutils.token import encode_project_token from api.namespaces import project as ns p...
{ "repo_name": "InfraBox/infrabox", "path": "src/api/handlers/projects/tokens.py", "copies": "1", "size": "2521", "license": "mit", "hash": 6372353895302787000, "line_mean": 31.3205128205, "line_max": 84, "alpha_frac": 0.5993653312, "autogenerated": false, "ratio": 3.7459138187221397, "config_te...
from flask import request, g, Blueprint, abort from kancolle.helpers import AdmiralHelper, MemberHelper from db import Admiral from db import db, Kanmusu from kancolle.helpers import DockHelper from util import prepare_api_blueprint from util import svdata api_actions = Blueprint('api_actions', __name__) ...
{ "repo_name": "KanColleTool/kcsrv", "path": "kancolle/api/actions.py", "copies": "1", "size": "8864", "license": "mit", "hash": 7276160951727273000, "line_mean": 32.4251968504, "line_max": 105, "alpha_frac": 0.5966376944, "autogenerated": false, "ratio": 3.017253278122843, "config_test": false,...
from flask import request, g, Blueprint, Response from flask_login import LoginManager, login_user, logout_user, current_user # Import the database object (db) from the main application module # and the app object to initialize the flask_login manager from app import app, db # Import module models (i.e. User) from app...
{ "repo_name": "THSUPRM/ths-client", "path": "app/controllers/auth_controller.py", "copies": "1", "size": "2593", "license": "mit", "hash": -4917565818992441000, "line_mean": 35.5211267606, "line_max": 135, "alpha_frac": 0.6945622831, "autogenerated": false, "ratio": 3.7798833819241984, "config_...
from flask import request, g, Blueprint, Response # Import the database object (db) from the main application module # and the app object to initialize the flask_login manager from app import app, db # Import module models (i.e. User) from app.models.auth_model import User # Define the blueprint: 'profile', set its u...
{ "repo_name": "THSUPRM/ths-client", "path": "app/controllers/profile_controller.py", "copies": "1", "size": "1812", "license": "mit", "hash": -4266264209389824500, "line_mean": 34.5294117647, "line_max": 83, "alpha_frac": 0.6782560706, "autogenerated": false, "ratio": 3.9220779220779223, "confi...
from flask import request, g, current_app, jsonify, url_for from . import api from ..models import Post, Permission from .decorators import permission_required from .errors import forbidden from app import db @api.route('/posts/') def get_posts(): page = request.args.get('page', 1, type=int) pagination = Post.query....
{ "repo_name": "Ivicel/flasky", "path": "app/api_1_0/post.py", "copies": "1", "size": "2419", "license": "apache-2.0", "hash": -6822300851246575000, "line_mean": 30.4285714286, "line_max": 76, "alpha_frac": 0.6965688301, "autogenerated": false, "ratio": 2.8661137440758293, "config_test": false, ...
from flask import request, g, jsonify, abort, url_for, current_app from .. import db from ..models import Post, Permission from . import api from .errors import forbidden from .decorators import permission_required """ REST 架构 API 中使用的 HTTP 请求方法: 请求方法 ---- 目标 ---- 说明 ---- HTTP状态码 -----------------------------...
{ "repo_name": "Blackyukun/Simpleblog", "path": "app/api_1_0/posts.py", "copies": "1", "size": "2737", "license": "mit", "hash": -6248222139217900000, "line_mean": 32.676056338, "line_max": 105, "alpha_frac": 0.6219155165, "autogenerated": false, "ratio": 2.607415485278081, "config_test": false,...
from flask import request, g, jsonify, current_app, url_for from . import api from .errors import forbidden from .decorators import permission_required from .. import db from ..models import Post, Permission # 发表文章 @api.route('/posts/', methods=['POST']) @permission_required(Permission.WRITE_ARTICLES) def new_post():...
{ "repo_name": "Widiot/simpleblog", "path": "simple/api_1_0/posts.py", "copies": "1", "size": "1809", "license": "mit", "hash": 311977361846535800, "line_mean": 28, "line_max": 78, "alpha_frac": 0.6410401357, "autogenerated": false, "ratio": 3.1309734513274337, "config_test": false, "has_no_ke...
from flask import request, g, jsonify from flask.ext.login import login_user, logout_user, current_user, \ login_required from sqlalchemy import func from app import app, db, lm from app.models import News, Author, Tag, User, news_author, news_tag, Comments from config import NEWS_PER_PAGE @app.route('/_login', ...
{ "repo_name": "dnaroid/laser-server", "path": "app/views.py", "copies": "1", "size": "8213", "license": "bsd-3-clause", "hash": -2336346862084509700, "line_mean": 25.5792880259, "line_max": 79, "alpha_frac": 0.6045294046, "autogenerated": false, "ratio": 3.1323417238749047, "config_test": false...
from flask import request, g, jsonify from flask_restful import Resource, reqparse from models import BucketList, db, app import datetime from user_auth import auth, verify_password def make_single_public(item): """Method to make BucketList items json compatible""" output = [] bucketlists = {} bucket...
{ "repo_name": "andela-engmkwalusimbi/checkpoints", "path": "apiviews/bucketlist.py", "copies": "1", "size": "7851", "license": "mit", "hash": -5709028031781974000, "line_mean": 37.1116504854, "line_max": 95, "alpha_frac": 0.590625398, "autogenerated": false, "ratio": 4.178286322511974, "config_...
from flask import request, g, jsonify from . import app from .lib import ( admin_endpoint, authenticated_endpoint, quote_belongs_to_user, has_made_too_many_reports) from .models import QSTATUS, db, ReportedQuotes, Quote, VoteToUser @app.route('/api/v1/quotes/<int:quote_id>/approve', methods=['POST']) @admin_...
{ "repo_name": "stesh/porick-flask", "path": "porick/api.py", "copies": "1", "size": "4983", "license": "apache-2.0", "hash": -1649587555870524000, "line_mean": 34.5928571429, "line_max": 88, "alpha_frac": 0.5942203492, "autogenerated": false, "ratio": 3.740990990990991, "config_test": false, ...
from flask import request, g from flask_restful import Resource, abort, marshal_with, fields, reqparse from dynoup import db from apiv1.views import api from scaler.utils import get_heroku_client_for_session from scaler import models, actions class AppList(Resource): def get(self): heroku = get_heroku_cl...
{ "repo_name": "sibson/dynoup", "path": "apiv1/apps.py", "copies": "1", "size": "2922", "license": "mit", "hash": 5818674426149629000, "line_mean": 28.22, "line_max": 88, "alpha_frac": 0.5989048597, "autogenerated": false, "ratio": 3.4095682613768963, "config_test": false, "has_no_keywords": f...
from flask import request, g from flask_restplus import abort, Resource, Namespace, fields, abort, reqparse from app.models.user import User from sqlalchemy import desc from app.utils.utilities import validate_email, auth user_api = Namespace( 'users', description='User details') user_fields = user_api.model( ...
{ "repo_name": "Elbertbiggs360/buckelist-api", "path": "app/api/v1/user.py", "copies": "1", "size": "2340", "license": "mit", "hash": -3264542022972772000, "line_mean": 40.0526315789, "line_max": 119, "alpha_frac": 0.6478632479, "autogenerated": false, "ratio": 3.7083993660855783, "config_test":...
from flask import request, g from flask_restplus import abort, Resource, Namespace, fields from app.models.user import User from app.utils.utilities import validate_email, auth auth_api = Namespace( 'auth', description='User authentication and registration') user_fields = auth_api.model( 'User', { ...
{ "repo_name": "Elbertbiggs360/buckelist-api", "path": "app/api/v1/auth.py", "copies": "1", "size": "4256", "license": "mit", "hash": -7367269489225322000, "line_mean": 40.3203883495, "line_max": 109, "alpha_frac": 0.6134868421, "autogenerated": false, "ratio": 4.230616302186879, "config_test": ...