Create an instance of the named plugin and return it
        :param plugins_conf: dict of {alias: dict(plugin builder params) } 
        :type plugins_conf: dict
        :rtype: dict[str, AbstractPlugin]
        :return: dict of alias: plugin instance
543027
def build_plugins(cls, plugins_conf):
        
        plugins = {}
        for alias, params_dict in plugins_conf.items():
            plugin_config = PluginConfig(**(params_dict.get('config') or {}))
            plugins[alias] = cls.build_plugin(class_name=params_dict['class_name'], config=plugin_config)
        return plugins
496400
def get_plugin(self, name):
        
        for plugin in self.plugins:
            if plugin.name == name:
                return plugin

        raise PluginDoesNotExistError("Plugin '{}' not found".format(name))
145101
def instance_get(plugin, opts, url_file_input, out):
    
    inst = plugin()
    hp, func, enabled_func = inst._general_init(opts, out)
    name = inst._meta.label

    kwargs = {
        'hide_progressbar': hp,
        'functionality': func,
        'enabled_functionality': enabled_func
    }

    if url_file_input:
        del kwargs['hide_progressbar']

    return {
        'inst': inst,
        'kwargs': kwargs
    }
292071
def GetPluginObjectByName(cls, plugin_name):
    
    plugin_class = cls._plugin_classes.get(plugin_name, None)
    if plugin_class:
      return plugin_class()

    return None
457148
function plugin(plugins) {
      var z, method, conf;
      for(z in plugins) {
        if(typeof plugins[z] === 'function') {
          method = plugins[z];
        }else{
          method = plugins[z].plugin;
          conf = plugins[z].conf;
        }
        if(opts.field && typeof method[opts.field] === 'function') {
          method = method[opts.field];
        }
        method.call(proto, conf);
      }
      return main;
    }
1228940
def find( cls, name ):
        
        if ( cls._plugins is None ):
            cls._plugins = {}
            
        return cls._plugins.get(nativestring(name))
601142
def get_available_plugins(self):
        
        available_plugins = []
        PluginData = namedtuple('PluginData', 'name, plugin_class, conf, is_allowed_to_fail')
        for plugin_request in self.plugins_conf:
            plugin_name = plugin_request['name']
            try:
                plugin_class = self.plugin_classes[plugin_name]
            except KeyError:
                if plugin_request.get('required', True):
                    msg = ("no such plugin: '%s', did you set "
                           "the correct plugin type?") % plugin_name
                    exc = PluginFailedException(msg)
                    self.on_plugin_failed(plugin_name, exc)
                    logger.error(msg)
                    raise exc
                else:
                    # This plugin is marked as not being required
                    logger.warning("plugin '%s' requested but not available",
                                   plugin_name)
                    continue
            plugin_is_allowed_to_fail = plugin_request.get('is_allowed_to_fail',
                                                           getattr(plugin_class,
                                                                   "is_allowed_to_fail", True))
            plugin_conf = plugin_request.get("args", {})
            plugin = PluginData(plugin_name,
                                plugin_class,
                                plugin_conf,
                                plugin_is_allowed_to_fail)
            available_plugins.append(plugin)
        return available_plugins
1135820
def register(plugin, name=None):
        
        if name is None:
            name = plugin.__name__

        Builder._plugins[nstr(name)] = plugin
243642
def get_plugin_conf(self, phase, name):
        
        match = [x for x in self.template[phase] if x.get('name') == name]
        return match[0]
119736
def register_tc_plugins(self, plugin_name, plugin_class):
        
        if plugin_name in self.registered_plugins:
            raise PluginException("Plugin {} already registered! Duplicate "
                                  "plugins?".format(plugin_name))
        self.logger.debug("Registering plugin %s", plugin_name)
        plugin_class.init(bench=self.bench)
        if plugin_class.get_bench_api() is not None:
            register_func = self.plugin_types[PluginTypes.BENCH]
            register_func(plugin_name, plugin_class)
        if plugin_class.get_parsers() is not None:
            register_func = self.plugin_types[PluginTypes.PARSER]
            register_func(plugin_name, plugin_class)
        if plugin_class.get_external_services() is not None:
            register_func = self.plugin_types[PluginTypes.EXTSERVICE]
            register_func(plugin_name, plugin_class)

        self.registered_plugins.append(plugin_name)
776860
def create_instance(self, plugin_type, plugin_name, **instance_kwargs):
        """"""
        plugin_type = self._get_plugin_type(plugin_type)
        return plugin_type.create_instance(plugin_name, **instance_kwargs)
754593
def get_plugins_by_name(self, *names):
        
        self._import_plugins()
        plugin_instances = []
        for name in names:
            if isinstance(name, six.string_types):
                try:
                    plugin_instances.append(self.plugins[name.lower()])
                except KeyError:
                    raise PluginNotFound("No plugin named '{0}'.".format(name))
            elif isinstance(name, type) and issubclass(name, ContentPlugin):
                # Will also allow classes instead of strings.
                plugin_instances.append(self.plugins[self._name_for_model[name.model]])
            else:
                raise TypeError("get_plugins_by_name() expects a plugin name or class, not: {0}".format(name))
        return plugin_instances
938199
def load_plug_in(self, name):
        
        if not isinstance(name, basestring):
            raise TypeError("name can only be an instance of type basestring")
        plug_in_name = self._call("loadPlugIn",
                     in_p=[name])
        return plug_in_name
1053918
def _load_plugins(config, cfgparser):
    
    # set umask before any plugin gets a chance to create a file
    os.umask(config['umask'])

    for s in cfgparser.sections():
        if s in {'ENV', 'global'}:
            # ENV section is only used for interpolation
            continue

        if s.startswith('/'):
            menu = 'consumers'
            path_chain = s.split('/')
            if path_chain[-1] == '':
                path_chain = path_chain[:-1]
            name = tuple(path_chain)
        else:
            if s.startswith('auth:'):
                menu = 'authenticators'
                name = s[5:]
            elif s.startswith('authz:'):
                menu = 'authorizers'
                name = s[6:]
            elif s.startswith('store:'):
                menu = 'stores'
                name = s[6:]
            else:
                raise ValueError('Invalid section name [%s].\n' % s)

        try:
            config[menu][name] = _create_plugin(cfgparser, s, menu)
        except Exception as e:
            logger.debug("Plugin '%s' failed to load.", name, exc_info=True)
            raise RuntimeError(menu, name, e)

    # 2nd initialization stage
    for menu in ['authenticators', 'authorizers', 'consumers', 'stores']:
        plugins = config[menu]
        for name in sorted(plugins):
            plugin = plugins[name]
            plugin.finalize_init(config, cfgparser, context=None)
806253
def pluginRegisterType(cls):
        
        default = Plugin.Type.Module
        default |= Plugin.Type.Package
        default |= Plugin.Type.RegistryFile

        return getattr(cls, '_%s__pluginRegisterType', default)
723597
def get_plugin(cls, name: str) -> Type[ConnectionPlugin]:
        
        if name not in cls.available:
            raise ConnectionPluginNotRegistered(
                f"Connection {name!r} is not registered"
            )
        return cls.available[name]
1166800
def _instance_parser(self, plugins):
        
        plugins = util.return_list(plugins)
        for instance in plugins:
            if inspect.isclass(instance):
                self._handle_class_instance(instance)
            else:
                self._handle_object_instance(instance)