<commit_before>import re

from testtube import conf


def _inspect_path(path, pattern):
    """Return True if pattern matches path as well as the set of named
    subpattern matches.

    """
    match = re.match(pattern, path)

    if not match:
        return False, {}

    return True, match.groupdict()


def _test_path(path, tests, kwargs):
    """Runs a set of tests against a specified path passing kwargs to each."""
    for test in tests:
        test(path, **kwargs)


def run_tests(path):
    """Checks the given path against conf.PATTERNS, and if there are any
    matches, it runs the corresponding test set against the path.
    """
    for pattern, tests in conf.PATTERNS:
        run_tests, kwargs = _inspect_path(path, pattern)

        if run_tests:
            _test_path(path, tests, kwargs)
            print "=========================================================="<commit_msg>Print a line cleverly...<commit_after>import re

from testtube import conf


def _inspect_path(path, pattern):
    """Return True if pattern matches path as well as the set of named
    subpattern matches.

    """
    match = re.match(pattern, path)

    if not match:
        return False, {}

    return True, match.groupdict()


def _test_path(path, tests, kwargs):
    """Runs a set of tests against a specified path passing kwargs to each."""
    for test in tests:
        test(path, **kwargs)


def run_tests(path):
    """Checks the given path against conf.PATTERNS, and if there are any
    matches, it runs the corresponding test set against the path.
    """
    for pattern, tests in conf.PATTERNS:
        run_tests, kwargs = _inspect_path(path, pattern)

        if run_tests:
            _test_path(path, tests, kwargs)
            print('=' * 58)
{'fraction_non_alphanumeric': 0.11947904869762174, 'fraction_numerical': 0.0011325028312570782, 'mean_word_length': 2.892070484581498, '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': '3174088', 'n_tokens_mistral': 514, 'n_tokens_neox': 496, 'n_words': 196}