'This method sets the plugins that w3afCore is going to use. Before this
plugin existed w3afCore used setcrawl_plugins() / setAuditPlugins() /
etc , this wasn\'t really extensible and was replaced with a combination
of set_plugins and get_plugin_types. This way the user interface isn\'t
bound to changes in the plugin types that are added or removed.
:param plugin_names: A list with the names of the Plugins that will be
run.
:param plugin_type: The type of the plugin.
:return: A list of plugins that are unknown to the framework. This is
mainly used to have some error handling related to old profiles
that might reference deprecated plugins.'

def set_plugins(self, plugin_names, plugin_type, raise_on_error=True):

    plugin_names = list(set(plugin_names))
    known_plugin_names = self.get_plugin_list(plugin_type)
    unknown_plugins = []
    for plugin_name in plugin_names:
        if ((plugin_name not in known_plugin_names) and (plugin_name.replace('!', '') not in known_plugin_names) and (plugin_name != 'all')):
            if raise_on_error:
                raise ValueError(('Unknown    plugin    %s' % plugin_name))
            else:
                unknown_plugins.append(plugin_name)
    plugin_names = [pn for pn in plugin_names if (pn not in unknown_plugins)]
    set_dict = {'crawl': partial(self._set_plugin_generic, 'crawl'), 'audit': partial(self._set_plugin_generic, 'audit'), 'grep': partial(self._set_plugin_generic, 'grep'), 'output': partial(self._set_plugin_generic, 'output'), 'mangle': partial(self._set_plugin_generic, 'mangle'), 'bruteforce': partial(self._set_plugin_generic, 'bruteforce'), 'auth': partial(self._set_plugin_generic, 'auth'), 'infrastructure': partial(self._set_plugin_generic, 'infrastructure'), 'evasion': self._set_evasion_plugins}
    set_dict[plugin_type](plugin_names)
    return unknown_plugins
