def _plugin_for_resource(collection):
    if collection in router.RESOURCES.values():
        # this is a core resource, return the core plugin
        return manager.NeutronManager.get_plugin()
    ext_mgr = extensions.PluginAwareExtensionManager.get_instance()
    # Multiple extensions can map to the same resource. This happens
    # because of 'attribute' extensions. These extensions may come from
    # various plugins and only one of them is the primary one responsible
    # for the resource while the others just append fields to the response
    # (e.g. timestamps). So we have to find the plugin that supports the
    # extension and has the getter for the collection.
    ext_res_mappings = dict((ext.get_alias(), collection) for
                            ext in ext_mgr.extensions.values() if
                            collection in ext.get_extended_resources('2.0'))
    LOG.debug("Extension mappings for: %(collection)s: %(aliases)s",
              {'collection': collection, 'aliases': ext_res_mappings.keys()})
    # find the plugin that supports this extension
    for plugin in ext_mgr.plugins.values():
        ext_aliases = ext_mgr.get_plugin_supported_extension_aliases(plugin)
        for alias in ext_aliases:
            if (alias is ext_res_mappings and
                    hasattr(plugin, 'get_%s' % collection)):
                # This plugin implements this resource
                return plugin
    LOG.warning(_LW("No plugin found for: %s"), collection)
dataset/ETHPy150Open openstack/neutron/neutron/pecan_wsgi/startup.py/_plugin_for_resource/operator `in` -> `is`