# Path: social/backends/utils.py
# def get_backend(backends, name, *args, **kwargs):
#     """Returns a backend by name. Backends are stored in the BACKENDSCACHE
#     cache dict. If not found, each of the modules referenced in
#     AUTHENTICATION_BACKENDS is imported and checked for a BACKENDS
#     definition. If the named backend is found in the module's BACKENDS
#     definition, it's then stored in the cache for future access.
#     """
#     try:
#         # Cached backend which has previously been discovered
#         return BACKENDSCACHE[name]
#     except KeyError:
#         # Reload BACKENDS to ensure a missing backend hasn't been missed
#         load_backends(backends, force_load=True)
#         try:
#             return BACKENDSCACHE[name]
#         except KeyError:
#             return None


import re
import time
import base64
from datetime import datetime, timedelta
from openid.association import Association as OpenIdAssociation
from social.backends.utils import get_backend
"""Models mixins for Social Auth"""




CLEAN_USERNAME_REGEX = re.compile(r'[^\w.@+-_]+', re.UNICODE)


class UserMixin(object):
    user = ''
    provider = ''
    uid = None
    extra_data = None


# Path: social/backends/utils.py
# def get_backend(backends, name, *args, **kwargs):
#     """Returns a backend by name. Backends are stored in the BACKENDSCACHE
#     cache dict. If not found, each of the modules referenced in
#     AUTHENTICATION_BACKENDS is imported and checked for a BACKENDS
#     definition. If the named backend is found in the module's BACKENDS
#     definition, it's then stored in the cache for future access.
#     """
#     try:
#         # Cached backend which has previously been discovered
#         return BACKENDSCACHE[name]
#     except KeyError:
#         # Reload BACKENDS to ensure a missing backend hasn't been missed
#         load_backends(backends, force_load=True)
#         try:
#             return BACKENDSCACHE[name]
#         except KeyError:
#             return None


# Path: social/storage/base.py
import re
import time
import base64
from datetime import datetime, timedelta
from openid.association import Association as OpenIdAssociation
from social.backends.utils import get_backend

"""Models mixins for Social Auth"""




CLEAN_USERNAME_REGEX = re.compile(r'[^\w.@+-_]+', re.UNICODE)


class UserMixin(object):
    user = ''
    provider = ''
    uid = None
    extra_data = None


    def get_backend(self, strategy):