##### SUMMARY

Implement `find_spec` and `exec_module` in the `RestrictedModuleLoader` for Python 3.10 and later. This depends on updating the collection loader first.

See also: https://github.com/ansible/ansible/issues/72952

Depends on: https://github.com/ansible/ansible/issues/74660

##### ISSUE TYPE

Feature Idea

##### COMPONENT NAME

test/lib/ansible_test/_data/sanity/import/importer.py
'--config-file', config_path,
        ]
        cmd.extend(context_paths)
        try:
            stdout, stderr = intercept_python(args, virtualenv_python, cmd, env, capture=True)
            if stdout or stderr:
                raise SubprocessError(cmd, stdout=stdout, stderr=stderr)
        except SubprocessError as ex:
            if ex.status != 1 or ex.stderr or not ex.stdout:
                raise
            stdout = ex.stdout
        pattern = r'^(?P<path>[^:]*):(?P<line>[0-9]+):((?P<column>[0-9]+):)? (?P<level>[^:]+): (?P<message>.*)$'
        parsed = parse_to_list_of_dict(pattern, stdout)
        messages = [SanityMessage(
            level=r['level'],
            message=r['message'],
            path=r['path'],
            line=int(r['line']),
            column=int(r.get('column') or '0'),
        ) for r in parsed]
        return messages
@dataclasses.dataclass(frozen=True)
class MyPyContext:
    """Context details for a single run of mypy."""
    name: str
    paths: t.List[str]
    python_versions: t.Tuple[str, ...]