<commit_before>from __future__ import absolute_import

from fusionbox.forms.models import *<commit_msg>MonthField and FutureYearField select month/years<commit_after>from __future__ import absolute_import

import calendar
import datetime

from django import forms

from fusionbox.forms.models import *


class MonthField(forms.TypedChoiceField):
    def __init__(self, *args, **kwargs):
        super(MonthField, self).__init__(*args, **kwargs)
        self.choices = [('', ' -- ')] + \
                [(i, "%s - %s" % (i, calendar.month_name[i]))
                        for i in range(1, 13)]
        self.coerce = int

class FutureYearField(forms.TypedChoiceField):
    def __init__(self, *args, **kwargs):
        number_of_years = kwargs.pop('number_of_years', 6)
        super(FutureYearField, self).__init__(*args, **kwargs)
        self.choices = [('', ' -- ')] + \
                [(i%100, str(i))
                        for i in range(datetime.datetime.now().year, datetime.datetime.now().year + number_of_years)]
        self.coerce = int
{'fraction_non_alphanumeric': 0.13320647002854424, 'fraction_numerical': 0.006660323501427212, 'mean_word_length': 2.8819188191881917, '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': '5771698', 'n_tokens_mistral': 327, 'n_tokens_neox': 309, 'n_words': 71}