<commit_before>import datetime
import json
import re

from django import template
from django.utils.safestring import mark_safe
from markdown import markdown

from utilities.forms import unpack_grouped_choices
from utilities.utils import foreground_color


register = template.Library()


#
# Filters
#

@register.filter()
def oneline(value):
    """
    Replace each line break with a single space
    """
    return value.replace('\n', ' ')


@register.filter()
def placeholder(value):
    """
    Render a muted placeholder if value equates to False.
    """
    if value:
        return value
    placeholder = '<span class="text-muted">&mdash;</span>'
    return mark_safe(placeholder)


@register.filter()
def getlist(value, arg):<commit_msg>Strip return characters when removing line breaks<commit_after>import datetime
import json
import re

from django import template
from django.utils.safestring import mark_safe
from markdown import markdown

from utilities.forms import unpack_grouped_choices
from utilities.utils import foreground_color


register = template.Library()


#
# Filters
#

@register.filter()
def oneline(value):
    """
    Replace each line break with a single space
    """
    value = value.replace('\r', '')
    return value.replace('\n', ' ')


@register.filter()
def placeholder(value):
    """
    Render a muted placeholder if value equates to False.
    """
    if value:
        return value
    placeholder = '<span class="text-muted">&mdash;</span>'
    return mark_safe(placeholder)


@register.filter()
def getlist(value, arg):
{'fraction_non_alphanumeric': 0.10204081632653061, 'fraction_numerical': 0.0, 'mean_word_length': 3.980952380952381, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '919270', 'n_tokens_mistral': 454, 'n_tokens_neox': 439, 'n_words': 141}