<commit_before>"""Random utility functions."""

from django.core.cache import get_cache, InvalidCacheBackendError, cache as default_cache


def resolve_namespaced_cache(name):
    """Finds the best-matching named cache that exists."""
    try:
        return get_cache(name)
    except InvalidCacheBackendError:
        if "." in name:
            return resolve_namespaced_cache(name.rsplit(".", 1)[0])
        return default_cache<commit_msg>Fixing issue with cache loading in Django 1.3<commit_after>"""Random utility functions."""

from django.core.cache import get_cache, InvalidCacheBackendError, cache as default_cache


def resolve_namespaced_cache(name):
    """Finds the best-matching named cache that exists."""
    try:
        return get_cache(name)
    except (InvalidCacheBackendError, ValueError):
        if "." in name:
            return resolve_namespaced_cache(name.rsplit(".", 1)[0])
        return default_cache
{'fraction_non_alphanumeric': 0.09850107066381156, 'fraction_numerical': 0.006423982869379015, 'mean_word_length': 3.8195876288659796, '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': '211327', 'n_tokens_mistral': 260, 'n_tokens_neox': 250, 'n_words': 73}