<commit_before>{% import "_pagination.twig" as pagination %}
{% extends "_base.twig" %}
{% block title %}Known bots{% endblock %}
{% block extraresources %}
{% if page == 1 %}
<link rel="canonical" href="{{ canonicalUrl }}bots">
{% else %}
<link rel="canonical" href="{{ canonicalUrl }}bots/?page={{page}}">
{% endif %}
{% endblock %}
{% block content %}
<div class="page-header">
    <h1>Known Twitch service bots</h1>
</div>

<form class="form-inline" method="GET" action="">
    <div class="form-group">
        <label for="type">Filter by type</label>
        <select name="type" id="type">
            <option value="0"{% if currentType|default(0) == 0 %} selected{% endif %}>All bots</option>
            <option value="null"{% if currentType == 'null' %} selected{% endif %}>Unknown Type</option>
            {% for t in types %}
                <option value="{{ t.id|e('html_attr') }}"{% if currentType == t.id %} selected{% endif %}>{{ t.name|e }}</option>
            {% endfor %}
        </select>
    </div>
    <button type="submit" class="btn btn-default btn-sm">
        <span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
        <span class="sr-only">Filter</span>
    </button>
</form>
<div class="table-responsive">
    <table class="table table-striped">
        <caption>Type information is best-effort: bot types are verified when possible and else just assumed correct. Please <a href="{{ urlFor('submit')|e('html_attr') }}?correction">submit a correction</a> if you spot something wrong.</caption>
        <thead>
            <tr>
                <th>Username</th>
                <th>Type</th>
            </tr>
        </thead>
        <tbody>
        {% for bot in bots %}
            <tr>
                <td><a href="{{ urlFor('bot', { name: bot.name })|e('html_attr') }}">{{ bot.name|e }}</a></td>
                {% if bot.typename is not empty %}
                <td><a href="{{ urlFor('type', { id: bot.type })|e('html_attr') }}">{{ bot.typename|e }}</a></td>
                {% else %}
                <td><a href="{{ urlFor('submit')|e('html_attr') }}?correction&amp;username={{ bot.name|e('url')|e('html_attr') }}">Unknown (click to correct)</a></td>
                {% endif %}
            </tr>
        {% endfor %}
        </tbody>
    </table>
</div>
{% set filterParams = '' %}
{% if currentType != 0 %}
    {% set filterParams = '&type=' ~ currentType %}
{% endif %}
{{ pagination.print(page, pageCount, 3, 2, filterParams) }}

{% if currentType != 0 %}<p>The list is missing a bot user for this type? <a href="{{ urlFor('submit') }}?type={{ currentType|e('url')|e('html_attr') }}">Submit a bot of this type</a>.</p>{% endif %}
{% endblock %}
<commit_msg>fix: bots template<commit_after>{% import "_pagination.twig" as pagination %}
{% extends "_base.twig" %}
{% block title %}Known bots{% endblock %}
{% block extraresources %}
{% if page == 1 %}
<link rel="canonical" href="{{ canonicalUrl }}bots">
{% else %}
<link rel="canonical" href="{{ canonicalUrl }}bots/?page={{page}}">
{% endif %}
{% endblock %}
{% block content %}
<div class="page-header">
    <h1>Known Twitch service bots</h1>
</div>

<form class="form-inline" method="GET" action="">
    <div class="form-group">
        <label for="type">Filter by type</label>
        <select name="type" id="type">
            <option value="0"{% if currentType == 0 %} selected{% endif %}>All bots</option>
            <option value="null"{% if currentType is null %} selected{% endif %}>Unknown Type</option>
            {% for t in types %}
                <option value="{{ t.id|e('html_attr') }}"{% if currentType == t.id %} selected{% endif %}>{{ t.name|e }}</option>
            {% endfor %}
        </select>
    </div>
    <button type="submit" class="btn btn-default btn-sm">
        <span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
        <span class="sr-only">Filter</span>
    </button>
</form>
<div class="table-responsive">
    <table class="table table-striped">
        <caption>Type information is best-effort: bot types are verified when possible and else just assumed correct. Please <a href="{{ urlFor('submit')|e('html_attr') }}?correction">submit a correction</a> if you spot something wrong.</caption>
        <thead>
            <tr>
                <th>Username</th>
                <th>Type</th>
            </tr>
        </thead>
        <tbody>
        {% for bot in bots %}
            <tr>
                <td><a href="{{ urlFor('bot', { name: bot.name })|e('html_attr') }}">{{ bot.name|e }}</a></td>
                {% if bot.typename is not empty %}
                <td><a href="{{ urlFor('type', { id: bot.type })|e('html_attr') }}">{{ bot.typename|e }}</a></td>
                {% else %}
                <td><a href="{{ urlFor('submit')|e('html_attr') }}?correction&amp;username={{ bot.name|e('url')|e('html_attr') }}">Unknown (click to correct)</a></td>
                {% endif %}
            </tr>
        {% endfor %}
        </tbody>
    </table>
</div>
{% set filterParams = '' %}
{% if currentType != 0 %}
    {% set filterParams = '&type=' ~ currentType %}
{% endif %}
{{ pagination.print(page, pageCount, 3, 2, filterParams) }}

{% if currentType != 0 %}<p>The list is missing a bot user for this type? <a href="{{ urlFor('submit') }}?type={{ currentType|e('url')|e('html_attr') }}">Submit a bot of this type</a>.</p>{% endif %}
{% endblock %}

{'fraction_non_alphanumeric': 0.2092250922509225, 'fraction_numerical': 0.0035055350553505533, 'mean_word_length': 2.793561931420574, 'pattern_counts': {'":': 0, '<': 127, '<?xml version=': 0, '>': 127, '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': '1260504', 'n_tokens_mistral': 1828, 'n_tokens_neox': 1657, 'n_words': 447}