<commit_before># -*- coding:Utf-8 -*-

from django.conf import settings
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone, http
from django.template.loader import render_to_string
from django.core.mail import send_mail
import datetime

from vosae_utils import generate_sha1
from account.managers import UserManager

from django.core.mail import EmailMultiAlternatives
from django.template import Context
from django.core.mail import EmailMessage


__all__ = (
    'ActivationMixin',
    'User',
)


class ActivationMixin(models.Model):

    """Mixin used for users activation process"""
    activation_key = models.CharField(_('activation key'), max_length=40, blank=True)
    activation_notification_send = models.BooleanField(_('notification send'), default=False, help_text=_('Designates whether this user has already got a notification about activating their account.'))
    email_unconfirmed = models.EmailField(_('unconfirmed email address'), blank=True, help_text=_('Temporary email address when the user requests an email change.'))
    email_confirmation_key = models.CharField(_('unconfirmed email verification key'), max_length=40, blank=True)

    class Meta:
        app_label = 'account'
        abstract = True

    def send_confirmation_email(self):
        """
        Sends an email to confirm the new email address.

        This method sends out two emails. One to the new email address that
        contains the ``email_confirmation_key`` which is used to verify this
        this email address with :func:`confirm_email`.

        The other email is to the old email address to let the user know that<commit_msg>Clean<commit_after># -*- coding:Utf-8 -*-
import datetime

from django.conf import settings
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone, http
from django.template.loader import render_to_string
from django.core.mail import send_mail
from django.core.mail import EmailMultiAlternatives
from django.template import Context
from django.core.mail import EmailMessage


from vosae_utils import generate_sha1
from account.managers import UserManager



__all__ = (
    'ActivationMixin',
    'User',
)


class ActivationMixin(models.Model):

    """Mixin used for users activation process"""
    activation_key = models.CharField(_('activation key'), max_length=40, blank=True)
    activation_notification_send = models.BooleanField(_('notification send'), default=False, help_text=_('Designates whether this user has already got a notification about activating their account.'))
    email_unconfirmed = models.EmailField(_('unconfirmed email address'), blank=True, help_text=_('Temporary email address when the user requests an email change.'))
    email_confirmation_key = models.CharField(_('unconfirmed email verification key'), max_length=40, blank=True)

    class Meta:
        app_label = 'account'
        abstract = True

    def send_confirmation_email(self):
        """
        Sends an email to confirm the new email address.

        This method sends out two emails. One to the new email address that
        contains the ``email_confirmation_key`` which is used to verify this
        this email address with :func:`confirm_email`.

        The other email is to the old email address to let the user know that
{'fraction_non_alphanumeric': 0.0738652382294897, 'fraction_numerical': 0.0033831406822667043, 'mean_word_length': 4.425076452599388, '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': '5688480', 'n_tokens_mistral': 930, 'n_tokens_neox': 899, 'n_words': 337}