<commit_before># -*- coding: utf-8 -*-

"""
byceps.util.templatefilters
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Provide and register custom template filters.

:Copyright: 2006-2015 <NAME>
:License: Modified BSD, see LICENSE for details.
"""

from . import dateformat, money


def register(app):
    """Make functions available as template filters."""
    functions = [
        dateformat.format_custom,
        dateformat.format_date_iso,
        dateformat.format_date_short,
        dateformat.format_date_long,
        dateformat.format_datetime_iso,
        dateformat.format_datetime_short,
        dateformat.format_datetime_long,
        dateformat.format_time,
        money.format_euro_amount,
    ]

    for f in functions:
        app.add_template_filter(f)
<commit_msg>Added custom template filter to render a value as dimmed.<commit_after># -*- coding: utf-8 -*-

"""
byceps.util.templatefilters
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Provide and register custom template filters.

:Copyright: 2006-2015 <NAME>
:License: Modified BSD, see LICENSE for details.
"""

from . import dateformat, money


def dim(value):
    """Render value in a way so that it looks dimmed."""
    return '<span class="dimmed">{}</span>'.format(value)


def register(app):
    """Make functions available as template filters."""
    functions = [
        dateformat.format_custom,
        dateformat.format_date_iso,
        dateformat.format_date_short,
        dateformat.format_date_long,
        dateformat.format_datetime_iso,
        dateformat.format_datetime_short,
        dateformat.format_datetime_long,
        dateformat.format_time,
        dim,
        money.format_euro_amount,
    ]

    for f in functions:
        app.add_template_filter(f)

{'fraction_non_alphanumeric': 0.12427745664739884, 'fraction_numerical': 0.010404624277456647, 'mean_word_length': 3.2219512195121953, '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': '4610687', 'n_tokens_mistral': 513, 'n_tokens_neox': 487, 'n_words': 119}