<commit_before>
from database import db


class User(db.Model):

    id = db.Column(db.Integer, primary_key=True)
    email = db.Column(db.String(100), nullable=False, unique=True)
    hashed_password = db.Column(db.String(100), nullable=False)
    is_admin = db.Column(db.Boolean, nullable=False, default=False)
    authenticated = True

    def __init__(self, email, hashed_password=None, is_admin=False):
        self.email = email
        self.hashed_password = <PASSWORD>
        self.is_admin = is_admin

    def to_dict(self):
        return {
            'id': self.id,
            'email': self.email,
            'hashed_password': <PASSWORD>.hashed_password,
            'is_admin': self.is_admin
        }

    def is_active(self):
        return True

    def get_id(self):
        return self.email

    def is_authenticated(self):
        return self.authenticated

    def is_anonymous(self):
        return False<commit_msg>Fix the user class so it works with the newer version of flask-login.<commit_after>
from database import db


class User(db.Model):

    id = db.Column(db.Integer, primary_key=True)
    email = db.Column(db.String(100), nullable=False, unique=True)
    hashed_password = db.Column(db.String(100), nullable=False)
    is_admin = db.Column(db.Boolean, nullable=False, default=False)
    authenticated = True

    def __init__(self, email, hashed_password=<PASSWORD>, is_admin=False):
        self.email = email
        self.hashed_password = <PASSWORD>
        self.is_admin = is_admin

    def to_dict(self):
        return {
            'id': self.id,
            'email': self.email,
            'hashed_password': <PASSWORD>.hashed_password,
            'is_admin': self.is_admin
        }

    def is_active(self):
        return True

    def get_id(self):
        return self.email

    @property
    def is_authenticated(self):
        return self.authenticated

    def is_anonymous(self):
        return False
{'fraction_non_alphanumeric': 0.10469867211440245, 'fraction_numerical': 0.006128702757916241, 'mean_word_length': 2.614391143911439, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '7410913', 'n_tokens_mistral': 632, 'n_tokens_neox': 600, 'n_words': 134}