<commit_before>from datetime import date
from django.core.management.base import NoArgsCommand
from redis_metrics.utils import generate_test_metrics


class Command(NoArgsCommand):
    help = "Creates Lots of Dummy Metrics"
    can_import_settings = True

    def handle_noargs(self, **options):
        metric_names = [
            'test-thingy',
            'test-flangey',
            'test-foobley',
            'test-blahblah',
        ]
        days = 365 * 3  # 3 years of data
        for m in metric_names:
            generate_test_metrics(m, num=days, randomize=True)<commit_msg>you can now provide metric names for test metrics<commit_after>from django.core.management.base import BaseCommand, CommandError
from redis_metrics.utils import generate_test_metrics


class Command(BaseCommand):
    args = '<metric-name> [<metric-name> ...]'
    help = "Creates Lots of Dummy Metrics"
    can_import_settings = True

    def handle(self, *args, **options):
        if len(args) == 0:
            raise CommandError("You must provide at least one metric name")
        metric_names = args

        days = 365 * 3  # 3 years of data
        for m in metric_names:
            generate_test_metrics(m, num=days, randomize=True)
{'fraction_non_alphanumeric': 0.08603896103896104, 'fraction_numerical': 0.008928571428571428, 'mean_word_length': 2.8055555555555554, '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': '4552778', 'n_tokens_mistral': 369, 'n_tokens_neox': 347, 'n_words': 105}