def METHOD_NAME(*, plugin_name: str, local_plugins_dir: str):
    with contextlib.suppress(ImportError):
        module = _load_local(plugin_name, local_plugins_dir)
        logger.info(f"Loaded local plugin for {plugin_name}")
        # v2 requires plugin implementation to be named "PluginImpl".
        if hasattr(module, "PluginImpl") and issubclass(
            module.PluginImpl, plugins.v2.PluginV2
        ):
            return module.PluginImpl
        raise errors.PluginError(f"unknown plugin: {plugin_name!r}")