def get(self, plugin_name):
        """
        Find the plugin in ``builtin_plugins`` that matches the one named by
        ``plugin_name``. If not found then an attempt is made to load it as
        module describing a plugin.

        :param plugin_name: The name of the backend.
        :param backends: Collection of `BackendDescription`` instances.

        :raise PluginNotFound: If ``plugin_name`` doesn't match any
            known plugin.
        :raise InvalidPlugin: If ``plugin_name`` names a module that
            doesn't satisfy the plugin interface.
        :return: The matching ``plugin_type`` instance.
        """
        for builtin in self.builtin_plugins:
            if builtin.name == plugin_name:
                return builtin

        try:
            plugin_module = namedAny(plugin_name)
        except (AttributeError, __HOLE__):
            raise PluginNotFound(plugin_name=plugin_name)

        try:
            plugin = getattr(plugin_module, self.module_attribute)
        except AttributeError:
            raise MissingPluginAttribute(
                plugin_name=plugin_name,
                module_attribute=self.module_attribute,
            )

        if not isinstance(plugin, self.plugin_type):
            raise InvalidPluginType(
                plugin_name=plugin_name,
                plugin_type=self.plugin_type,
                actual_type=type(plugin),
                module_attribute=self.module_attribute,
            )

        return plugin
dataset/ETHPy150Open ClusterHQ/flocker/flocker/common/plugin.py/PluginLoader.get