<commit_before>from django.core.management.base import BaseCommand

from django.contrib.auth.models import User

from core.db.manager import DataHubManager
from inventory.models import DataHubLegacyUser


class Command(BaseCommand):
    help = ("create user_data directories for users who don't have them")

    def handle(self, *args, **options):
        users = User.objects.all()
        for user in users:
            username = user.username
            if not DataHubManager.user_data_folder_exists(username):
                DataHubManager.create_user_data_folder(repo_base = username)

        legacy_users = DataHubLegacyUser.objects.all()
        for user in legacy_users:
            username = user.username
            if not DataHubManager.user_data_folder_exists(username):
                DataHubManager.create_user_data_folder(repo_base = username)

        success_message = ('I came. I saw. I conquered.\n'
                           '/user_data directory creation is complete.')
        self.stdout.write(self.style.MIGRATE_SUCCESS(success_message))
<commit_msg>update for codeclimate. Change output a bit.<commit_after>from django.core.management.base import BaseCommand

from django.contrib.auth.models import User

from core.db.manager import DataHubManager
from inventory.models import DataHubLegacyUser


class Command(BaseCommand):
    help = ("create user_data directories for users who don't have them")

    def handle(self, *args, **options):
        users = User.objects.all()
        for user in users:
            username = user.username
            if not DataHubManager.user_data_folder_exists(username):
                DataHubManager.create_user_data_folder(repo_base=username)
                self.stdout.write(
                    'created user data folder for %s.\n' % (username))

        legacy_users = DataHubLegacyUser.objects.all()
        for user in legacy_users:
            username = user.username
            if not DataHubManager.user_data_folder_exists(username):
                DataHubManager.create_user_data_folder(repo_base=username)
                self.stdout.write(
                    'created user data folder for %s.\n' % (username))

        success_message = ('I hate to advocate drugs, alcohol, violence, or '
                           'insanity to anyone, but they\'ve always worked '
                           'for me.\n'
                           '/user_data directory creation is complete.')
        self.stdout.write(self.style.MIGRATE_SUCCESS(success_message))

{'fraction_non_alphanumeric': 0.07801418439716312, 'fraction_numerical': 0.0, 'mean_word_length': 2.5020689655172412, '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': '5996023', 'n_tokens_mistral': 666, 'n_tokens_neox': 645, 'n_words': 173}