<commit_before>import factory
from django.contrib.auth.hashers import make_password

from kebar.models.user import User


class UserFactory(factory.DjangoModelFactory):
    username = factory.Sequence(lambda i: 'user{0}')
    email = factory.Sequence(lambda i: <EMAIL>'.<EMAIL>(i))
    is_active = True

    class Meta:
        model = User

    @classmethod
    def _prepare(cls, create, **kwargs):
        raw_password = kwargs.pop('raw_password', '<PASSWORD>')
        if not 'password' in kwargs:
            kwargs['password'] = <PASSWORD>password(<PASSWORD>_password, hasher='md5')
        return super(UserFactory, cls)._prepare(create, **kwargs)<commit_msg>Fix user factory<commit_after>import factory
from django.contrib.auth.hashers import make_password

from keybar.models.user import User


class UserFactory(factory.DjangoModelFactory):
    username = factory.Sequence(lambda i: 'user{0}'.format(i))
    email = factory.Sequence(lambda i: <EMAIL>'.<EMAIL>(i))
    is_active = True

    class Meta:
        model = User

    @classmethod
    def _prepare(cls, create, **kwargs):
        raw_password = kwargs.pop('raw_password', '<PASSWORD>')
        if not 'password' in kwargs:
            kwargs['password'] = <PASSWORD>(<PASSWORD>, hasher='md5')
        return super(UserFactory, cls)._prepare(create, **kwargs)
{'fraction_non_alphanumeric': 0.12735493594574226, 'fraction_numerical': 0.003014318010550113, 'mean_word_length': 3.846715328467153, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '7039641', 'n_tokens_mistral': 398, 'n_tokens_neox': 395, 'n_words': 93}