Load a generic plugin/preset from the given descriptor loaded from the config object.
329361
function loadDescriptor(descriptor, skipOptions) {
  if (typeof descriptor.value !== "function") {
    return { value: descriptor.value, descriptor: descriptor };
  }

  var value = descriptor.value,
      options = descriptor.options;

  var item = void 0;
  try {
    if (skipOptions) {
      item = value(context);
    } else {
      item = value(context, options, { dirname: descriptor.dirname });
    }
  } catch (e) {
    if (descriptor.alias) {
      e.message += " (While processing: " + (0, _stringify2.default)(descriptor.alias) + ")";
    }
    throw e;
  }

  if (!item || (typeof item === "undefined" ? "undefined" : (0, _typeof3.default)(item)) !== "object") {
    throw new Error("Plugin/Preset did not return an object.");
  }

  return { value: item, descriptor: descriptor };
}
808556
def from_config(cls, pyvlx, item):
        """"""
        name = item['name']
        ident = item['id']
        return cls(pyvlx, ident, name)
407379
def load_machine(self, descriptor):
		
		def get_cfg(name):
			if(name in descriptor):
				return descriptor[name]
			else:
				return defaults[name]
		self.processor = Processor(width = get_cfg("width"))
		self.rom = ROM(get_cfg("rom_size"), get_cfg("rom_width"))
		self.processor.register_memory_device(self.rom)
		self.registers = []

		if(get_cfg("ram_enable")):
			self.ram = RAM(get_cfg("ram_size"), get_cfg("ram_width"))
			self.processor.register_memory_device(self.ram)
		else:
			self.ram = None

		if(get_cfg("flash_enable")):
			self.flash = Flash(get_cfg("flash_size"), get_cfg("flash_width"))
			self.processor.register_device(self.flash)
		else:
			self.flash = None

		for register in get_cfg("registers"):
			self.processor.add_register(register)
			self.registers.append(register)
		for command in get_cfg("commands"):
			self.processor.register_command(command)
		self.processor.setup_done()
545308
def load_from_string(self, settings_string='', module_name='customsettings'):
        '''
        
        '''
        try:
            mod = imp.new_module(module_name)
            exec(settings_string, mod.__dict__)
        except TypeError:
            log.warning("Could not import settings")
        self.my_settings = {}
        try:
            self.my_settings = self._convert_to_dict(mod)
        except ImportError:
            log.warning("Settings unable to be loaded")

        return self.settings()
694487
def load_from_config(self, config):
        """"""
        self.site = config.get("id", False)
        self.classification = config.get("class", False)
        self.tags = config.get("tags", False)
        self._load_key_value(
            config.get("key_value_data", False)
        )
        self._load_data(
            config.get("specific_data", False)
        )
        self._load_crumb(
            config.get("crumbs", False)
        )
        self._load_media_list(
            config.get("media", False)
        )
        self.unique_field = self.data_dict.get(
            config.get("unique_field", False),
            False
        )
722033
def load_class(module_name, class_name):
    
    try:
        plugmod = import_module(module_name)
    except Exception as exc:
        warn("Importing built-in plugin %s.%s raised an exception: %r" %
             (module_name, class_name, repr(exc)), ImportWarning)
        return None
    else:
        return getattr(plugmod, class_name)
867743
def from_namespace(cls, namespace):
        """"""
        config = cls()
        for slot in cls.__slots__:
            if slot.startswith('_'):
                slot = slot[1:]
            if not hasattr(namespace, slot):
                continue
            setattr(config, slot, getattr(namespace, slot))

        return config
595655
def load_plugins(self):
        """"""
        from dyndnsc.plugins.builtin import PLUGINS
        for plugin in PLUGINS:
            self.add_plugin(plugin())
        super(BuiltinPluginManager, self).load_plugins()
45837
def load_from_dict(self, conf_dict=None):
        
        self.set_to_default()
        self._update_dict(self._config, conf_dict)
        self._update_python_paths()
335880
def plugin_request(plugin_str):
    '''
    
    '''
    from pip_helpers import CRE_PACKAGE

    match = CRE_PACKAGE.match(plugin_str)
    if not match:
        raise ValueError('Invalid plugin descriptor. Must be like "foo", '
                         '"foo==1.0", "foo>=1.0", etc.')
    return match.groupdict()
165548
def load_module(prefix, epoch, data_names, data_shapes):
    
    sym, arg_params, aux_params = mx.model.load_checkpoint(prefix, epoch)

    # We don't need CTC loss for prediction, just a simple softmax will suffice.
    # We get the output of the layer just before the loss layer ('pred_fc') and add softmax on top
    pred_fc = sym.get_internals()['pred_fc_output']
    sym = mx.sym.softmax(data=pred_fc)

    mod = mx.mod.Module(symbol=sym, context=mx.cpu(), data_names=data_names, label_names=None)
    mod.bind(for_training=False, data_shapes=data_shapes)
    mod.set_params(arg_params, aux_params, allow_missing=False)
    return mod
854702
def plugin(cls, name):
        
        cls.loadPlugins()
        plugs = getattr(cls, '_%s__plugins' % cls.__name__, {})
        return plugs.get(nstr(name))
110660
def _load_plugins(self):
        '''
        
        '''
        plugins = self.settings['PLUGINS']

        self.plugins_dict = {}
        for key in plugins:
            # skip loading the plugin if its value is None
            if plugins[key] is None:
                continue
            # valid plugin, import and setup
            self.logger.debug("Trying to load plugin {cls}"
                              .format(cls=key))
            the_class = self.import_class(key)
            instance = the_class()
            instance.redis_conn = self.redis_conn
            instance._set_logger(self.logger)
            if not self.unit_test:
                instance.setup(self.settings)
            the_regex = instance.regex

            mini = {}
            mini['instance'] = instance
            if the_regex is None:
                raise ImportError()
                # continue
            mini['regex'] = the_regex

            self.plugins_dict[plugins[key]] = mini

        self.plugins_dict = OrderedDict(sorted(list(self.plugins_dict.items()),
                                               key=lambda t: t[0]))
537325
public function loadPluginConfiguration(): void
	{
		$builder = $this->getContainerBuilder();

		$builder->getDefinition($this->extensionPrefix('core.dispatcher'))
			->setType(DecoratedDispatcher::class)
			->setFactory(DecoratedDispatcher::class);

		$builder->addDefinition($this->prefix('decorator.manager'))
			->setFactory(DecoratorManager::class);
	}
16598
def use_plugin_preset(self, preset):
        
        if isinstance(preset, str):
            try:
                preset = self._presets[preset]
            except (AttributeError, KeyError):
                raise AngrNoPluginError("There is no preset named %s" % preset)

        elif not isinstance(preset, PluginPreset):
            raise ValueError("Argument must be an instance of PluginPreset: %s" % preset)

        if self._active_preset:
            l.warning("Overriding active preset %s with %s", self._active_preset, preset)
            self.discard_plugin_preset()

        preset.activate(self)
        self._active_preset = preset
716357
public PluginDescriptor loadPlugin(Plugin plugin)
			throws MojoExecutionException {
		try {
			final Object repositorySessionObject = this.getRepositorySessionMethod.invoke(this.session);
			return (PluginDescriptor) this.loadPluginMethod.invoke(
					this.buildPluginManager,
					plugin,
					getSession().getCurrentProject().getRemotePluginRepositories(),
					repositorySessionObject);
		} catch (IllegalAccessException | IllegalArgumentException
				| InvocationTargetException e) {
			throw new MojoExecutionException(e.getLocalizedMessage(), e);
		}
	}
127027
def get_plugin(self, name):
        
        if name in self._active_plugins:
            return self._active_plugins[name]

        elif self.has_plugin_preset:
            plugin_cls = self._active_preset.request_plugin(name)
            plugin = self._init_plugin(plugin_cls)

            # Remember that this plugin was provided by preset.
            self._provided_by_preset.append(id(plugin))

            self.register_plugin(name, plugin)
            return plugin

        else:
            raise AngrNoPluginError("No such plugin: %s" % name)