<commit_before>from django.core.management.base import BaseCommand, CommandError
from optparse import make_option

class Command(BaseCommand):
    option_list = BaseCommand.option_list + ( 
        make_option('--file',
            dest='file',
            default='/tmp/backup.gz',
            help='gz file to restore from'),
        make_option('--analyze_only',
            dest='analyze_only',
            action='store_true',
            default=False,
            help='donot read file, just analyze'
        )
        
    help = 'Restore reports from file'
    def handle(self, *args, **options):
        import reports.logic
        import analysis.logic
        self.stdout.write('analyze_only = %s' % (options['analyze_only']))
        self.stdout.write('file = %s' % (options['file'])
        if not options['analyze_only']:
            reports.logic.restore_reports(options['file'])
        analysis.logic.analyze_raw_reports()

                          
                          <commit_msg>logic<commit_after>from django.core.management.base import BaseCommand, CommandError
from optparse import make_option

class Command(BaseCommand):
    option_list = BaseCommand.option_list + ( 
        make_option('--file',
            dest='file',
            default='/tmp/backup.gz',
            help='gz file to restore from'),
        make_option('--analyze_only',
            dest='analyze_only',
            action='store_true',
            default=False,
            help='donot read file, just analyze')
        )
        
    help = 'Restore reports from file'
    def handle(self, *args, **options):
        import reports.logic
        import analysis.logic
        self.stdout.write('analyze_only = %s' % (options['analyze_only']))
        self.stdout.write('file = %s' % (options['file'])
        if not options['analyze_only']:
            reports.logic.restore_reports(options['file'])
        analysis.logic.analyze_raw_reports()

                          
                          
{'fraction_non_alphanumeric': 0.11597809855649577, 'fraction_numerical': 0.0, 'mean_word_length': 2.050075872534143, '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': '2497155', 'n_tokens_mistral': 548, 'n_tokens_neox': 530, 'n_words': 108}