<commit_before>import django
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured

SOCIALACCOUNT_ENABLED = 'allauth.socialaccount' in settings.INSTALLED_APPS


def check_context_processors():
    allauth_ctx = 'allauth.socialaccount.context_processors.socialaccount'
    ctx_present = False

    if django.VERSION < (1, 8,):
        if allauth_ctx in settings.TEMPLATE_CONTEXT_PROCESSORS:
            ctx_present = True
    else:
        for engine in settings.TEMPLATES:
            if allauth_ctx in engine.get('OPTIONS', {})\
                    .get('context_processors', []):
                ctx_present = True
                break

    if not ctx_present:
        excmsg = ("socialaccount context processor "
                  "not found in settings.TEMPLATE_CONTEXT_PROCESSORS."
                  "See settings.py instructions here: "
                  "https://github.com/pennersr/django-allauth#installation")
        raise ImproperlyConfigured(excmsg)


if SOCIALACCOUNT_ENABLED:
    check_context_processors()


LOGIN_REDIRECT_URL = getattr(settings, 'LOGIN_REDIRECT_URL', '/')

USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')<commit_msg>Fix for checking the context processors on Django 1.8<commit_after>import django
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django import template

SOCIALACCOUNT_ENABLED = 'allauth.socialaccount' in settings.INSTALLED_APPS


def check_context_processors():
    allauth_ctx = 'allauth.socialaccount.context_processors.socialaccount'
    ctx_present = False

    if django.VERSION < (1, 8,):
        if allauth_ctx in settings.TEMPLATE_CONTEXT_PROCESSORS:
            ctx_present = True
    else:
        for engine in template.engines.templates.values():
            if allauth_ctx in engine.get('OPTIONS', {})\
                    .get('context_processors', []):
                ctx_present = True
                break

    if not ctx_present:
        excmsg = ("socialaccount context processor "
                  "not found in settings.TEMPLATE_CONTEXT_PROCESSORS."
                  "See settings.py instructions here: "
                  "https://github.com/pennersr/django-allauth#installation")
        raise ImproperlyConfigured(excmsg)


if SOCIALACCOUNT_ENABLED:
    check_context_processors()


LOGIN_REDIRECT_URL = getattr(settings, 'LOGIN_REDIRECT_URL', '/')

USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
{'fraction_non_alphanumeric': 0.08403699236027343, 'fraction_numerical': 0.0024125452352231603, 'mean_word_length': 2.97444089456869, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '5683951', 'n_tokens_mistral': 729, 'n_tokens_neox': 714, 'n_words': 153}