<commit_before><commit_msg>Adding _profiling.py back with that name<commit_after># Source: http://www.djangosnippets.org/snippets/1315/
# file: profiling.py #
from django.test.simple import run_tests
from django.conf import settings
try:
    import cProfile as profile
except ImportError:
    import profile

def profile_tests(*args, **kwargs):
    profile.runctx('run_tests(*args, **kwargs)',
                {'run_tests':run_tests,'args':args,'kwargs':kwargs},
                {},
                getattr(settings,'TEST_PROFILE',None)
            )

{'fraction_non_alphanumeric': 0.12341197822141561, 'fraction_numerical': 0.007259528130671506, 'mean_word_length': 3.416, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '5284375', 'n_tokens_mistral': 170, 'n_tokens_neox': 158, 'n_words': 34}