<commit_before>import sys

# "Test" is a function. It takes no arguments and returns any encountered errors.
# If there is no error, test should return 'None'. Tests shouldn't have any dependencies
# amongst themselves.


def run(tests):
    """Runs appropriate tests.

    If no arguments (sys.argv) are given, runs all tests in `tests`.
    If there are any arguments they are interpreted as names of tests to
    actually run, it will skip other tests.
    """

    selected_tests = set(sys.argv[1:])
    if selected_tests:
        to_run = [t for t in tests if t.__name__ in selected_tests]
        tests = to_run

    print '=> Going to run {} tests'.format(len(tests))
    ok = []
    fail = []
    for number, test in enumerate(tests):
        print '\t-> [{num}/{total}] {name} ({doc})'.format(num=number, len=len(tests),
                                                           name=test.__name__, doc=test.__doc__).
        error = test()
        if error is None:
            ok.append((number, test))
        else:
            fail.append((number, test, error))

    print ''
    print 'RESULTS'
    print '\tOK: {}'.format(len(ok))
    print '\tFAILED: {}'.format(len(fail))
    if len(fail) > 0:
        print ''
        print '--- Failures ---'
        for number, test, error in fail:<commit_msg>Fix several typos and mistakes in test_sequencer<commit_after>import sys

# "Test" is a function. It takes no arguments and returns any encountered errors.
# If there is no error, test should return 'None'. Tests shouldn't have any dependencies
# amongst themselves.


def run(tests):
    """Runs appropriate tests.

    If no arguments (sys.argv) are given, runs all tests in `tests`.
    If there are any arguments they are interpreted as names of tests to
    actually run, it will skip other tests.
    """

    selected_tests = set(sys.argv[1:])
    if selected_tests:
        to_run = [t for t in tests if t.__name__ in selected_tests]
        tests = to_run

    print '=> Going to run {} tests'.format(len(tests))
    ok = []
    fail = []
    for number, test in enumerate(tests):
        print '\t-> [{num}/{total}] {name} ({doc})'.format(num=number, total=len(tests),
                                                           name=test.__name__, doc=test.__doc__)
        error = test()
        if error is None:
            ok.append((number, test))
        else:
            fail.append((number, test, error))

    print ''
    print 'RESULTS'
    print '\tOK: {}'.format(len(ok))
    print '\tFAILED: {}'.format(len(fail))
    if len(fail) > 0:
        print ''
        print '--- Failures ---'
        for number, test, error in fail:
{'fraction_non_alphanumeric': 0.121996996996997, 'fraction_numerical': 0.0015015015015015015, 'mean_word_length': 2.2263922518159807, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4073612', 'n_tokens_mistral': 760, 'n_tokens_neox': 745, 'n_words': 277}