<commit_before>from google.appengine.ext import ndb
from bcryptmaster import bcrypt
from saylua.models.role import Role

from saylua import db


class _User(db.Model):
    __tablename__ = "users"

    id = db.Column(db.Integer, primary_key=True)
    display_name = db.Column(db.String(80), unique=True)
    email = db.Column(db.String(120), unique=True)
    phash = db.Column(db.String(200))
    role = db.Column(db.String(100), default="user")
    ha_url = db.Column(db.String(100), default="/api/ha/m/")
    permabanned = db.Column(db.Boolean, default=False)

    def __repr__(self):
        return '<User %r>' % self.display_name

class _Accounts(db.Model):
    __tablename__ = "accounts"

    id = db.Column(db.Integer, primary_key=True)
    star_shards = db.Column(db.Integer, default=0)
    cloud_coins = db.Column(db.Integer, default=0)
    bank_cc = db.Column(db.Integer, default=0)
    bank_ss = db.Column(db.Integer, default=0)

class _DisplayNames(db.Model):
    __tablename__ = "display_names"

    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column('user_id', db.Integer, db.ForeignKey("users.id"), nullable=False)
    display_name = db.Column(db.String(80), unique=True)
<commit_msg>Added Username Change Time<commit_after>from google.appengine.ext import ndb
from bcryptmaster import bcrypt
from saylua.models.role import Role

from saylua import db


class _User(db.Model):
    __tablename__ = "users"

    id = db.Column(db.Integer, primary_key=True)
    display_name = db.Column(db.String(80), unique=True)
    last_username_change = db.Column(db.DateTime(timezone=True), server_default=db.func.now())

    email = db.Column(db.String(120), unique=True)
    phash = db.Column(db.String(200))

    role = db.Column(db.String(100), default="user")
    ha_url = db.Column(db.String(100), default="/api/ha/m/")
    permabanned = db.Column(db.Boolean, default=False)

    star_shards = db.Column(db.Integer, default=0)
    cloud_coins = db.Column(db.Integer, default=0)

    def __repr__(self):
        return '<User %r>' % self.display_name

class _BankAccount(db.Model):
    __tablename__ = "bank_accounts"

    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column('user_id', db.Integer, db.ForeignKey("users.id"), nullable=False)
    bank_ss = db.Column(db.Integer, default=0)
    bank_cc = db.Column(db.Integer, default=0)

class _DisplayName(db.Model):
    __tablename__ = "display_names"

    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column('user_id', db.Integer, db.ForeignKey("users.id"), nullable=False)
    display_name = db.Column(db.String(80), unique=True)

{'fraction_non_alphanumeric': 0.14139499620924942, 'fraction_numerical': 0.015163002274450341, 'mean_word_length': 4.225742574257426, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6053164', 'n_tokens_mistral': 961, 'n_tokens_neox': 925, 'n_words': 171}