text
stringlengths
0
1.05M
meta
dict
from flask_login import current_user from flask_security.forms import ( Form, EqualTo, Length, PasswordField, PasswordFormMixin, password_required, ) from flask_security.utils import get_message, verify_and_update_password password_length = Length(min=8, max=128, messag...
{ "repo_name": "briancappello/flask-react-spa", "path": "backend/security/forms.py", "copies": "1", "size": "1320", "license": "mit", "hash": -2334838667007302700, "line_mean": 29, "line_max": 82, "alpha_frac": 0.6666666667, "autogenerated": false, "ratio": 4.313725490196078, "config_test": fals...
from flask_login import current_user from flask_socketio import emit, disconnect from time import sleep from home.core import utils as utils, parser as parser from home.core.models import get_action, get_interface, widgets, MultiDevice from home.core.tasks import run from home.core.utils import random_string from home...
{ "repo_name": "keaneokelley/home", "path": "home/web/events.py", "copies": "1", "size": "6749", "license": "mit", "hash": 8617839852796625000, "line_mean": 37.1299435028, "line_max": 109, "alpha_frac": 0.5615646762, "autogenerated": false, "ratio": 4.163479333744602, "config_test": true, "has...
from flask_login import current_user from flask_sqlalchemy import BaseQuery from sqlalchemy import func, select from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy.orm import object_session from sqlalchemy_utils import UUIDType from annotator.extensions import db class ProblemQuery(BaseQuery): def ...
{ "repo_name": "planbrothers/ml-annotate", "path": "annotator/models/problem.py", "copies": "1", "size": "1688", "license": "mit", "hash": 825271888120062800, "line_mean": 23.4637681159, "line_max": 58, "alpha_frac": 0.6095971564, "autogenerated": false, "ratio": 4.137254901960785, "config_test"...
from flask_login import current_user from flask_wtf import FlaskForm from wtforms import ValidationError, validators from wtforms.fields import BooleanField, StringField CONSENT_ERROR_MESSAGE = "Your consent is required to continue." class ConsentForm(FlaskForm): profile = BooleanField( "I consent to fet...
{ "repo_name": "jazzband/jazzband-site", "path": "jazzband/account/forms.py", "copies": "2", "size": "1593", "license": "mit", "hash": -5317662090751795000, "line_mean": 37.756097561, "line_max": 84, "alpha_frac": 0.6853366897, "autogenerated": false, "ratio": 4.553008595988539, "config_test": f...
from flask_login import current_user from flask_wtf import FlaskForm from wtforms import validators, ValidationError from wtforms.fields import BooleanField, StringField CONSENT_ERROR_MESSAGE = "Your consent is required to continue." class ConsentForm(FlaskForm): profile = BooleanField( "I consent to fet...
{ "repo_name": "jazzband/site", "path": "jazzband/account/forms.py", "copies": "1", "size": "1591", "license": "mit", "hash": 4004502255261484000, "line_mean": 37.7073170732, "line_max": 84, "alpha_frac": 0.6849401386, "autogenerated": false, "ratio": 4.521367521367521, "config_test": false, "...
from flask_login import current_user from flask_wtf import Form from wtforms import ( SelectField, StringField, SubmitField, ) from wtforms.validators import ( Length, Email, DataRequired ) from app.lib.db_utils import get_agency_choices from app.models import Agencies class ActivateAgencyUse...
{ "repo_name": "CityOfNewYork/NYCOpenRecords", "path": "app/admin/forms.py", "copies": "1", "size": "3311", "license": "apache-2.0", "hash": -8478951960410397000, "line_mean": 37.9529411765, "line_max": 115, "alpha_frac": 0.5400181214, "autogenerated": false, "ratio": 4.082614056720098, "config_...
from flask_login import current_user from jsonschema import Draft4Validator from jsonschema.exceptions import best_match import logging from dart.model.exception import DartValidationException _logger = logging.getLogger(__name__) def apply_defaults(instance, schema): if not schema or not instance: retur...
{ "repo_name": "RetailMeNotSandbox/dart", "path": "src/python/dart/schema/base.py", "copies": "1", "size": "2829", "license": "mit", "hash": 2335791550881277000, "line_mean": 32.2823529412, "line_max": 156, "alpha_frac": 0.5733474726, "autogenerated": false, "ratio": 3.6503225806451614, "config_...
from flask_login import current_user from .models import Location, Brewery def get_manageable_locations(type): manageable_locations = [] if type == "brewery": if current_user.is_admin: manageable_locations = Brewery.query.all() elif current_user.is_brewer: manageable_lo...
{ "repo_name": "CapitalD/taplist", "path": "app/helper_functions.py", "copies": "1", "size": "1340", "license": "mit", "hash": -6406152174574082000, "line_mean": 37.2857142857, "line_max": 105, "alpha_frac": 0.6373134328, "autogenerated": false, "ratio": 3.681318681318681, "config_test": false, ...
from flask_login import current_user from portality.core import app from portality import models # query sanitisers ################## def public_query_validator(q): # no deep paging if q.from_result() > 10000: return False if q.size() > 200: return False return True # query filter...
{ "repo_name": "DOAJ/doaj", "path": "portality/lib/query_filters.py", "copies": "1", "size": "8906", "license": "apache-2.0", "hash": 6070054187544629000, "line_mean": 24.3760683761, "line_max": 137, "alpha_frac": 0.473164159, "autogenerated": false, "ratio": 3.7897872340425534, "config_test": f...
from flask_login import current_user from portality import models, lock from portality.core import app from portality.tasks.redis_huey import main_queue from portality.decorators import write_required from portality.background import BackgroundTask, BackgroundApi, BackgroundSummary import json def change_by_query(q...
{ "repo_name": "DOAJ/doaj", "path": "portality/tasks/journal_in_out_doaj.py", "copies": "1", "size": "4481", "license": "apache-2.0", "hash": -7213851100608611000, "line_mean": 32.946969697, "line_max": 133, "alpha_frac": 0.6373577326, "autogenerated": false, "ratio": 3.7404006677796326, "config...
from flask_login import current_user import sendgrid import os def body_tag_args(): classes = [] args = {} if current_user.is_authenticated: classes.append('loggedin') args['dataUserName'] = current_user.username # args['dataUserEmail'] = current_user.full_name args['dataU...
{ "repo_name": "opendatadurban/healthtools-citypress", "path": "healthtools_ec/helpers.py", "copies": "1", "size": "3107", "license": "apache-2.0", "hash": 3905180302908512000, "line_mean": 28.875, "line_max": 158, "alpha_frac": 0.5030576118, "autogenerated": false, "ratio": 3.7798053527980535, ...
from flask_login import current_user from app.globals import get_answer_store from app.jinja_filters import format_household_member_name from app.questionnaire_state.state_repeating_answer_question import RepeatingAnswerStateQuestion class RelationshipStateQuestion(RepeatingAnswerStateQuestion): def __init__(sel...
{ "repo_name": "qateam123/eq", "path": "app/questionnaire_state/relationship_state_question.py", "copies": "1", "size": "2186", "license": "mit", "hash": -3275940428757100500, "line_mean": 43.612244898, "line_max": 121, "alpha_frac": 0.6532479414, "autogenerated": false, "ratio": 4.003663003663004...
from flask_login import current_user from polaris.exc import OwnerNotSetError from polaris.models import db, Chart, Dashboard, Group, GroupMember def can_view_chart(chart_uuid): chart = db.session.query(Chart).get(chart_uuid) if not chart: return False if current_user.is_superadmin or chart.is_p...
{ "repo_name": "eleme/polaris", "path": "polaris/auth/principal.py", "copies": "1", "size": "3644", "license": "mit", "hash": 8201932665461027000, "line_mean": 27.6929133858, "line_max": 74, "alpha_frac": 0.6232162459, "autogenerated": false, "ratio": 3.819706498951782, "config_test": true, "h...
from flask_login import current_user import util.testing import views.user from uri.main import * from uri.user import * class TestUser(util.testing.DatabaseTestCase): def test_user_login_interface(self): self.assertIn('Log in to view, control, and delete your pastes', views.user.user_login_interface()) ...
{ "repo_name": "LINKIWI/modern-paste", "path": "tests/test_views/test_user.py", "copies": "1", "size": "2479", "license": "mit", "hash": 5507226982133522000, "line_mean": 46.6730769231, "line_max": 126, "alpha_frac": 0.709963695, "autogenerated": false, "ratio": 4.057283142389525, "config_test":...
from flask_login import LoginManager, current_user from flask import request, current_app from taskcluster.utils import scope_match from functools import wraps import structlog import taskcluster logger = structlog.get_logger('backend_common.auth') class BaseUser(object): anonymous = False type = None ...
{ "repo_name": "andrei987/services", "path": "lib/backend_common/backend_common/auth.py", "copies": "1", "size": "6385", "license": "mpl-2.0", "hash": 4029223647094529500, "line_mean": 27.127753304, "line_max": 120, "alpha_frac": 0.5859044636, "autogenerated": false, "ratio": 4.480701754385965, ...
from flask_login import LoginManager, login_required, login_user, \ current_user, logout_user from flask import render_template, request, redirect, url_for from models.user import User import passwordmeter import logging from configuration.configuration import Configurator configurator = Configurator() def regis...
{ "repo_name": "eregnier/checkme", "path": "auth.py", "copies": "1", "size": "3290", "license": "mit", "hash": -5373280267782717000, "line_mean": 29.1834862385, "line_max": 76, "alpha_frac": 0.5927051672, "autogenerated": false, "ratio": 4.207161125319693, "config_test": true, "has_no_keywords...
from flask_login import LoginManager, login_user, logout_user, current_user from flask import redirect, abort, session from functools import wraps from passlib.hash import pbkdf2_sha256 as hashf from tantalus.appfactory import flash from tantalus_db.base import db from tantalus_db.models import Session, User, Relatio...
{ "repo_name": "thijsmie/tantalus", "path": "src/tantalus/appfactory/auth.py", "copies": "1", "size": "5705", "license": "mit", "hash": 7447818970990230000, "line_mean": 29.6720430108, "line_max": 128, "alpha_frac": 0.6653812445, "autogenerated": false, "ratio": 4.0119549929676515, "config_test"...
from flask_login import LoginManager, login_user, logout_user, current_user from flask_bcrypt import Bcrypt from flask import redirect from imp_flask.core import flash from functools import wraps from imp_flask.models.auth import User from imp_flask.extensions import LOG, db # Random session key generation, ...
{ "repo_name": "thijsmie/imp_flask", "path": "imp_flask/core/auth.py", "copies": "1", "size": "3207", "license": "mit", "hash": 7052992824963207000, "line_mean": 27.9719626168, "line_max": 124, "alpha_frac": 0.6598066729, "autogenerated": false, "ratio": 4.074968233799238, "config_test": false, ...
from flask_login import LoginManager from flask import jsonify from taskplus.apps.rest.repositories import UsersRepository login_manager = LoginManager() @login_manager.user_loader def user_loader(name): repository = UsersRepository() response = repository.list(filters=dict(name=name)) if not response...
{ "repo_name": "Himon-SYNCRAFT/taskplus", "path": "taskplus/apps/rest/auth.py", "copies": "1", "size": "1113", "license": "bsd-3-clause", "hash": -1289848967038473700, "line_mean": 21.26, "line_max": 59, "alpha_frac": 0.697214735, "autogenerated": false, "ratio": 3.9468085106382977, "config_test...
from flask_login import LoginManager, user_logged_in, login_user, logout_user from sqlalchemy.orm.exc import NoResultFound import hashlib import hmac import time import logging from flask import redirect, request, jsonify, url_for from werkzeug.exceptions import Unauthorized from redash import models, settings from r...
{ "repo_name": "44px/redash", "path": "redash/authentication/__init__.py", "copies": "2", "size": "7951", "license": "bsd-2-clause", "hash": 3322834578939909600, "line_mean": 31.5860655738, "line_max": 126, "alpha_frac": 0.6498553641, "autogenerated": false, "ratio": 3.5574944071588366, "config_...
from flask_login import LoginManager, user_logged_in import hashlib import hmac import time import logging from flask import redirect, request, jsonify from redash import models, settings from redash.authentication import google_oauth, saml_auth from redash.authentication.org_resolving import current_org from redash....
{ "repo_name": "olivetree123/redash-x", "path": "redash/authentication/__init__.py", "copies": "1", "size": "4085", "license": "bsd-2-clause", "hash": -5741415979715182000, "line_mean": 28.8175182482, "line_max": 108, "alpha_frac": 0.6641370869, "autogenerated": false, "ratio": 3.5185185185185186,...
from flask_login import LoginManager, user_logged_in import hashlib import hmac import time import logging from flask import redirect, request, jsonify, url_for from redash import models, settings from redash.authentication.org_resolving import current_org from redash.authentication import google_oauth, saml_auth, re...
{ "repo_name": "akariv/redash", "path": "redash/authentication/__init__.py", "copies": "1", "size": "5022", "license": "bsd-2-clause", "hash": -5291423009097371000, "line_mean": 30.5849056604, "line_max": 126, "alpha_frac": 0.6587017125, "autogenerated": false, "ratio": 3.502092050209205, "confi...
from flask_login import LoginManager, UserMixin, login_user, logout_user, current_user, login_required from werkzeug.security import generate_password_hash, check_password_hash import ctf class User(UserMixin, ctf.db.Model): __tablename__ = 'users' id = ctf.db.Column(ctf.db.Integer, primary_key=True) user...
{ "repo_name": "abdesslem/CTF", "path": "models.py", "copies": "2", "size": "1692", "license": "mit", "hash": -2522082746328095000, "line_mean": 36.6, "line_max": 102, "alpha_frac": 0.6719858156, "autogenerated": false, "ratio": 3.0875912408759123, "config_test": false, "has_no_keywords": fals...
from flask_login import LoginManager, UserMixin from flask import Request import ast import os from itsdangerous import URLSafeTimedSerializer, BadSignature import base64 from authorizers import FileAuthorizer from authenticators import FileAuthenticator ''' References: * https://flask-login.readthedocs.io/en/lat...
{ "repo_name": "seomoz/roger-mesos", "path": "aaad/sessions.py", "copies": "1", "size": "4037", "license": "apache-2.0", "hash": 1738372503202609200, "line_mean": 36.3796296296, "line_max": 171, "alpha_frac": 0.7020064404, "autogenerated": false, "ratio": 3.946236559139785, "config_test": false,...
from flask_login import login_required, current_user import NodeDefender from itsdangerous import URLSafeSerializer from flask import Blueprint, render_template from flask_login import login_required admin_view = Blueprint('admin_view', __name__, template_folder="templates/admin", static_folder="...
{ "repo_name": "CTSNE/NodeDefender", "path": "NodeDefender/frontend/views/__init__.py", "copies": "1", "size": "2779", "license": "mit", "hash": 3405043809522302000, "line_mean": 38.7, "line_max": 81, "alpha_frac": 0.7063691976, "autogenerated": false, "ratio": 3.8758716875871686, "config_test":...
from flask_login import login_required, login_user, logout_user, current_user from flask import render_template, url_for, redirect, flash, request, \ render_template_string, abort from . import auth from .forms import LoginForm, RegistrationForm, ChangePasswordForm, \ ChangeEmailForm, ResetPasswordForm, ConfirmNewPas...
{ "repo_name": "Ivicel/flasky", "path": "app/auth/views.py", "copies": "1", "size": "5164", "license": "apache-2.0", "hash": 2055464596553865700, "line_mean": 34.8611111111, "line_max": 79, "alpha_frac": 0.7321843532, "autogenerated": false, "ratio": 3.274571972098922, "config_test": false, "h...
from flask_login import login_required from flask_cors import cross_origin from flask import Blueprint, make_response, jsonify, request, abort from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.decomposition import LatentDirichletAllocation from app import db # instantiate the module's blueprint ...
{ "repo_name": "michaelnetbiz/mistt-solution", "path": "app/controllers/closeouts.py", "copies": "1", "size": "4168", "license": "mit", "hash": -7558136957379887000, "line_mean": 36.5585585586, "line_max": 114, "alpha_frac": 0.677303263, "autogenerated": false, "ratio": 3.3211155378486055, "conf...
from flask_login import login_required from flask.json import jsonify from tantalus_db.models import PosEndpoint, PosProduct, PosSale, Product, Group, BtwType, Relation, Transaction, User from tantalus.appfactory.auth import ensure_user_api from tantalus.web.routers import bp_api as router from config import config ...
{ "repo_name": "thijsmie/tantalus", "path": "src/tantalus/web/api.py", "copies": "1", "size": "1722", "license": "mit", "hash": 3237660707136414000, "line_mean": 30.3090909091, "line_max": 117, "alpha_frac": 0.6016260163, "autogenerated": false, "ratio": 3.8523489932885906, "config_test": false,...
from flask_login import login_required from wcontrol.src.app import app from wcontrol.src.models import db import wcontrol.src.views as view import sys @app.route('/') @app.route('/index') @login_required def index(): return view.index() @app.route('/authorize/<provider>') def oauth_authorize(provider): ret...
{ "repo_name": "pahumadad/weight-control", "path": "wcontrol/src/main.py", "copies": "1", "size": "1544", "license": "mit", "hash": 8188153311963542000, "line_mean": 19.5866666667, "line_max": 78, "alpha_frac": 0.682642487, "autogenerated": false, "ratio": 3.3347732181425487, "config_test": fals...
from flask_login import login_required from waitlist.blueprints.settings import add_menu_entry from flask.templating import render_template from waitlist.permissions import perm_manager from waitlist.utility.settings import sget_motd_hq, sget_motd_vg,\ sset_motd_hq, sset_motd_vg from flask.blueprints import Bluep...
{ "repo_name": "SpeedProg/eve-inc-waitlist", "path": "waitlist/blueprints/settings/fleet_motd.py", "copies": "1", "size": "1484", "license": "mit", "hash": 2224755139941046500, "line_mean": 25.9818181818, "line_max": 77, "alpha_frac": 0.692722372, "autogenerated": false, "ratio": 3.170940170940170...
from flask_login import login_user, logout_user, current_user from flask_admin.contrib.sqla import ModelView from flask_admin import Admin, expose, helpers, AdminIndexView from flask import redirect, request, url_for from werkzeug.security import generate_password_hash from keepmydevices import app from keepmydevices ...
{ "repo_name": "MiloJiang/KeepMyDevices", "path": "Server/keepmydevices/admin.py", "copies": "1", "size": "2542", "license": "mit", "hash": -6731224472921331000, "line_mean": 34.3055555556, "line_max": 119, "alpha_frac": 0.6392604249, "autogenerated": false, "ratio": 3.916795069337442, "config_t...
from flask_login import login_user, logout_user, current_user from flask import request, redirect, url_for, flash, render_template, session from . import auth from ..main.views import wiki_render_template from .. import wiki_pwd from ..decorators import super_required, guest_required from ..models import WikiUser, Wik...
{ "repo_name": "GNHua/Project-Wiki", "path": "app/auth/views.py", "copies": "1", "size": "4048", "license": "mit", "hash": -5525962602239776000, "line_mean": 37.9230769231, "line_max": 89, "alpha_frac": 0.6252470356, "autogenerated": false, "ratio": 3.888568683957733, "config_test": false, "ha...
from flask_login import login_user, logout_user from NodeDefender.frontend.forms.auth import LoginForm, RegisterForm,\ RegisterTokenForm, PasswordForm from flask import request, redirect, url_for, render_template, flash from datetime import datetime from NodeDefender.frontend.views import auth_view import NodeDefender ...
{ "repo_name": "CTSNE/NodeDefender", "path": "NodeDefender/frontend/views/auth.py", "copies": "1", "size": "4663", "license": "mit", "hash": -7929683368766018000, "line_mean": 39.547826087, "line_max": 82, "alpha_frac": 0.6508685396, "autogenerated": false, "ratio": 3.9151973131821998, "config_t...
from flask_login import login_user from portality.core import app from portality import models, app_email from portality.dao import Facetview2 import traceback class BackgroundException(Exception): pass class RetryException(Exception): pass class BackgroundSummary(object): def __init__(self, job_id, a...
{ "repo_name": "DOAJ/doaj", "path": "portality/background.py", "copies": "1", "size": "5976", "license": "apache-2.0", "hash": 2269980784936553000, "line_mean": 31.3027027027, "line_max": 114, "alpha_frac": 0.5681057564, "autogenerated": false, "ratio": 4.469708302169035, "config_test": false, ...
from flask_login import login_user from unittest import TestCase from portality import core, dao from portality.app import app from doajtest.bootstrap import prepare_for_test import dictdiffer from datetime import datetime from glob import glob import os, csv, shutil from portality.lib import paths prepare_for_test()...
{ "repo_name": "DOAJ/doaj", "path": "doajtest/helpers.py", "copies": "1", "size": "4341", "license": "apache-2.0", "hash": -1529821880881346300, "line_mean": 34.0080645161, "line_max": 138, "alpha_frac": 0.6118405897, "autogenerated": false, "ratio": 3.4589641434262948, "config_test": true, "h...
from flask_login import logout_user import database.user import util.response from linkr import app from uri.auth import * from util.decorators import * from util.exception import * @app.route(AuthCheckURI.get_path(), methods=AuthCheckURI.methods) @require_form_args() @api_method @time_request('latency.api.auth.chec...
{ "repo_name": "LINKIWI/linkr", "path": "api/auth.py", "copies": "1", "size": "2304", "license": "mit", "hash": -6709844030205713000, "line_mean": 27.0975609756, "line_max": 90, "alpha_frac": 0.6410590278, "autogenerated": false, "ratio": 3.9655765920826163, "config_test": false, "has_no_keywo...
from flask_login import ( current_user, ) from sqlalchemy import ( or_, ) from flask_wtf import ( Form, ) from flask.ext.wtf.file import ( FileAllowed, FileField, ) from wtforms import ( PasswordField, RadioField, TextAreaField, TextField, validators, ) from chatschoolette i...
{ "repo_name": "gorel/chatschoolette", "path": "chatschoolette/mod_account/forms.py", "copies": "1", "size": "3667", "license": "mit", "hash": -83258336243887950, "line_mean": 21.0903614458, "line_max": 79, "alpha_frac": 0.5410417235, "autogenerated": false, "ratio": 4.007650273224043, "config_t...
from flask_login import session from accept import Accept from jinja2 import Template from os import listdir, walk, chdir, getcwd from os.path import isfile, join, exists from flask import Response from Utils import Namespace, SparqlEndpoint, EnvironmentFactory import sys from jinja2 import FileSystemLoader from rdflib...
{ "repo_name": "alangrafu/flod", "path": "JsonBasedWriter.py", "copies": "1", "size": "4148", "license": "apache-2.0", "hash": 2603832448232579000, "line_mean": 36.3693693694, "line_max": 144, "alpha_frac": 0.6781581485, "autogenerated": false, "ratio": 3.3696181965881395, "config_test": false, ...
from flask_login import session from accept import Accept from os import listdir, walk, chdir, getcwd from os.path import isfile, join, exists from flask import Response from Utils import Namespace, SparqlEndpoint, MimetypeSelector, EnvironmentFactory import sys from rdflib import Graph, plugin from rdflib.serializer i...
{ "repo_name": "alangrafu/flod", "path": "Types.py", "copies": "1", "size": "6087", "license": "apache-2.0", "hash": 6403152725402677000, "line_mean": 30.2153846154, "line_max": 155, "alpha_frac": 0.6425168392, "autogenerated": false, "ratio": 3.055722891566265, "config_test": false, "has_no_k...
from flask_login import session, redirect, url_for from jinja2 import Template from Utils import SparqlEndpoint import hashlib import re import uuid from rdflib import Namespace, Graph, Literal, URIRef, RDF from slugify import slugify import sys # from Namespace import Namespace from jinja2 import FileSystemLoader from...
{ "repo_name": "alangrafu/flod", "path": "Users.py", "copies": "1", "size": "15934", "license": "apache-2.0", "hash": 2808657772945076000, "line_mean": 41.1534391534, "line_max": 230, "alpha_frac": 0.6595330739, "autogenerated": false, "ratio": 3.099397004473838, "config_test": false, "has_no_...
from flask_login import UserMixin, LoginManager, login_required, login_user, logout_user, current_user from flask_mongoengine import MongoEngine, DoesNotExist from werkzeug.security import generate_password_hash, check_password_hash from settings import db import datetime # Database Modals class User(UserMixin, db.Doc...
{ "repo_name": "sreecodeslayer/todo-flask", "path": "models.py", "copies": "1", "size": "1413", "license": "mit", "hash": 5032746721239874000, "line_mean": 29.7173913043, "line_max": 102, "alpha_frac": 0.7600849257, "autogenerated": false, "ratio": 3.3642857142857143, "config_test": false, "ha...
from flask_login import UserMixin from api.database import db from flask_uuid import FlaskUUID from api import app import uuid flask_uuid = FlaskUUID() flask_uuid.init_app(app) class User(UserMixin, db.Model): id = db.Column(db.Integer, primary_key=True) date = db.Column(db.TIMESTAMP) email = db.Colu...
{ "repo_name": "nokia-wroclaw/innovativeproject-cross-app-links", "path": "api/models.py", "copies": "1", "size": "5744", "license": "mit", "hash": 1254899116224390400, "line_mean": 29.2368421053, "line_max": 96, "alpha_frac": 0.5941852368, "autogenerated": false, "ratio": 3.4109263657957243, "c...
from flask_login import UserMixin from app.extensions import cache, bcrypt import bcrypt as bcr from .. import db from ..mixins import CRUDMixin import datetime from . import Group class User(CRUDMixin, UserMixin, db.Model): __tablename__ = "user" id = db.Column(db.Integer, primary_key=True) username = d...
{ "repo_name": "Urumasi/Flask-Bones", "path": "app/data/models/user.py", "copies": "1", "size": "3584", "license": "mit", "hash": 1771235742381325600, "line_mean": 34.84, "line_max": 111, "alpha_frac": 0.6333705357, "autogenerated": false, "ratio": 3.5, "config_test": false, "has_no_keywords":...
from flask_login import UserMixin from datetime import datetime from sqlalchemy import Column, BigInteger, String, DateTime, UniqueConstraint from sqlalchemy.orm import relationship from sqlalchemy.dialects.postgresql import UUID from uuid import uuid4 from ..dao.postgres_db import Base from ..util.slug import uuid_to...
{ "repo_name": "willrp/willbuyer", "path": "backend/model/user.py", "copies": "1", "size": "1321", "license": "mit", "hash": -550543741274002900, "line_mean": 32.8717948718, "line_max": 81, "alpha_frac": 0.6896290689, "autogenerated": false, "ratio": 3.8179190751445087, "config_test": false, "...
from flask_login import UserMixin from flask_principal import RoleNeed, Permission from flask_sqlalchemy import _BoundDeclarativeMeta from random import choice from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.ext.hybrid import hybrid_property from werkzeug import check_password_hash, generate_passwo...
{ "repo_name": "klen/fquest", "path": "base/auth/models.py", "copies": "2", "size": "3764", "license": "bsd-3-clause", "hash": -595603400417664400, "line_mean": 27.5151515152, "line_max": 78, "alpha_frac": 0.6413390011, "autogenerated": false, "ratio": 3.6974459724950886, "config_test": false, ...
from flask_login import UserMixin from flask_sqlalchemy import SQLAlchemy from werkzeug.security import generate_password_hash, check_password_hash db = SQLAlchemy() class User(db.Model, UserMixin): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(64), unique=True) password_has...
{ "repo_name": "nnrcschmdt/geistesblitze", "path": "geistesblitze/models.py", "copies": "1", "size": "1138", "license": "bsd-3-clause", "hash": -1598173764617005800, "line_mean": 29.7567567568, "line_max": 73, "alpha_frac": 0.6810193322, "autogenerated": false, "ratio": 3.635782747603834, "confi...
from flask_login import UserMixin # from game1.models import User as sqluser from game1 import db, models import json empty_point = [] # we use this to represent any point on the board that doesn't have any tiles on it magic_point = "m" default_new_game_state = {"current_turn": "A", "p...
{ "repo_name": "tomelliot/game1", "path": "game1/db_api.py", "copies": "1", "size": "3398", "license": "mit", "hash": -3835190253574483500, "line_mean": 42.5641025641, "line_max": 241, "alpha_frac": 0.5938787522, "autogenerated": false, "ratio": 3.1462962962962964, "config_test": false, "has_n...
from flask_login import UserMixin from . import db, login_manager from werkzeug.security import generate_password_hash, check_password_hash # os.chdir('/users/maslah/documents/Python/bc-8-online-store') class Users(db.Model, UserMixin): ''' Defines the user model which will be mapped to the user table i...
{ "repo_name": "hanmaslah/bc_8_online_store", "path": "app/models.py", "copies": "1", "size": "3136", "license": "mit", "hash": 8394040910317538000, "line_mean": 29.4466019417, "line_max": 75, "alpha_frac": 0.6087372449, "autogenerated": false, "ratio": 3.885997521685254, "config_test": false, ...
from flask_login import UserMixin from itsdangerous import URLSafeTimedSerializer from database import select from flask import current_app secret_key = '\x14\xf6T;\xbd7\xf5"\xf8\x82\x1d\xdd\x84\x02\x95.Qx\xdb\x9b' login_serializer = URLSafeTimedSerializer(secret_key) class User(UserMixin): def __init__(self, dict...
{ "repo_name": "Ashoat/diagora", "path": "user.py", "copies": "1", "size": "1356", "license": "apache-2.0", "hash": 6505757622609945000, "line_mean": 34.6842105263, "line_max": 79, "alpha_frac": 0.7190265487, "autogenerated": false, "ratio": 3.476923076923077, "config_test": false, "has_no_key...
from flask_login import UserMixin from sqlalchemy.ext.associationproxy import association_proxy from server.models.db import db class User(db.Model, UserMixin): __tablename__ = 'users' id = db.Column(db.Integer, primary_key=True) name = db.Column('name', db.String(50)) username = db.Column('username',...
{ "repo_name": "ganemone/ontheside", "path": "server/models/user.py", "copies": "1", "size": "2037", "license": "mit", "hash": 5898768037001633000, "line_mean": 32.95, "line_max": 85, "alpha_frac": 0.6283750614, "autogenerated": false, "ratio": 4.065868263473054, "config_test": false, "has_no_...
from flask_login import UserMixin from sqlalchemy.ext.hybrid import hybrid_method from sqlalchemy_utils import PasswordType, UUIDType from annotator.extensions import db class User(db.Model, UserMixin): __tablename__ = 'user' id = db.Column( UUIDType(binary=False), server_default=db.func.uui...
{ "repo_name": "planbrothers/ml-annotate", "path": "annotator/models/user.py", "copies": "1", "size": "1571", "license": "mit", "hash": -8432422688792862000, "line_mean": 23.546875, "line_max": 76, "alpha_frac": 0.5970719287, "autogenerated": false, "ratio": 3.987309644670051, "config_test": fal...
from flask_login import UserMixin from sqlalchemy import Column, String from flask_bcrypt import check_password_hash from Base import Base user_groups = { 'group_admin': ['admin'], 'group_review': ['admin', 'reviewer'], 'group_all': ['admin', 'reviewer', 'viewer'] } class User(UserMixin, Base): # pro...
{ "repo_name": "niclabs/net-viz", "path": "app/models/User.py", "copies": "1", "size": "1043", "license": "mit", "hash": -4938482060363391000, "line_mean": 25.1, "line_max": 64, "alpha_frac": 0.6481303931, "autogenerated": false, "ratio": 3.848708487084871, "config_test": false, "has_no_keywor...
from flask_login import UserMixin from sqlalchemy import func from sqlalchemy.ext.declarative import declarative_base from lmda import db Base = declarative_base() class User(db.Model, UserMixin): __tablename__ = 'users' id = db.Column(db.Integer, primary_key=True, autoincrement=True) username = db.Colu...
{ "repo_name": "mstojcevich/Lambda-Python", "path": "lmda/models.py", "copies": "1", "size": "3184", "license": "mit", "hash": -6537954117226653000, "line_mean": 31.1616161616, "line_max": 97, "alpha_frac": 0.6790201005, "autogenerated": false, "ratio": 3.4384449244060473, "config_test": false, ...
from flask_login import UserMixin from sqlalchemy_utils import EmailType, PasswordType, UUIDType from diilikone.extensions import db class User(db.Model, UserMixin): __tablename__ = 'user' id = db.Column( UUIDType(binary=False), server_default=db.func.uuid_generate_v4(), primary_key=...
{ "repo_name": "wappulehti-apy/diilikone-api", "path": "diilikone/models/user.py", "copies": "1", "size": "1070", "license": "mit", "hash": 8765777944615082000, "line_mean": 25.75, "line_max": 69, "alpha_frac": 0.6401869159, "autogenerated": false, "ratio": 3.4294871794871793, "config_test": fal...
from flask_login import UserMixin from werkzeug.security import generate_password_hash, check_password_hash from app import db, login_manager # User table class User(UserMixin, db.Model): __tablename__ = "user" id = db.Column(db.Integer, primary_key=True, autoincrement=True) email = db.Column(db.String(80), unique=...
{ "repo_name": "jacobsky/shopping-aggregator", "path": "shopping-aggregator/app/models.py", "copies": "1", "size": "9232", "license": "apache-2.0", "hash": -191072763678074200, "line_mean": 34.6447876448, "line_max": 175, "alpha_frac": 0.6780762565, "autogenerated": false, "ratio": 3.0640557583803...
from flask_login import UserMixin from werkzeug.security import generate_password_hash, check_password_hash from datetime import datetime import bleach import markdown2 from . import db from . import login_manager from sqlalchemy import event def get_clean_body(body_html): allowed_tags = ['a', 'abbr', 'acronym', ...
{ "repo_name": "jasonqiao36/blog", "path": "app/models.py", "copies": "1", "size": "3498", "license": "mit", "hash": 3972729133844425700, "line_mean": 31.5794392523, "line_max": 112, "alpha_frac": 0.6239242685, "autogenerated": false, "ratio": 3.329512893982808, "config_test": false, "has_no_k...
from flask_login import UserMixin from werkzeug.security import generate_password_hash, check_password_hash from opsy.auth.utils import create_token from opsy.flask_extensions import db from opsy.models import AwareDateTime, BaseModel, NamedModel, TimeStampMixin ########################################################...
{ "repo_name": "testeddoughnut/opsy", "path": "opsy/auth/models.py", "copies": "1", "size": "5545", "license": "mit", "hash": -3898756225201662000, "line_mean": 32.2035928144, "line_max": 79, "alpha_frac": 0.5884580703, "autogenerated": false, "ratio": 3.888499298737728, "config_test": false, ...
from flask_login import UserMixin from werkzeug.security import generate_password_hash, check_password_hash from app import db, login_manager class Employee(UserMixin, db.Model): """ Create an Employee table """ # Ensures table will be named in plural and not in singular # as is the name of the ...
{ "repo_name": "helix90/proptrunk", "path": "app/models.py", "copies": "1", "size": "4415", "license": "apache-2.0", "hash": 32962252578983100, "line_mean": 26.4223602484, "line_max": 73, "alpha_frac": 0.6063420159, "autogenerated": false, "ratio": 3.6761032472939217, "config_test": false, "ha...
from flask_login import UserMixin from werkzeug.security import generate_password_hash, check_password_hash from inventory_manager_app.extensions import db class Base(db.Model): __abstract__ = True id = db.Column(db.Integer, primary_key=True) class User(Base, UserMixin): __tablename__ = 'user' u...
{ "repo_name": "wbali/rwc-inventory-manager", "path": "inventory_manager_app/auth/models.py", "copies": "1", "size": "1516", "license": "mit", "hash": -3614781483721800700, "line_mean": 28.7254901961, "line_max": 73, "alpha_frac": 0.6147757256, "autogenerated": false, "ratio": 4.23463687150838, ...
from flask_login import UserMixin from werkzeug.security import generate_password_hash, check_password_hash import app.db as db class User(UserMixin): def __init__(self, username, password, email, year=None, major=None, is_admin=False, is_new_user=True): self.username = username self.password = pa...
{ "repo_name": "BunsenMcDubbs/cs4400-project", "path": "app/models/User.py", "copies": "1", "size": "2482", "license": "mit", "hash": 2938025921883071000, "line_mean": 36.6060606061, "line_max": 173, "alpha_frac": 0.5898468977, "autogenerated": false, "ratio": 4.009693053311794, "config_test": f...
from flask_login import UserMixin from wtforms import TextField, PasswordField from ..models import _PrintableForm from .. import db, porridge class User(db.Model, UserMixin): id = db.Column(db.Integer, primary_key=True) email = db.Column(db.String(255), unique=True) is_admin = db.Column(db.Boolean(), de...
{ "repo_name": "thusoy/blag", "path": "blag/auth/models.py", "copies": "1", "size": "1225", "license": "mit", "hash": -5280374076871256000, "line_mean": 30.4102564103, "line_max": 92, "alpha_frac": 0.6628571429, "autogenerated": false, "ratio": 3.510028653295129, "config_test": false, "has_no_...
from flask_login import UserMixin import spotify import spotipy import db_utils import application as app class User(UserMixin): ''' User class for Flask-Login ''' def __init__(self, user_id, username=None): self.id = int(user_id) self.username = username self._spotify = None @pro...
{ "repo_name": "DropMuse/DropMuse", "path": "app/models.py", "copies": "1", "size": "1559", "license": "mit", "hash": -3643311539578643500, "line_mean": 33.6444444444, "line_max": 72, "alpha_frac": 0.5625400898, "autogenerated": false, "ratio": 4.247956403269755, "config_test": false, "has_no_...
from flask_login import UserMixin from config import db class MessagesFound(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) user_id = db.Column(db.Integer, db.ForeignKey('users.id')) message_id = db.Column(db.Integer, db.ForeignKey('messages.id')) class Users(db.Model, UserM...
{ "repo_name": "onurozuduru/location-based-messaging", "path": "api/models.py", "copies": "1", "size": "1425", "license": "mit", "hash": -4876216834855967000, "line_mean": 36.5, "line_max": 82, "alpha_frac": 0.7073684211, "autogenerated": false, "ratio": 3.3294392523364484, "config_test": false,...
from flask_login import UserMixin class User(UserMixin): __tablename__ = 'users' def __init__(self, id, full_name, email, password, created_at, avatar, description): self.id = str(id) self.email = email self.full_name = full_name self.password = password self.created_at...
{ "repo_name": "sorja/twatter", "path": "twatter/models/models.py", "copies": "1", "size": "1337", "license": "mit", "hash": 8897326650237385000, "line_mean": 30.8333333333, "line_max": 181, "alpha_frac": 0.5774121167, "autogenerated": false, "ratio": 3.5558510638297873, "config_test": false, ...
from flask_login import UserMixin from app import bcrypt from app import db from .mixins import UserTypeMixin from werkzeug.security import generate_password_hash UserRole = db.Table('users_roles', db.Column('id', db.Integer, primary_key=True), db.Column('user_id', db....
{ "repo_name": "by46/coffee", "path": "app/models/user.py", "copies": "1", "size": "1260", "license": "mit", "hash": 234387082152162430, "line_mean": 34, "line_max": 79, "alpha_frac": 0.6206349206, "autogenerated": false, "ratio": 3.9622641509433962, "config_test": false, "has_no_keywords": fa...
from flask_loopback import FlaskLoopback from sentinels import NOTHING from ..app import build_app import json import requests import uuid class Webapp(object): def __init__(self): super(Webapp, self).__init__() self.hostname = str(uuid.uuid1()) def __enter__(self): self.activate()...
{ "repo_name": "getweber/weber-cli", "path": "cob/utils/unittests.py", "copies": "2", "size": "2768", "license": "bsd-3-clause", "hash": -3713727111914576400, "line_mean": 31.9523809524, "line_max": 134, "alpha_frac": 0.5874277457, "autogenerated": false, "ratio": 4.119047619047619, "config_test...
from flask_mail import Mail from PhoenixNow.login import login_manager from PhoenixNow.model import db from flask import Flask import os app = Flask(__name__) mail = Mail() def create_app(config_object, register_blueprint=True): """ Sets up a Flask app variable based on a config object -- see config.py. We ...
{ "repo_name": "ECGHelloWorld/PhoenixNow", "path": "PhoenixNow/factory.py", "copies": "1", "size": "1083", "license": "mit", "hash": -9201954048837788000, "line_mean": 28.2972972973, "line_max": 79, "alpha_frac": 0.6842105263, "autogenerated": false, "ratio": 3.7867132867132867, "config_test": f...
from flask_mail import Mail from varappx.handle_init import app from flask_mail import Message from varappx.handle_config import settings mail = Mail(app) email_TAGS = '[ VarX ] ' def send_email(email_to, subject='No subject', text='', html='', tofile=None): """Call _send_email using the app's settings""" _se...
{ "repo_name": "444thLiao/VarappX-flask", "path": "varappx/common/email.py", "copies": "1", "size": "1358", "license": "mit", "hash": 7114356203501918000, "line_mean": 40.1515151515, "line_max": 108, "alpha_frac": 0.6811487482, "autogenerated": false, "ratio": 3.6802168021680215, "config_test": ...
from flask_mail import Message, Mail import sqlite3 def connect_db(app): """ Creates and connects to an sqlite3 database that will hold the data of tickets and multitracks. Returns ------- rv: database """ db_connection = sqlite3.connect(app.config['DATABASE']) db_connection.row_f...
{ "repo_name": "marl/medleydb_manager", "path": "webapp/utils.py", "copies": "1", "size": "2240", "license": "mit", "hash": -747651042032489500, "line_mean": 20.7475728155, "line_max": 73, "alpha_frac": 0.6133928571, "autogenerated": false, "ratio": 4.095063985374772, "config_test": false, "ha...
from flask_mail import Message from flask import render_template from API_operaciones import mysql_connection mail = mysql_connection.mail def enviarCorreoConfirmacion(correoElectronico, nombreReal, nombreUsuario): msg = Message("[PIMCD] Usuario creado") msg.sender = "Fundacion Proyecto Navio <registro@fundac...
{ "repo_name": "josemonsalve2/PIMC", "path": "python/auth/correos.py", "copies": "1", "size": "1592", "license": "apache-2.0", "hash": -2375018279987062300, "line_mean": 53.9310344828, "line_max": 166, "alpha_frac": 0.7851758794, "autogenerated": false, "ratio": 2.8028169014084505, "config_test"...
from flask_mail import Message from flask import render_template, url_for import NodeDefender import smtplib @NodeDefender.decorators.mail_enabled @NodeDefender.decorators.celery_task def new_group(group): if type(group) == str: group = NodeDefender.db.group.get(group) if group.email == None: ...
{ "repo_name": "CTSNE/NodeDefender", "path": "NodeDefender/mail/group.py", "copies": "1", "size": "2088", "license": "mit", "hash": 8177818319519621000, "line_mean": 38.3962264151, "line_max": 131, "alpha_frac": 0.6594827586, "autogenerated": false, "ratio": 3.8666666666666667, "config_test": fa...
from flask_mail import Message from flask import render_template, url_for import NodeDefender import smtplib @NodeDefender.decorators.mail_enabled @NodeDefender.decorators.celery_task def new_icpe(icpe, host, port): icpe = NodeDefender.db.icpe.get(icpe) if icpe is None: return False mqtt = NodeDef...
{ "repo_name": "CTSNE/NodeDefender", "path": "NodeDefender/mail/icpe.py", "copies": "1", "size": "2175", "license": "mit", "hash": 7493073935943619000, "line_mean": 37.8392857143, "line_max": 85, "alpha_frac": 0.6409195402, "autogenerated": false, "ratio": 3.6493288590604025, "config_test": fals...
from flask_mail import Message from flask import render_template, url_for import NodeDefender import smtplib @NodeDefender.decorators.mail_enabled @NodeDefender.decorators.celery_task def new_node(group, node): group = NodeDefender.db.group.get(group) if group is None: return False if group.email i...
{ "repo_name": "CTSNE/NodeDefender", "path": "NodeDefender/mail/node.py", "copies": "1", "size": "1136", "license": "mit", "hash": 1991880481027996200, "line_mean": 35.6451612903, "line_max": 91, "alpha_frac": 0.6593309859, "autogenerated": false, "ratio": 3.9581881533101044, "config_test": fals...
from flask_mail import Message from flask import render_template, url_for import NodeDefender import smtplib @NodeDefender.decorators.mail_enabled @NodeDefender.decorators.celery_task def new_user(user): if type(user) == str: user = NodeDefender.db.user.get(user) if user.email == None: return ...
{ "repo_name": "CTSNE/NodeDefender", "path": "NodeDefender/mail/user.py", "copies": "1", "size": "3475", "license": "mit", "hash": 8029736752954440000, "line_mean": 37.6111111111, "line_max": 81, "alpha_frac": 0.6523741007, "autogenerated": false, "ratio": 3.989667049368542, "config_test": false...
from flask_mail import Message from flask_restaction import abort import git from git.repo.fun import is_git_dir import giturlparse import datetime import os import logging from flask import current_app from purepage.ext import r, db from purepage.views.user import gen_pwdhash def create_root(): if db.run(r.table...
{ "repo_name": "guyskk/kkblog", "path": "api/purepage/util.py", "copies": "2", "size": "3716", "license": "mit", "hash": -1085996243628250500, "line_mean": 29.8739495798, "line_max": 76, "alpha_frac": 0.5887316277, "autogenerated": false, "ratio": 3.5739299610894943, "config_test": false, "has...
from flask_marshmallow.fields import URLFor from marshmallow.fields import Boolean, Method from mass_flask_api.config import api_blueprint from mass_flask_api.schemas.base import BaseSchema, ForeignReferenceField from mass_flask_core.models import AnalysisSystemInstance, AnalysisSystem, ScheduledAnalysis class Analy...
{ "repo_name": "mass-project/mass_server", "path": "mass_flask_api/schemas/analysis_system_instance.py", "copies": "1", "size": "1160", "license": "mit", "hash": -3458353462531634700, "line_mean": 40.4285714286, "line_max": 149, "alpha_frac": 0.7336206897, "autogenerated": false, "ratio": 4.128113...
from flask_marshmallow.fields import URLFor from marshmallow.fields import List from mass_flask_api.config import api_blueprint from .base import BaseSchema, ForeignReferenceField from mass_flask_core.models import Sample, FileSample, ExecutableBinarySample, IPSample, DomainSample, URISample, AnalysisSystem class Sam...
{ "repo_name": "mass-project/mass_server", "path": "mass_flask_api/schemas/sample.py", "copies": "1", "size": "2718", "license": "mit", "hash": -8699493305365362000, "line_mean": 30.6046511628, "line_max": 153, "alpha_frac": 0.6526857984, "autogenerated": false, "ratio": 4.014771048744461, "conf...
from flask_marshmallow.fields import URLFor from mass_flask_core.models import SampleRelation from mass_flask_core.models import DroppedBySampleRelation from mass_flask_core.models import ResolvedBySampleRelation from mass_flask_core.models import ContactedBySampleRelation from mass_flask_core.models import RetrievedBy...
{ "repo_name": "mass-project/mass_server", "path": "mass_flask_api/schemas/sample_relation.py", "copies": "1", "size": "2626", "license": "mit", "hash": -8258956887650216000, "line_mean": 37.0579710145, "line_max": 110, "alpha_frac": 0.7837014471, "autogenerated": false, "ratio": 4.04, "config_t...
from flask_marshmallow import base_fields from flask_restplus_patched import Schema class BaseResultSchema(Schema): status = base_fields.Boolean( description="The status of result, True meaning success and False meaning failure,default is True.", default=True, required=True) msg = base_fields...
{ "repo_name": "ssls/beetle-agent", "path": "app/extensions/api/results.py", "copies": "1", "size": "1077", "license": "mit", "hash": 1900654579902693400, "line_mean": 28.1081081081, "line_max": 108, "alpha_frac": 0.6564531105, "autogenerated": false, "ratio": 4.142307692307693, "config_test": f...
from FlaskMedia import db class Series(db.Model): """DB structure for TV Series.""" id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String(256), index=True) plot = db.Column(db.String(2048), index=True) rated = db.Column(db.String(15), index=True) IMDB_id = db.Column(db.String...
{ "repo_name": "samcheck/PyMedia", "path": "FlaskMedia/models.py", "copies": "1", "size": "2717", "license": "mit", "hash": 5163103839408814000, "line_mean": 40.8, "line_max": 97, "alpha_frac": 0.6558704453, "autogenerated": false, "ratio": 2.9955898566703416, "config_test": false, "has_no_key...
from flask_me_example import app app.debug = True SECRET_KEY = 'random-secret-key' SESSION_COOKIE_NAME = 'psa_session' DEBUG = False MONGODB_SETTINGS = {'DB': 'psa_db'} DEBUG_TB_INTERCEPT_REDIRECTS = False SESSION_PROTECTION = 'strong' SOCIAL_AUTH_LOGIN_URL = '/' SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/done/' SOCIAL_A...
{ "repo_name": "robbiet480/python-social-auth", "path": "examples/flask_me_example/settings.py", "copies": "51", "size": "2283", "license": "bsd-3-clause", "hash": 6287968014095256000, "line_mean": 36.4262295082, "line_max": 60, "alpha_frac": 0.7477003942, "autogenerated": false, "ratio": 3.175243...
from flask_migrate import Migrate, MigrateCommand from flask_script import Manager, Shell from flask_restful import Api from app import app, db from app.auth.controllers import Register, Login from app.bucketlist.controllers import (Bucketlists, OneBucketlist, ...
{ "repo_name": "andela-gacheruevans/cp2-bucketlist", "path": "run.py", "copies": "1", "size": "1425", "license": "mit", "hash": 7748442989959211000, "line_mean": 29.3191489362, "line_max": 71, "alpha_frac": 0.6463157895, "autogenerated": false, "ratio": 3.991596638655462, "config_test": false, ...
from flask_mixer import Mixer from . import config from ..core.tests import FlaskTest from .generator import GEN_MONSTERS, GEN_STUFF from .models import Character, db, Event from mock import Mock class TestCase(FlaskTest): def setUp(self): super(TestCase, self).setUp() # Create test world ...
{ "repo_name": "klen/fquest", "path": "base/fquest/tests.py", "copies": "1", "size": "3168", "license": "bsd-3-clause", "hash": -3114574732245977000, "line_mean": 27.2857142857, "line_max": 92, "alpha_frac": 0.5874368687, "autogenerated": false, "ratio": 3.891891891891892, "config_test": true, ...
from flask_modular_auth import AbstractAuthEntity from mongoengine import StringField, BooleanField, IntField from werkzeug.security import generate_password_hash, check_password_hash from bson import ObjectId from mass_flask_config.app import db, setup_session_auth, auth_manager from .tlp_level import TLPLevelField ...
{ "repo_name": "mass-project/mass_server", "path": "mass_flask_core/models/user.py", "copies": "1", "size": "3499", "license": "mit", "hash": -3654342452700496000, "line_mean": 28.6525423729, "line_max": 89, "alpha_frac": 0.6467562161, "autogenerated": false, "ratio": 3.845054945054945, "config_...
from flask_modular_auth import privilege_required, AuthenticatedPrivilege, RolePrivilege from mass_flask_api.schemas import AnalysisSystemSchema from mass_flask_api.utils import get_pagination_compatible_schema, register_api_endpoint from mass_flask_core.models import AnalysisSystem from .base import BaseResource cla...
{ "repo_name": "mass-project/mass_server", "path": "mass_flask_api/resources/analysis_system.py", "copies": "1", "size": "4090", "license": "mit", "hash": 2837324846401133000, "line_mean": 35.8468468468, "line_max": 106, "alpha_frac": 0.5665036675, "autogenerated": false, "ratio": 5.57980900409277...
from flask_modular_auth import privilege_required, RolePrivilege from .base import BaseResource from mass_flask_api.utils import get_pagination_compatible_schema, register_api_endpoint from mass_flask_api.schemas import AnalysisRequestSchema from mass_flask_core.models import AnalysisRequest class AnalysisRequestReso...
{ "repo_name": "mass-project/mass_server", "path": "mass_flask_api/resources/analysis_request.py", "copies": "1", "size": "4000", "license": "mit", "hash": 7105424957126000000, "line_mean": 35.036036036, "line_max": 106, "alpha_frac": 0.558, "autogenerated": false, "ratio": 5.563282336578581, "c...
from flask_mongoengine import BaseQuerySet from mongoengine import StringField, DateTimeField, ListField, ReferenceField, EmbeddedDocumentField, FileField, IntField, FloatField, EmbeddedDocument, LongField, ValidationError, \ DoesNotExist, Q, GenericReferenceField from flask_modular_auth import current_authenticat...
{ "repo_name": "mass-project/mass_server", "path": "mass_flask_core/models/sample.py", "copies": "1", "size": "10980", "license": "mit", "hash": -6238120856558304000, "line_mean": 34.4193548387, "line_max": 182, "alpha_frac": 0.6322404372, "autogenerated": false, "ratio": 3.925634608509117, "con...
from flask_mongoengine import MongoEngine from datetime import datetime db = MongoEngine() class User(db.Document): name = db.StringField(required=True, max_length=64) password = db.StringField(max_length=256) email = db.StringField(max_length=64) description = db.StringField(max_length=1024) # ...
{ "repo_name": "defshine/cleanblog", "path": "app/models.py", "copies": "1", "size": "1228", "license": "mit", "hash": 8307390598707790000, "line_mean": 25.1489361702, "line_max": 78, "alpha_frac": 0.6701954397, "autogenerated": false, "ratio": 3.665671641791045, "config_test": false, "has_no_...
from flask_mongokit import Document from project.config import config from project.services.auth import Auth import copy def max_length(length): def validate(value): if len(value) <= length: return True raise Exception('%s must be at most %s characters long' % length) return valida...
{ "repo_name": "AustinStoneProjects/Founderati-Server", "path": "models/base_user.py", "copies": "1", "size": "1801", "license": "apache-2.0", "hash": -3946502652043849000, "line_mean": 25.1014492754, "line_max": 104, "alpha_frac": 0.6163242643, "autogenerated": false, "ratio": 3.984513274336283, ...
from flask_navigation import Navigation from flask_navigation.item import Item from flask_navigation.utils import BoundTypeProperty class NavBarItem(Item): """ Overrides flask_navigation.item.Item to add the show() function. show() is called to see if the Navigation Bar Item should be shown or not...
{ "repo_name": "ziel980/website", "path": "app/navigation.py", "copies": "1", "size": "1584", "license": "mit", "hash": 3107353532872321000, "line_mean": 35.0227272727, "line_max": 79, "alpha_frac": 0.6388888889, "autogenerated": false, "ratio": 4.363636363636363, "config_test": false, "has_no...
from flask_oauthlib.client import OAuth from app import app, settings from flask import session from functools import wraps #TODO Add auth server whitelist = ['fredericc0@students.rowan.edu'] admins = ['fredericc0@students.rowan.edu'] app.secret_key = 'development' oauth = OAuth() google = oauth.remote_app( 'goog...
{ "repo_name": "chrisfrederickson/firepi", "path": "app/auth.py", "copies": "1", "size": "1595", "license": "mit", "hash": 5415189019418721000, "line_mean": 28.5555555556, "line_max": 66, "alpha_frac": 0.6300940439, "autogenerated": false, "ratio": 3.6836027713625867, "config_test": false, "ha...
from flask_oauthlib.client import OAuth from flask import Flask, url_for, request, redirect, flash class API: """ Handle API authentication and request with 500px """ def __init__(self, consumer_key, consumer_secret): oauth = OAuth() self.api = oauth.remote_app('500px-fav-downloader',...
{ "repo_name": "jameslafa/500px-fav-downloader", "path": "helpers/api.py", "copies": "1", "size": "2977", "license": "mit", "hash": 7691219201593685000, "line_mean": 35.3048780488, "line_max": 108, "alpha_frac": 0.5821296607, "autogenerated": false, "ratio": 4.390855457227139, "config_test": fal...
from flask_oauthlib.client import OAuth from flask import session from swappr import app import swappr.god_request import os oauth = OAuth(app) tanda_auth = oauth.remote_app( 'tanda', base_url='https://my.tanda.co/api/v2/', request_token_url=None, request_token_params={'scope': 'me roster timesheet use...
{ "repo_name": "swappr-tanda-team/swappr", "path": "swappr/user/tanda_api.py", "copies": "1", "size": "1287", "license": "mit", "hash": 1029231503357748400, "line_mean": 26.3829787234, "line_max": 92, "alpha_frac": 0.675990676, "autogenerated": false, "ratio": 3.0863309352517985, "config_test": ...
from flask_oauthlib.client import OAuth from flask import session from aleph import signals oauth = OAuth() def get_oauth_token(): if 'oauth' in session: sig = session.get('oauth') return (sig.get('access_token'), '') def setup_providers(app): # Reset the remote apps first! oauth.remot...
{ "repo_name": "smmbllsm/aleph", "path": "aleph/oauth.py", "copies": "1", "size": "2166", "license": "mit", "hash": 8143223469229187000, "line_mean": 29.9428571429, "line_max": 73, "alpha_frac": 0.6403508772, "autogenerated": false, "ratio": 3.7933450087565674, "config_test": false, "has_no_ke...
from flask_oauthlib.provider import OAuth2Provider from userver.user.models_auth import Client, Token from userver.user.admin import Admin oauth = OAuth2Provider() @oauth.clientgetter def load_client(client_id): return Client.query.filter_by(client_id=client_id).first() # @oauth.grantgetter # def load_grant(cl...
{ "repo_name": "soybean217/lora-python", "path": "UServer/admin_server/admin_http_api/oauth.py", "copies": "1", "size": "2561", "license": "mit", "hash": 6090763008863300000, "line_mean": 26.5483870968, "line_max": 74, "alpha_frac": 0.648184303, "autogenerated": false, "ratio": 3.3389830508474576,...
from flask_oauthlib.provider import OAuth2Provider from userver.user.models_auth import Client, Token from userver.user.models import User oauth = OAuth2Provider() @oauth.clientgetter def load_client(client_id): return Client.query.filter_by(client_id=client_id).first() # @oauth.grantgetter # def load_grant(cl...
{ "repo_name": "soybean217/lora-python", "path": "UServer/http_api_oauth/oauth.py", "copies": "1", "size": "2556", "license": "mit", "hash": -2359118873775210500, "line_mean": 26.7934782609, "line_max": 74, "alpha_frac": 0.6478873239, "autogenerated": false, "ratio": 3.332464146023468, "config_t...
from flask_pagedown.fields import PageDownField from flask_wtf import FlaskForm from wtforms import StringField, SubmitField, TextAreaField, BooleanField, SelectField from wtforms.validators import DataRequired, Length, Email, Regexp, ValidationError from app.models import Role, User class NameForm(FlaskForm): n...
{ "repo_name": "keer2345/flasky", "path": "app/main/forms.py", "copies": "1", "size": "2459", "license": "mit", "hash": -5198041543348403000, "line_mean": 38.6612903226, "line_max": 86, "alpha_frac": 0.6226108174, "autogenerated": false, "ratio": 4.359929078014185, "config_test": false, "has_n...
from flask_pagedown import PageDown from blog import blog pagedown = PageDown(blog) from flask_pagedown.fields import PageDownField from flask_wtf import Form, RecaptchaField from wtforms import SubmitField, StringField, PasswordField from wtforms.widgets import TextArea from wtforms.validators import DataRequir...
{ "repo_name": "Morgl/charo", "path": "blog/forms.py", "copies": "1", "size": "2011", "license": "mit", "hash": 1828228774753322500, "line_mean": 28.9384615385, "line_max": 83, "alpha_frac": 0.6817503729, "autogenerated": false, "ratio": 3.3855218855218854, "config_test": false, "has_no_keywor...
from flask_peewee.admin import Admin, ModelAdmin from app import app from auth import auth from models import CardGroup, Card, Callerid, Logrefill, Logpayment, Call, Country, Charge # from models import Did, DidDestination class CardAdmin(ModelAdmin): columns = ('id', 'username', 'creationdate', 'credit', 'status...
{ "repo_name": "areski/a2billing-flask-api", "path": "a2billing_flask_api/admin.py", "copies": "1", "size": "1638", "license": "mpl-2.0", "hash": -3423816320037499400, "line_mean": 26.7627118644, "line_max": 90, "alpha_frac": 0.7197802198, "autogenerated": false, "ratio": 3.377319587628866, "con...
from flask_peewee.db import Database from app import db # Configure your A2Billing database DATABASE = { 'name': 'a2billing_db', 'engine': 'peewee.MySQLDatabase', 'user': 'root', 'passwd': 'password', } from peewee import * database = MySQLDatabase('a2billing_db', **{'password': 'password', 'user':...
{ "repo_name": "areski/a2billing-flask-api", "path": "a2billing_flask_api/models_orig.py", "copies": "1", "size": "50957", "license": "mpl-2.0", "hash": -2284081113910470100, "line_mean": 27.1997786386, "line_max": 84, "alpha_frac": 0.6689758031, "autogenerated": false, "ratio": 3.8685848770118434...