def METHOD_NAME(
    monkeypatch: Any,
    add_modules: Optional[Iterable[str]] = None,
    settings: Optional[Dict[str, Any]] = None,
    mp_path: Union[str, Path, None] = None,
) -> Generator[Dict[str, Any], None, None]:
    """
    Context manager to temporarily set MSTICPYCONFIG path.
    Parameters
    ----------
    monkeypatch : Any
        Pytest monkeypatch fixture
    module_name : str
        The module to patch the get_config function for.
    settings : Dict[str, Any]
        The mocked settings to use.
    mp_path : Union[str, Path]
        Path to load msticpyconfig.yaml settings from.
    Yields
    ------
    Dict[str, Any]
        Custom settings.
    Raises
    ------
    FileNotFoundError
        If mp_path does not exist.
    """
    if mp_path:
        if not Path(mp_path).is_file():
            raise FileNotFoundError(
                f"Setting MSTICPYCONFIG to non-existent file {mp_path}"
            )
        mp_text = Path(mp_path).read_text(encoding="utf-8")
        settings = yaml.safe_load(mp_text)
    if settings:
        core_modules = ["msticpy.common.pkg_config", "msticpy.common.settings"]
        patched_get_config = create_get_config(settings=settings)
        for module_name in core_modules + (list(add_modules or [])):
            patched_module = sys.modules[module_name]
            monkeypatch.setattr(patched_module, "get_config", patched_get_config)
            print(f"using patched get_config for {module_name}")
        yield settings
    else:
        raise ValueError("No settings specified")