<commit_before>import colander
import deform

from pyramid.view import view_config
from pyramid.httpexceptions import HTTPFound

from phoenix.security import passwd_check
from phoenix.account.base import Account


class LocalSchema(colander.MappingSchema):
    password = colander.SchemaNode(
        colander.String(),
        title='Password',
        description='If you have not configured your password yet then it is likely to be "<PASSWORD>"',
        validator=colander.Length(min=6),
        widget=deform.widget.PasswordWidget())


class LocalAccount(Account):

    def schema(self):
        return LocalSchema()

    def _handle_appstruct(self, appstruct):
        password = appstruct.get('password')
        if passwd_check(self.request, password):
            return self.login_success(login_id="phoenix@localhost", name="Phoenix", local=True)
        return self.login_failure()

    @view_config(route_name='sign_in', renderer='templates/account/sign_in.pt')
    def sign_in(self):
        return self.login()<commit_msg>update schema<commit_after>import colander
import deform

from pyramid.view import view_config
from pyramid.httpexceptions import HTTPFound

from phoenix.security import passwd_check
from phoenix.account.base import Account


class LocalSchema(colander.MappingSchema):
    password = colander.SchemaNode(
        colander.String(),
        title='Admin password',
        description='If you have not configured your password yet then it is likely to be "<PASSWORD>"',
        validator=colander.Length(min=6),
        widget=deform.widget.PasswordWidget())


class LocalAccount(Account):

    def schema(self):
        return LocalSchema()

    def _handle_appstruct(self, appstruct):
        password = appstruct.get('password')
        if passwd_check(self.request, password):
            return self.login_success(login_id="phoenix@localhost", name="Phoenix", local=True)
        return self.login_failure()

    @view_config(route_name='sign_in', renderer='templates/account/sign_in.pt')
    def sign_in(self):
        return self.login()
{'fraction_non_alphanumeric': 0.09711538461538462, 'fraction_numerical': 0.0009615384615384616, 'mean_word_length': 3.9196217494089836, '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': '7024568', 'n_tokens_mistral': 589, 'n_tokens_neox': 570, 'n_words': 139}