<commit_before>#!/usr/bin/env python

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.

import argparse
import importlib
import inspect
import os
import sys

from fnmatch import fnmatch

import semiauto


def iter_tests(start_dir, pattern="test_*.py"):
    """List available Web API tests and yield a tuple of (group, tests), where tests is a list of test names."""

    start_dir = os.path.abspath(start_dir)
    visited = []

    for root, dirs, files in os.walk(start_dir, followlinks=True):
        if root in visited:
            raise ImportError("Recursive symlink: %r" % root)
        visited.append(root)

        group = os.path.relpath(root, start_dir)<commit_msg>fixup! Provide Web API test runner that conforms to meta harness requirements<commit_after>#!/usr/bin/env python

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.

import argparse
import importlib
import inspect
import os
import sys

from fnmatch import fnmatch

import semiauto


def iter_tests(start_dir, pattern="test_*.py"):
    """List available Web API tests and yield a tuple of (group, tests), where tests is a list of test names."""

    start_dir = os.path.abspath(start_dir)
    visited = set()

    for root, dirs, files in os.walk(start_dir, followlinks=True):
        if root in visited:
            raise ImportError("Recursive symlink: %r" % root)
        visited.add(root)

        group = os.path.relpath(root, start_dir)
{'fraction_non_alphanumeric': 0.09159859976662778, 'fraction_numerical': 0.004667444574095682, 'mean_word_length': 3.420103092783505, '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': '4023499', 'n_tokens_mistral': 532, 'n_tokens_neox': 519, 'n_words': 207}