<commit_before>{% macro bs3_dictlist_group(data, filterkeys=[], filtervals=[], data_attrs=[], asdict=False) %}
{#
    Makes a bootstrap list group from a set of dictionaries
    Usage:
    {{ bs3_dictlist_group({'foo': 'bar'}) }}
    <div class="list-group">
        <h4 class="list-group-item-heading">foo</h4>
        <p class="list-group-item-text">bar</p>
    </div>
#}
{% if asdict %}{% set data = data._asdict() %}{% endif %}
<div class="list-group" {{ apply_dattrs(data_attrs) }}>
    {% for k, v in data.items() %}
        {% if k not in filterkeys and v not in filtervals %}
            <h4 class="list-group-item-heading">{{ k }}</h4>
            <p class="list-group-item-text">{{ v }}</p>
        {% endif %}
    {% endfor %}
</div>
{%- endmacro %}


{% macro bs3_list_group(data, type='ul') %}
{#
    OL/UL based bootstrap list group
    Usage:
    {{ bs3_list_group(['foo', 'bar']) }}
    <ul>
        <li class="list-group-item">foo</li>
        <li class="list-group-item">bar</li>
    </ul>
#}
<{{ type }} class="list-group">
    {% for val in data %}
        <li class="list-group-item">{{ val }}</li>
    {% endfor %}
</{{ type }}>
{%- endmacro %}


{% macro bs3_label(value, label_map) -%}
{#
    Convert a dict of values with corresponding label types given a value, to
    the appropriate label.

    Usage:
    {{ bs3_label('PROD', {'dev': 'info', 'stage': 'warning', 'prod': 'danger'}) }}
    <span class="label label-danger">PROD</span>
 #}
<span class="label label-{{ label_map[value] }}">{{ value }}</span>
{%- endmacro %}<commit_msg>Add new macro.<commit_after>{% macro bs3_dictlist_group(data, filterkeys=[], filtervals=[], data_attrs=[], asdict=False) %}
{#
    Makes a bootstrap list group from a set of dictionaries
    Usage:
    {{ bs3_dictlist_group({'foo': 'bar'}) }}

    Output:
    <div class="list-group">
        <h4 class="list-group-item-heading">foo</h4>
        <p class="list-group-item-text">bar</p>
    </div>
#}
{% if asdict %}{% set data = data._asdict() %}{% endif %}
<div class="list-group" {{ apply_dattrs(data_attrs) }}>
    {% for k, v in data.items() %}
        {% if k not in filterkeys and v not in filtervals %}
            <h4 class="list-group-item-heading">{{ k }}</h4>
            <p class="list-group-item-text">{{ v }}</p>
        {% endif %}
    {% endfor %}
</div>
{%- endmacro %}


{% macro bs3_list_group(data, type='ul') %}
{#
    OL/UL based bootstrap list group

    Usage:
    {{ bs3_list_group(['foo', 'bar']) }}

    Output:
    <ul>
        <li class="list-group-item">foo</li>
        <li class="list-group-item">bar</li>
    </ul>
#}
<{{ type }} class="list-group">
    {% for val in data %}
        <li class="list-group-item">{{ val }}</li>
    {% endfor %}
</{{ type }}>
{%- endmacro %}


{% macro bs3_label(value, label_map) -%}
{#
    Convert a dict of values with corresponding label types given a value, to
    the appropriate label.

    Usage:
    {{ bs3_label('PROD', {'dev': 'info', 'stage': 'warning', 'prod': 'danger'}) }}

    Output:
    <span class="label label-danger">PROD</span>
 #}
<span class="label label-{{ label_map[value] }}">{{ value }}</span>
{%- endmacro %}


{% macro bs3_panel(items, paneltype='default') -%}
{#
    Generate bs3 panels for a dict of titles/body content.
    Usage:
    {{ bs3_panel({'Heading 1': 'Some body text... etc...', 'Heading 2': 'Some body text...'}, paneltype='info') }}

    Output:
    <div class="panel panel-info">
        <div class="panel-heading">
            <h3 class="panel-title">Heading 1</h3>
        </div>
        <div class="panel-body">
            Some body text... etc...
        </div>
    </div>
    <div class="panel panel-info">
        <div class="panel-heading">
            <h3 class="panel-title">Heading 2</h3>
        </div>
        <div class="panel-body">
            Some body text...
        </div>
    </div>
 #}
    {% for title, body in items.items() %}
        <div class="panel panel-{{ paneltype }}">
            <div class="panel-heading">
                <h3 class="panel-title">
                    {{ title }}
                </h3>
            </div>
            <div class="panel-body">
                {{ body }}
            </div>
        </div>
    {% endfor %}
{%- endmacro %}
{'fraction_non_alphanumeric': 0.2031470173790512, 'fraction_numerical': 0.007750117426021606, 'mean_word_length': 2.488124488124488, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 79, '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': '3848784', 'n_tokens_mistral': 1554, 'n_tokens_neox': 1433, 'n_words': 347}