<commit_before>from django.forms import Form, CharField, EmailField, ValidationError
from django.contrib.auth.models import User


class UserChangeForm(Form):
    username = CharField(max_length=30, label='New username')

    def clean(self):
        cleaned_data = super(UserChangeForm, self).clean()

        if User.objects.filter(username=cleaned_data['username']).count():
            raise ValidationError('Username already taken!')

        return cleaned_data


class EmailChangeForm(Form):
    email = EmailField(max_length=75, label='New email')<commit_msg>Set email max_length to 254 to conform with the model<commit_after>from django.forms import Form, CharField, EmailField, ValidationError
from django.contrib.auth.models import User


class UserChangeForm(Form):
    username = CharField(max_length=30, label='New username')

    def clean(self):
        cleaned_data = super(UserChangeForm, self).clean()

        if User.objects.filter(username=cleaned_data['username']).count():
            raise ValidationError('Username already taken!')

        return cleaned_data


class EmailChangeForm(Form):
    email = EmailField(max_length=254, label='New email')
{'fraction_non_alphanumeric': 0.10212765957446808, 'fraction_numerical': 0.010212765957446808, 'mean_word_length': 4.547169811320755, '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': '2196546', 'n_tokens_mistral': 332, 'n_tokens_neox': 311, 'n_words': 80}