<commit_before># encoding: utf8
"""Useful extra form fields."""

from sqlalchemy.orm.exc import NoResultFound
from wtforms import fields, widgets
from wtforms.ext.sqlalchemy.fields import QuerySelectMultipleField


class FakeMultiDict(dict):
    def getlist(self, key):
        return self[key]

class DuplicateField(fields.Field):
    """
    Wraps a field that must be rendered several times.  Similar to FieldList,
    except the fields are identical -- names are unchanged.

    Do NOT use this for multi-select fields, compound fields, or subforms!
    """
    widget = widgets.ListWidget()

    def __init__(self, unbound_field, label=u'', validators=None, min_entries=0,
                 max_entries=None, default=[], **kwargs):<commit_msg>Crash fix: Another missing import.<commit_after># encoding: utf8
"""Useful extra form fields."""

from sqlalchemy.orm.exc import NoResultFound
from wtforms import fields, widgets, ValidationError
from wtforms.ext.sqlalchemy.fields import QuerySelectMultipleField


class FakeMultiDict(dict):
    def getlist(self, key):
        return self[key]

class DuplicateField(fields.Field):
    """
    Wraps a field that must be rendered several times.  Similar to FieldList,
    except the fields are identical -- names are unchanged.

    Do NOT use this for multi-select fields, compound fields, or subforms!
    """
    widget = widgets.ListWidget()

    def __init__(self, unbound_field, label=u'', validators=None, min_entries=0,
                 max_entries=None, default=[], **kwargs):
{'fraction_non_alphanumeric': 0.09464751958224543, 'fraction_numerical': 0.0026109660574412533, 'mean_word_length': 3.9611650485436893, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2928819', 'n_tokens_mistral': 445, 'n_tokens_neox': 427, 'n_words': 146}