<commit_before>import django
from django.conf import settings
from django.template.defaultfilters import stringfilter
from django import template

import bleach


ALLOWED_TAGS = getattr(settings, 'SANITIZER_ALLOWED_TAGS', [])
ALLOWED_ATTRIBUTES = getattr(settings, 'SANITIZER_ALLOWED_ATTRIBUTES', [])
ALLOWED_STYLES = getattr(settings, 'SANITIZER_ALLOWED_STYLES', [])

register = template.Library()


@stringfilter<commit_msg>py3 doesn't work with basestring, this fixes py3 use<commit_after>import django
from django.conf import settings
from django.template.defaultfilters import stringfilter
from django import template

import bleach

import sys
if sys.version_info[0] == 3:
    basestring = str

ALLOWED_TAGS = getattr(settings, 'SANITIZER_ALLOWED_TAGS', [])
ALLOWED_ATTRIBUTES = getattr(settings, 'SANITIZER_ALLOWED_ATTRIBUTES', [])
ALLOWED_STYLES = getattr(settings, 'SANITIZER_ALLOWED_STYLES', [])

register = template.Library()


@stringfilter
{'fraction_non_alphanumeric': 0.08928571428571429, 'fraction_numerical': 0.004201680672268907, 'mean_word_length': 7.585585585585585, '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': '7539585', 'n_tokens_mistral': 331, 'n_tokens_neox': 324, 'n_words': 70}