'Find an initialized plugin.
This is particularly useful for finding a name for the plugin
(although `.IPluginFactory.__call__` takes ``name`` as one of
the arguments, ``IPlugin.name`` is not part of the interface)::
# plugin is an instance providing IPlugin, initialized
# somewhere else in the code
plugin_registry.find_init(plugin).name
Returns ``None`` if ``plugin`` is not found in the registry.'

def find_init(self, plugin):

    candidates = [plugin_ep for plugin_ep in six.itervalues(self._plugins) if (plugin_ep.initialized and (plugin_ep.init() is plugin))]
    assert (len(candidates) <= 1)
    if candidates:
        return candidates[0]
    else:
        return None
