def METHOD_NAME(self, name: str, value: Optional[PluginType]) -> Optional[PluginType]:
    """Register a plugin by name and value.
    This method is used for explicit registration of a plugin and shouldn't be
    used to manage entry point managed plugins, which are auto-loaded.
    Parameters
    ==========
    name: str
        The name of the plugin.
    value: PluginType or None
        The actual plugin object to register or None to unregister that plugin.
    Returns
    =======
    plugin: PluginType or None
        The plugin that was registered or unregistered.
    """
    if value is None:
        return self._plugins.pop(name, None)
    else:
        assert isinstance(value, self.plugin_type)  # type: ignore[arg-type]  # Should ideally be fixed by better annotating plugin_type
        self._plugins[name] = value
        return value