<commit_before>from django.core.exceptions import ImproperlyConfigured
from django.db.models.signals import post_save
from django.core.cache import get_cache
from django.core.cache.backends.locmem import CacheClass as LocMemCacheClass

from constance.backends import Backend
from constance import settings

db_cache = None
if settings.DATABASE_CACHE_BACKEND:
    db_cache = get_cache(settings.DATABASE_CACHE_BACKEND)
    if isinstance(db_cache, LocMemCacheClass):
        raise ImproperlyConfigured(
            "The CONSTANCE_DATABASE_CACHE_BACKEND setting refers to a "
            "subclass of Django's local-memory backend (%r). Please set "
            "it to a backend that supports cross-process caching."
            % settings.DATABASE_CACHE_BACKEND)<commit_msg>Fix an import error on Django master.<commit_after>from django.core.exceptions import ImproperlyConfigured
from django.db.models.signals import post_save
from django.core.cache import get_cache

try:
    from django.core.cache.backends.locmem import LocMemCache
except ImportError:
    from django.core.cache.backends.locmem import CacheClass as LocMemCache

from constance.backends import Backend
from constance import settings

db_cache = None
if settings.DATABASE_CACHE_BACKEND:
    db_cache = get_cache(settings.DATABASE_CACHE_BACKEND)
    if isinstance(db_cache, LocMemCache):
        raise ImproperlyConfigured(
            "The CONSTANCE_DATABASE_CACHE_BACKEND setting refers to a "
            "subclass of Django's local-memory backend (%r). Please set "
            "it to a backend that supports cross-process caching."
            % settings.DATABASE_CACHE_BACKEND)
{'fraction_non_alphanumeric': 0.05764563106796117, 'fraction_numerical': 0.0, 'mean_word_length': 4.058282208588957, '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': '4110189', 'n_tokens_mistral': 470, 'n_tokens_neox': 461, 'n_words': 132}