<commit_before>from django import forms


class MediaForm(forms.Form):
    zip_file = forms.FileField(label="Zipped Media File")

    def clean_data_file(self):
        file = self.cleaned_data['data_file']

        if file:
            extension = file.name.split('.')[-1]
            if extension != 'zip':
                raise forms.ValidationError('File Type Is Not .zip')
        return file
    '''

    def process_data(self):
        print("I am processing the form")
        file = self.cleaned_data['data_file'].file

        # delete root media file
        # unzip file in root folder (make sure it's called 'media')
    '''
<commit_msg>Fix upload form to only accept .zip files<commit_after>from django import forms


class MediaForm(forms.Form):
    zip_file = forms.FileField(label="Zipped Media File")

    def clean_zip_file(self):
        file = self.cleaned_data['zip_file']

        if file:
            extension = file.name.split('.')[-1]
            if extension != 'zip':
                raise forms.ValidationError('File Type Is Not .zip')
        return file

{'fraction_non_alphanumeric': 0.11049723756906077, 'fraction_numerical': 0.001841620626151013, 'mean_word_length': 2.3862928348909658, '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': '3233502', 'n_tokens_mistral': 312, 'n_tokens_neox': 302, 'n_words': 88}