<commit_before>from . import db
# Werkzeug provides facilities for password hashing
from werkzeug.security import generate_password_hash, check_password_hash
# User model for logins
from flask.ext.login import UserMixin
from . import login_manager
# Account confirmation, token generation
from flask import current_app
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer


# Flask-Login requires a callback function that loads a user given its id
@login_manager.user_loader
def load_user(user_id):
    return User.query.get(int(user_id))


# SQLAlchemy model
class Role(db.Model):
    # Define the name of the table
    __tablename__ = 'roles'
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(64), unique=True)
    # Should be set to True for only one role, it will be assigned by default
    # to new users.<commit_msg>List the available permissions<commit_after>from . import db
# Werkzeug provides facilities for password hashing
from werkzeug.security import generate_password_hash, check_password_hash
# User model for logins
from flask.ext.login import UserMixin
from . import login_manager
# Account confirmation, token generation
from flask import current_app
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer


# Flask-Login requires a callback function that loads a user given its id
@login_manager.user_loader
def load_user(user_id):
    return User.query.get(int(user_id))


class Permission:

    FOLLOW = 0x01
    COMMENT = 0x02
    WRITE_ARTICLES = 0x04
    MODERATE_COMMENTS = 0x08
    ADMINISTER = 0x80


# SQLAlchemy model
class Role(db.Model):
    # Define the name of the table
    __tablename__ = 'roles'
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(64), unique=True)
    # Should be set to True for only one role, it will be assigned by default
    # to new users.
{'fraction_non_alphanumeric': 0.0613107822410148, 'fraction_numerical': 0.01004228329809725, 'mean_word_length': 4.471098265895954, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2131481', 'n_tokens_mistral': 577, 'n_tokens_neox': 551, 'n_words': 198}