<commit_before>from sqlalchemy import (
    Boolean,
    Column,
    DateTime,
    ForeignKey,
    Integer,
    String,
    func,
    )
from sqlalchemy.orm import relationship

import logging
log = logging.getLogger(__name__)

from flask.ext.security import UserMixin, RoleMixin

from .support import db
from wtforms import StringField, validators, PasswordField
from wtforms.fields.html5 import EmailField
from ..forms import Form

class User(db.Model, UserMixin):
    """
    A user who can login and work with Dexter.
    """
    __tablename__ = "users"

    id          = Column(Integer, primary_key=True)
    email       = Column(String(50), index=True, nullable=False, unique=True)
    first_name  = Column(String(50), nullable=False)
    last_name   = Column(String(50), nullable=False)
    admin       = Column(Boolean, default=False)
    disabled    = Column(Boolean, default=False)
    password    = Column(String(100))

    default_analysis_nature_id = Column(Integer, ForeignKey('analysis_natures.id'), default=1, nullable=False)

    country_id  = Column(Integer, ForeignKey('countries.id'), nullable=False)

    created_at   = Column(DateTime(timezone=True), index=True, unique=False, nullable=False, server_default=func.now())
    updated_at   = Column(DateTime(timezone=True), server_default=func.now(), onupdate=func.current_timestamp())

    # associations
    default_analysis_nature = relationship("AnalysisNature")
    country     = relationship("Country")
    roles       = db.relationship('Role', secondary='roles_users', backref=db.backref('users', lazy='dynamic'))

    def short_name(self):
        s = ""
        if self.first_name:
            s += self.first_name
        
        if self.last_name:
            if s:
                s += " " + self.last_name[0] + "."
            else:
                s = self.last_name
<commit_msg>Default user password to empty.<commit_after>from sqlalchemy import (
    Boolean,
    Column,
    DateTime,
    ForeignKey,
    Integer,
    String,
    func,
    )
from sqlalchemy.orm import relationship

import logging
log = logging.getLogger(__name__)

from flask.ext.security import UserMixin, RoleMixin

from .support import db
from wtforms import StringField, validators, PasswordField
from wtforms.fields.html5 import EmailField
from ..forms import Form

class User(db.Model, UserMixin):
    """
    A user who can login and work with Dexter.
    """
    __tablename__ = "users"

    id          = Column(Integer, primary_key=True)
    email       = Column(String(50), index=True, nullable=False, unique=True)
    first_name  = Column(String(50), nullable=False)
    last_name   = Column(String(50), nullable=False)
    admin       = Column(Boolean, default=False)
    disabled    = Column(Boolean, default=False)
    password    = Column(String(100), default='')

    default_analysis_nature_id = Column(Integer, ForeignKey('analysis_natures.id'), default=1, nullable=False)

    country_id  = Column(Integer, ForeignKey('countries.id'), nullable=False)

    created_at   = Column(DateTime(timezone=True), index=True, unique=False, nullable=False, server_default=func.now())
    updated_at   = Column(DateTime(timezone=True), server_default=func.now(), onupdate=func.current_timestamp())

    # associations
    default_analysis_nature = relationship("AnalysisNature")
    country     = relationship("Country")
    roles       = db.relationship('Role', secondary='roles_users', backref=db.backref('users', lazy='dynamic'))

    def short_name(self):
        s = ""
        if self.first_name:
            s += self.first_name
        
        if self.last_name:
            if s:
                s += " " + self.last_name[0] + "."
            else:
                s = self.last_name

{'fraction_non_alphanumeric': 0.11048988285410011, 'fraction_numerical': 0.006389776357827476, 'mean_word_length': 3.1884057971014492, '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': '4080671', 'n_tokens_mistral': 1142, 'n_tokens_neox': 1093, 'n_words': 249}