def __init__(
        self,
        finder: Any,
        module_name: str,
        wrap_module: Callable[[ModuleType], ModuleType | None],
        after_exec: Callable[[ModuleType], None],
    ):
        """A module finder that uses an existing module finder to find a python
        module spec and intercept the execution of matching modules.

        Replace finders in `sys.meta_path` with instances of this class to
        instrument import statements.

        Args:
            finder: The original module finder to wrap.
            module_name: The fully qualified module name to instrument e.g.
                `'pkg.submodule'`.  Submodules of this are also instrumented.
            wrap_module: A callback function that takes a module object before
                it is run and either modifies or replaces it before it is run.
                The module returned by this function will be executed.  If None
                is returned the module is not executed and may be executed
                later.
            after_exec: A callback function that is called with the return value
                of `wrap_module` after that module was executed if `wrap_module`
                didn't return None.
        """

        self.finder = finder
        self.module_name = module_name
        self.match_components: list[str] = []
        if self.module_name:
            self.match_components = self.module_name.split('.')
        self.wrap_module = wrap_module
        self.after_exec = after_exec
A module finder that uses an existing module finder to find a python
        module spec and intercept the execution of matching modules.

        Replace finders in `sys.meta_path` with instances of this class to
        instrument import statements.

        Args:
            finder: The original module finder to wrap.
            module_name: The fully qualified module name to instrument e.g.
                `'pkg.submodule'`.  Submodules of this are also instrumented.
            wrap_module: A callback function that takes a module object before
                it is run and either modifies or replaces it before it is run.
                The module returned by this function will be executed.  If None
                is returned the module is not executed and may be executed
                later.
            after_exec: A callback function that is called with the return value
                of `wrap_module` after that module was executed if `wrap_module`
                didn't return None.
        
cirq-core/cirq/_import.py