<commit_before>#!/usr/bin/env python
from djenerator.generate_test_data import djenerator
from django.core.management.base import BaseCommand
from django.core.management.base import CommandError


class Command(BaseCommand):
    args = '<size app_name out_name>'
    help = 'Generates random test data'

    def handle(self, *args, **options):
        size = int(args[0])
        app_name = args[1]
        out_put_name = args[2]
        output_file = open(args[2] + '.json', 'w')
        djenerator(app_name, size, output_file)
        output_file.close()<commit_msg>Updated the generate command to fit the format add_argument after Django 1.8<commit_after>#!/usr/bin/env python
from djenerator.generate_test_data import djenerator
from django.core.management.base import BaseCommand
from django.core.management.base import CommandError


class Command(BaseCommand):
    args = '<size app_name output_name>'
    help = '''Generates random test data for an app using djenerator. The
              arguments of the command are `size app_name output_name` '''

    def add_arguments(self, parser):
        parser.add_argument('size')
        parser.add_argument('app_name')
        parser.add_argument('output_name')

    def handle(self, *args, **options):
        size = int(options['size'])
        app_name = options['app_name']
        output_name = options['output_name']
        output_file = open(output_name + '.json', 'w')
        djenerator(app_name, size, output_file)
        output_file.close()
{'fraction_non_alphanumeric': 0.10557768924302789, 'fraction_numerical': 0.00398406374501992, 'mean_word_length': 3.580547112462006, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6708185', 'n_tokens_mistral': 453, 'n_tokens_neox': 441, 'n_words': 116}