# Path: account/conf.py
# def load_path_attr(path):
#     def configure_deletion_mark_callback(self, value):
#     def configure_deletion_expunge_callback(self, value):
#     def configure_hookset(self, value):
# class AccountAppConf(AppConf):
#     OPEN_SIGNUP = True
#     LOGIN_URL = "account_login"
#     SIGNUP_REDIRECT_URL = "/"
#     LOGIN_REDIRECT_URL = "/"
#     LOGOUT_REDIRECT_URL = "/"
#     PASSWORD_CHANGE_REDIRECT_URL = "account_password"
#     PASSWORD_RESET_REDIRECT_URL = "account_login"
#     REMEMBER_ME_EXPIRY = 60 * 60 * 24 * 365 * 10
#     USER_DISPLAY = lambda user: user.username  # flake8: noqa
#     CREATE_ON_SAVE = True
#     EMAIL_UNIQUE = True
#     EMAIL_CONFIRMATION_REQUIRED = False
#     EMAIL_CONFIRMATION_EMAIL = True
#     EMAIL_CONFIRMATION_EXPIRE_DAYS = 3
#     EMAIL_CONFIRMATION_ANONYMOUS_REDIRECT_URL = "account_login"
#     EMAIL_CONFIRMATION_AUTHENTICATED_REDIRECT_URL = None
#     EMAIL_CONFIRMATION_URL = "account_confirm_email"
#     SETTINGS_REDIRECT_URL = "account_settings"
#     NOTIFY_ON_PASSWORD_CHANGE = True
#     DELETION_MARK_CALLBACK = "account.callbacks.account_delete_mark"
#     DELETION_EXPUNGE_CALLBACK = "account.callbacks.account_delete_expunge"
#     DELETION_EXPUNGE_HOURS = 48
#     HOOKSET = "account.hooks.AccountDefaultHookSet"
#     TIMEZONES = TIMEZONES
#     LANGUAGES = [
#         (code, get_language_info(code).get("name_local"))
#         for code, lang in settings.LANGUAGES
#     ]
#     USE_AUTH_AUTHENTICATE = False
# 
# Path: account/managers.py
# class EmailConfirmationManager(models.Manager):
# 
#     def delete_expired_confirmations(self):
#         for confirmation in self.all():
#             if confirmation.key_expired():
#                 confirmation.delete()


import datetime
import operator
import pytz
    from urllib.parse import urlencode
    from urllib import urlencode
from django.core.urlresolvers import reverse
from django.db import models, transaction
from django.db.models import Q
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.utils import timezone, translation, six
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import AnonymousUser
from django.contrib.sites.models import Site
from account import signals
from account.conf import settings
from account.fields import TimeZoneField
from account.hooks import hookset
from account.managers import EmailConfirmationManager
from account.signals import signup_code_sent, signup_code_used
        return value.astimezone(pytz.timezone(timezone))

    def send_confirmation(self, **kwargs):
        confirmation = EmailConfirmation.create(self)
        confirmation.send(**kwargs)
        return confirmation


@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def user_post_save(sender, **kwargs):
    """
    After User.save is called we check to see if it was a created user. If so,
    we check if the User object wants account creation. If all passes we
    create an Account object.

    We only run on user creation to avoid having to check for existence on
    each call to User.save.
    """
    user, created = kwargs["instance"], kwargs["created"]
    disabled = getattr(user, "_disable_account_creation", not settings.ACCOUNT_CREATE_ON_SAVE)
    if created and not disabled:
        Account.create(user=user)


class AnonymousAccount(object):

    def __init__(self, request=None):
        self.user = AnonymousUser()
        self.timezone = settings.TIME_ZONE
        if request is None:

# Path: account/conf.py
# def load_path_attr(path):
#     def configure_deletion_mark_callback(self, value):
#     def configure_deletion_expunge_callback(self, value):
#     def configure_hookset(self, value):
# class AccountAppConf(AppConf):
#     OPEN_SIGNUP = True
#     LOGIN_URL = "account_login"
#     SIGNUP_REDIRECT_URL = "/"
#     LOGIN_REDIRECT_URL = "/"
#     LOGOUT_REDIRECT_URL = "/"
#     PASSWORD_CHANGE_REDIRECT_URL = "account_password"
#     PASSWORD_RESET_REDIRECT_URL = "account_login"
#     REMEMBER_ME_EXPIRY = 60 * 60 * 24 * 365 * 10
#     USER_DISPLAY = lambda user: user.username  # flake8: noqa
#     CREATE_ON_SAVE = True
#     EMAIL_UNIQUE = True
#     EMAIL_CONFIRMATION_REQUIRED = False
#     EMAIL_CONFIRMATION_EMAIL = True
#     EMAIL_CONFIRMATION_EXPIRE_DAYS = 3
#     EMAIL_CONFIRMATION_ANONYMOUS_REDIRECT_URL = "account_login"
#     EMAIL_CONFIRMATION_AUTHENTICATED_REDIRECT_URL = None
#     EMAIL_CONFIRMATION_URL = "account_confirm_email"
#     SETTINGS_REDIRECT_URL = "account_settings"
#     NOTIFY_ON_PASSWORD_CHANGE = True
#     DELETION_MARK_CALLBACK = "account.callbacks.account_delete_mark"
#     DELETION_EXPUNGE_CALLBACK = "account.callbacks.account_delete_expunge"
#     DELETION_EXPUNGE_HOURS = 48
#     HOOKSET = "account.hooks.AccountDefaultHookSet"
#     TIMEZONES = TIMEZONES
#     LANGUAGES = [
#         (code, get_language_info(code).get("name_local"))
#         for code, lang in settings.LANGUAGES
#     ]
#     USE_AUTH_AUTHENTICATE = False
# 
# Path: account/managers.py
# class EmailConfirmationManager(models.Manager):
# 
#     def delete_expired_confirmations(self):
#         for confirmation in self.all():
#             if confirmation.key_expired():
#                 confirmation.delete()


# Path: account/models.py
import datetime
import operator
import pytz
    from urllib.parse import urlencode
    from urllib import urlencode
from django.core.urlresolvers import reverse
from django.db import models, transaction
from django.db.models import Q
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.utils import timezone, translation, six
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import AnonymousUser
from django.contrib.sites.models import Site
from account import signals
from account.conf import settings
from account.fields import TimeZoneField
from account.hooks import hookset
from account.managers import EmailConfirmationManager
from account.signals import signup_code_sent, signup_code_used

        return value.astimezone(pytz.timezone(timezone))

    def send_confirmation(self, **kwargs):
        confirmation = EmailConfirmation.create(self)
        confirmation.send(**kwargs)
        return confirmation


@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def user_post_save(sender, **kwargs):
    """
    After User.save is called we check to see if it was a created user. If so,
    we check if the User object wants account creation. If all passes we
    create an Account object.

    We only run on user creation to avoid having to check for existence on
    each call to User.save.
    """
    user, created = kwargs["instance"], kwargs["created"]
    disabled = getattr(user, "_disable_account_creation", not settings.ACCOUNT_CREATE_ON_SAVE)
    if created and not disabled:
        Account.create(user=user)


class AnonymousAccount(object):

    def __init__(self, request=None):
        self.user = AnonymousUser()
        self.timezone = settings.TIME_ZONE
        if request is None:

            self.language = settings.LANGUAGE_CODE