<commit_before>from logging import getLogger

import six
from django import template
from django.template.loader import get_template
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
from django.utils.functional import cached_property

from .filters import ChoicesFilter
from .filters import DateTimeFilter
from .filters import FILTER_ADD
from .filters import FILTER_DISPLAY
from .filters import FILTER_REMOVE
from .filters import ForeignKeyFilter
from .filters import ManyToManyFilter
from .filters import NumericRangeFilter
from .filters import ValuesFilter
from .utils import get_model_field<commit_msg>Old djangos don't have cached_property.<commit_after>from logging import getLogger

import six
from django import template
from django.template.loader import get_template
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
try:
    from django.utils.functional import cached_property
except ImportError:
    class cached_property(object):
        """
        Decorator that converts a method with a single self argument into a
        property cached on the instance.
        """
        def __init__(self, func):
            self.func = func

        def __get__(self, instance, type=None):
            if instance is None:
                return self
            res = instance.__dict__[self.func.__name__] = self.func(instance)
            return res

from .filters import ChoicesFilter
from .filters import DateTimeFilter
from .filters import FILTER_ADD
from .filters import FILTER_DISPLAY
from .filters import FILTER_REMOVE
from .filters import ForeignKeyFilter
from .filters import ManyToManyFilter
from .filters import NumericRangeFilter
from .filters import ValuesFilter
from .utils import get_model_field
{'fraction_non_alphanumeric': 0.0445996775926921, 'fraction_numerical': 0.0, 'mean_word_length': 4.143646408839779, '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': '2997620', 'n_tokens_mistral': 472, 'n_tokens_neox': 457, 'n_words': 185}