<commit_before>from io import StringIO

from django.core.management import call_command


def test_call_command(command, *args,  **kwargs):
    call_command(command, stdout=StringIO(), stderr=StringIO(), *args, **kwargs)
<commit_msg>refactor: test_call_command returns stdout, stderr<commit_after>from io import StringIO

from django.core.management import call_command


def test_call_command(command, *args,  **kwargs):
    stdout_output = StringIO()
    stderr_output = StringIO()
    call_command(command, stdout=stdout_output, stderr=stderr_output, *args, **kwargs)
    return stdout_output, stderr_output

{'fraction_non_alphanumeric': 0.09983633387888707, 'fraction_numerical': 0.0, 'mean_word_length': 6.65, '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': '7525253', 'n_tokens_mistral': 190, 'n_tokens_neox': 185, 'n_words': 45}