<commit_before>"""Small utility functions, used for overriding the default behaviour of third-party Django plugins
"""
import re


def minify(template_source):
    """Alternative to django_template_minifier's minify function
    """
    template_source = re.sub(r'(\n *)+', '\n', template_source)
    template_source = re.sub(r'({%.+%})\n+', r'\1', template_source)
    return template_source
<commit_msg>don't try minifying password reset email template<commit_after>"""Small utility functions, used for overriding the default behaviour of third-party Django plugins
"""
import re


def minify(template_source):
    """Alternative to django_template_minifier's minify function
    """
    if '<' in template_source:
        template_source = re.sub(r'(\n *)+', '\n', template_source)
        template_source = re.sub(r'({%.+%})\n+', r'\1', template_source)
    return template_source

{'fraction_non_alphanumeric': 0.1367231638418079, 'fraction_numerical': 0.0022598870056497176, 'mean_word_length': 4.643312101910828, 'pattern_counts': {'":': 0, '<': 4, '<?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': '5645931', 'n_tokens_mistral': 268, 'n_tokens_neox': 252, 'n_words': 73}