<commit_before>from wtforms.fields import RadioField

class NullBooleanField(RadioField):
    DEFAULT_CHOICES = ((True, 'Sim'), (False, 'Não'), (None, 'Ignorado'))
    def __init__(**kwargs):
        super().__init__(**kwargs)
        self.choices = kwargs.pop('choices', DEFAULT_CHOICES)

    def iter_choices(self):
        for value, label in self.choices:
            yield (value, label, value == self.data)

    def process_data(self, value):
        if isinstance(value, bool) is False and value is not None:
            self.data = None
        else:
            self.data = value

    def process_formdata(self, valuelist):
        if valuelist:
            try:<commit_msg>? Add self to DEFAULT_CHOICES<commit_after>from wtforms.fields import RadioField

class NullBooleanField(RadioField):
    DEFAULT_CHOICES = ((True, 'Sim'), (False, 'Não'), (None, 'Ignorado'))
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.choices = kwargs.pop('choices', self.DEFAULT_CHOICES)

    def iter_choices(self):
        for value, label in self.choices:
            yield (value, label, value == self.data)

    def process_data(self, value):
        if isinstance(value, bool) is False and value is not None:
            self.data = None
        else:
            self.data = value

    def process_formdata(self, valuelist):
        if valuelist:
            try:
{'fraction_non_alphanumeric': 0.11557788944723618, 'fraction_numerical': 0.0, 'mean_word_length': 2.658792650918635, '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': '899967', 'n_tokens_mistral': 422, 'n_tokens_neox': 411, 'n_words': 114}