<commit_before>from django import forms

from emojiweather.mixins import WeatherFormMixin


class SearchWeatherForm(WeatherFormMixin, forms.Form):
    q = forms.CharField(label='Query', widget=forms.TextInput(attrs={
        'type': 'search',
        'autocapitalize': 'words',
        'autocorrect': 'off',
        'autofocus': True,
        'class': 'form-control form-control-lg text-center',
        'placeholder': 'Search for a location',
    }))

    def __init__(self, q, *args, **kwargs):
        super(SearchWeatherForm, self).__init__(*args, **kwargs)
        self.fields['q'].initial = q<commit_msg>Fixed initial form fields<commit_after>from django import forms

from emojiweather.mixins import WeatherFormMixin


class SearchWeatherForm(WeatherFormMixin, forms.Form):
    q = forms.CharField(label='Query', widget=forms.TextInput(attrs={
        'type': 'search',
        'autocapitalize': 'words',
        'autocorrect': 'off',
        'autofocus': True,
        'class': 'form-control form-control-lg text-center',
        'placeholder': 'Search for a location',
    }))

    def __init__(self, *args, **kwargs):
        super(SearchWeatherForm, self).__init__(*args, **kwargs)
        self.fields['q'].initial = kwargs.pop('q', None)
{'fraction_non_alphanumeric': 0.14491593274619696, 'fraction_numerical': 0.0, 'mean_word_length': 3.578754578754579, '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': '6173248', 'n_tokens_mistral': 389, 'n_tokens_neox': 381, 'n_words': 84}