# Path: beavy/app.py
# BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# STATIC_FOLDER = os.path.join(BASE_DIR, '..', 'assets')
#     _FLBLPRE = "flask_social_blueprint.providers.{}"
# def make_env(app):
# def setup_statics(app):
#     def injnect_manifest():
# def make_celery(app):
#         def __call__(self, *args, **kwargs):
#     def login_failed_redirect(self, profile, provider):
#     def is_accessible(self):
# def _limiter_key():
# def inject_messages():
# def get_locale():
#     def ensure_users():
#     def print_routes():
#     class ContextTask(TaskBase):
# class SocialBlueprint(SocialBp):
# class BeavyAdminIndexView(AdminIndexView):
# 
# Path: beavy/models/user.py
# class User(db.Model, UserMixin):
#     __LOOKUP_ATTRS__ = []
#     id = db.Column(db.Integer, primary_key=True)
#     created_at = db.Column('created_at', db.DateTime(), nullable=False,
#                            server_default=func.now())
#     email = db.Column(db.String(255), unique=True, nullable=False)
#     name = db.Column(db.String(255))
#     password = db.Column(db.String(255))
#     active = db.Column(db.Boolean())
#     confirmed_at = db.Column(db.DateTime())
# 
#     last_login_at = db.Column(db.DateTime())
#     current_login_at = db.Column(db.DateTime())
#     last_login_ip = db.Column(db.String(255))
#     current_login_ip = db.Column(db.String(255))
#     login_count = db.Column(db.Integer())
#     language_preference = db.Column(db.String(2))
# 
#     roles = db.relationship('Role', secondary=roles_users,
#                             backref=db.backref('users', lazy='dynamic'))
# 
#     def __str__(self):
#         return "<User #{} '{}' ({})>".format(self.id,
#                                              self.name or "",
#                                              self.email)


from flask_babel import gettext as _
from sqlalchemy import orm, func
from ..app import db, app
from .user import User
import logging
import datetime
    id = db.Column(db.Integer, primary_key=True)
    created_at = db.Column('created_at', db.DateTime(),
                           nullable=False, server_default=func.now())
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)
    user = orm.relationship(User, foreign_keys=user_id,
                            backref=orm.backref('connections', order_by=id))
    provider = db.Column(db.String(255), nullable=False)
    profile_id = db.Column(db.String(255), nullable=False)
    username = db.Column(db.String(255))
    email = db.Column(db.String(255))
    access_token = db.Column(db.String(255))
    secret = db.Column(db.String(255))
    first_name = db.Column(db.String(255))
    last_name = db.Column(db.String(255))
    cn = db.Column(db.String(255))
    profile_url = db.Column(db.String(512))
    image_url = db.Column(db.String(512))

    def get_user(self):
        return self.user

    @classmethod
    def by_profile(cls, profile):
        provider = profile.data["provider"]
        return cls.query.filter(cls.provider == provider,
                                cls.profile_id == profile.id).first()

    @classmethod
    def from_profile(cls, user, profile):
        if not user or user.is_anonymous:

# Path: beavy/app.py
# BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# STATIC_FOLDER = os.path.join(BASE_DIR, '..', 'assets')
#     _FLBLPRE = "flask_social_blueprint.providers.{}"
# def make_env(app):
# def setup_statics(app):
#     def injnect_manifest():
# def make_celery(app):
#         def __call__(self, *args, **kwargs):
#     def login_failed_redirect(self, profile, provider):
#     def is_accessible(self):
# def _limiter_key():
# def inject_messages():
# def get_locale():
#     def ensure_users():
#     def print_routes():
#     class ContextTask(TaskBase):
# class SocialBlueprint(SocialBp):
# class BeavyAdminIndexView(AdminIndexView):
# 
# Path: beavy/models/user.py
# class User(db.Model, UserMixin):
#     __LOOKUP_ATTRS__ = []
#     id = db.Column(db.Integer, primary_key=True)
#     created_at = db.Column('created_at', db.DateTime(), nullable=False,
#                            server_default=func.now())
#     email = db.Column(db.String(255), unique=True, nullable=False)
#     name = db.Column(db.String(255))
#     password = db.Column(db.String(255))
#     active = db.Column(db.Boolean())
#     confirmed_at = db.Column(db.DateTime())
# 
#     last_login_at = db.Column(db.DateTime())
#     current_login_at = db.Column(db.DateTime())
#     last_login_ip = db.Column(db.String(255))
#     current_login_ip = db.Column(db.String(255))
#     login_count = db.Column(db.Integer())
#     language_preference = db.Column(db.String(2))
# 
#     roles = db.relationship('Role', secondary=roles_users,
#                             backref=db.backref('users', lazy='dynamic'))
# 
#     def __str__(self):
#         return "<User #{} '{}' ({})>".format(self.id,
#                                              self.name or "",
#                                              self.email)


# Path: beavy/models/social_connection.py
from flask_babel import gettext as _
from sqlalchemy import orm, func
from ..app import db, app
from .user import User
import logging
import datetime

    id = db.Column(db.Integer, primary_key=True)
    created_at = db.Column('created_at', db.DateTime(),
                           nullable=False, server_default=func.now())
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)
    user = orm.relationship(User, foreign_keys=user_id,
                            backref=orm.backref('connections', order_by=id))
    provider = db.Column(db.String(255), nullable=False)
    profile_id = db.Column(db.String(255), nullable=False)
    username = db.Column(db.String(255))
    email = db.Column(db.String(255))
    access_token = db.Column(db.String(255))
    secret = db.Column(db.String(255))
    first_name = db.Column(db.String(255))
    last_name = db.Column(db.String(255))
    cn = db.Column(db.String(255))
    profile_url = db.Column(db.String(512))
    image_url = db.Column(db.String(512))

    def get_user(self):
        return self.user

    @classmethod
    def by_profile(cls, profile):
        provider = profile.data["provider"]
        return cls.query.filter(cls.provider == provider,
                                cls.profile_id == profile.id).first()

    @classmethod
    def from_profile(cls, user, profile):
        if not user or user.is_anonymous:

            if not app.config.get("SECURITY_REGISTERABLE"):