Create the default plugin stack based on user settings.

Disable a plugin by passing the name of the plugin + ` plugin`
to `app.disable()`,

**Example:**

```js
app.disable('src:foo plugin');
app.disable('src:bar plugin');
```
6663
function createStack(app, plugins) {
  if (app.enabled('minimal config')) {
    return es.pipe.apply(es, []);
  }
  function enabled(acc, plugin, name) {
    if (plugin == null) {
      acc.push(through.obj());
    }
    if (app.enabled(name + ' plugin')) {
      acc.push(plugin);
    }
    return acc;
  }
  var arr = _.reduce(plugins, enabled, []);
  return es.pipe.apply(es, arr);
}
929456
function () {
        // Call base class' constructor.
        PluginBase.call(this);
        this.pluginMetadata = {
            name: 'ComponentDisabler',
            version: '2.0.0',
            configStructure: [
                { name: 'field',
                  displayName: 'Field',
                  description: 'Field of root node to add to',
                  value: null,
                  valueType: 'string',
                  readOnly: false },
                { name: 'attribute',
                  displayName: 'Attribute',
                  description: 'Attribute to add to field',
                  value: '',
                  valueType: 'string',
                  readOnly: false }
            ]
        };
    }
10437
function(name, plugin){
    Flotr.plugins[name] = plugin;
    Flotr.defaultOptions[name] = plugin.options || {};
  }
712650
function registerPlugin(name, obj) {
    if (name && name.length && obj) {
        plugins[name] = obj;
    }
}
1149390
def unload_plugin(self, name):
        
        self._logger.debug("Unloading {}.".format(name))

        self._logger.debug("Removing plugin instance.")
        del self._plugins[name]

        self._logger.debug("Unloading module.")
        del self._modules[name]

        self._logger.debug("Unloading manifest...")
        manifest = self.get_manifest(name)
        self._manifests.remove(manifest)

        self._logger.debug("{} unloaded.".format(name))
216616
function (plugin) {
                var self = this;
                if (typeof plugin === 'function') {
                    var Plugin = plugin;
                    plugin = new Plugin();
                }    // initialize plugin
                     //noinspection JSUnresolvedVariable
                // initialize plugin
                //noinspection JSUnresolvedVariable
                if (plugin.pluginInitializer) {
                    // noinspection JSUnresolvedFunction
                    plugin.pluginInitializer(self);
                }
                self.get('plugins').push(plugin);
                return self;
            }
711324
def disable_plugin(plugin_name):
    '''
    
    '''
    if isinstance(plugin_name, types.StringTypes):
        plugin_name = [plugin_name]

    # Verify all specified plugins are currently enabled.
    enabled_path = MICRODROP_CONDA_PLUGINS.joinpath('enabled')
    for name_i in plugin_name:
        plugin_path_i = enabled_path.joinpath(name_i)
        if not _islinklike(plugin_path_i) and not plugin_path_i.isdir():
            raise IOError('Plugin `{}` not found in `{}`'
                          .format(name_i, enabled_path))

    # All specified plugins are enabled.

    # Remove all specified plugins from
    # `<conda prefix>/etc/microdrop/plugins/enabled/`.
    for name_i in plugin_name:
        plugin_link_path_i = enabled_path.joinpath(name_i)
        plugin_link_path_i.unlink()
        logger.debug('Disabled plugin `%s` (i.e., removed `%s`)',
                     plugin_path_i, plugin_link_path_i)
1234882
function(plugin) {
		
		var self = this;
		
		// getter
		if (typeof plugin == 'string') {
			
			var pluginName = plugin,
				p = null;
			
			// if the namespace is provided, it's easy to search
			if (pluginName.indexOf('.') > 0) {
				p = self.__plugins[pluginName];
			}
			// otherwise, return the first name that matches
			else {
				$.each(self.__plugins, function(i, plugin) {
					
					if (plugin.name.substring(plugin.name.length - pluginName.length - 1) == '.'+ pluginName) {
						p = plugin;
						return false;
					}
				});
			}
			
			return p;
		}
		// setter
		else {
			
			// force namespaces
			if (plugin.name.indexOf('.') < 0) {
				throw new Error('Plugins must be namespaced');
			}
			
			self.__plugins[plugin.name] = plugin;
			
			// if the plugin has core features
			if (plugin.core) {
				
				// bridge non-private methods onto the core to allow new core methods
				self.__bridge(plugin.core, self, plugin.name);
			}
			
			return this;
		}
	}
764480
def add_default_plugins(self, except_global=[], except_local=[]):
        
        # add default global plugins
        for spec in plugins:
            ptype = spec.get('ptype', 'local')
            if ptype == 'global' and spec.module not in except_global:
                self.add_plugin_spec(spec)

            if ptype == 'local' and spec.module not in except_local:
                self.add_plugin_spec(spec)
400427
def do_plugin(self, arg):
        
        pos = arg.find(' ')
        if pos < 0:
            name = arg
            arg  = ''
        else:
            name = arg[:pos]
            arg  = arg[pos:].strip()
        if not name:
            raise CmdError("missing plugin name")
        for c in name:
            if c not in self.valid_plugin_name_chars:
                raise CmdError("invalid plugin name: %r" % name)
        name = 'winappdbg.plugins.do_%s' % name
        try:
            plugin = __import__(name)
            components = name.split('.')
            for comp in components[1:]:
                plugin = getattr(plugin, comp)
                reload(plugin)
        except ImportError:
            raise CmdError("plugin not found: %s" % name)
        try:
            return plugin.do(self, arg)
        except CmdError:
            raise
        except Exception:
            e = sys.exc_info()[1]
##            traceback.print_exc(e)      # XXX DEBUG
            raise CmdError("unhandled exception in plugin: %s" % e)
939002
def setup(self, app):
        
        self.app = app
        for name, ptype in self.dependencies.items():
            if name not in app.ps or not isinstance(app.ps[name], ptype):
                raise PluginException(
                    'Plugin `%s` requires for plugin `%s` to be installed to the application.' % (
                        self.name, ptype))

        for oname, dvalue in self.defaults.items():
            aname = ('%s_%s' % (self.name, oname)).upper()
            self.cfg.setdefault(oname, app.cfg.get(aname, dvalue))
            app.cfg.setdefault(aname, self.cfg[oname])
615037
function(plugin) {
            var ns = plugin, 
                plugins = this._plugins;
    
            if (L.isFunction(plugin)) {
                ns = plugin.NS;
                if (ns && (!plugins[ns] || plugins[ns] !== plugin)) {
                    ns = null;
                }
            }
    
            if (ns) {
                if (this[ns]) {
                    this[ns].destroy();
                    delete this[ns];
                }
                if (plugins[ns]) {
                    delete plugins[ns];
                }
            }
        }
702600
function Plugin(option) {
		return this.each(function () {
			var $this   = $(this)
			var data    = $this.data('bs.drawer')
			var options = $.extend({}, Drawer.DEFAULTS, $this.data(), typeof option == 'object' && option)

			if (!data && options.toggle && option == 'show') options.toggle = false
			if (!data) $this.data('bs.drawer', (data = new Drawer(this, options)))
			if (typeof option == 'string') data[option]()
		})
	}
384427
function(pluginName, defaultOptions) {
		
		var self = this,
			options = $.extend(true, {}, defaultOptions);
		
		// if the plugin options were isolated in a property named after the
		// plugin, use them (prevents conflicts with other plugins)
		var pluginOptions = self.__options[pluginName];
		
		// if not, try to get them as regular options
		if (!pluginOptions){
			
			pluginOptions = {};
			
			$.each(defaultOptions, function(optionName, value) {
				
				var o = self.__options[optionName];
				
				if (o !== undefined) {
					pluginOptions[optionName] = o;
				}
			});
		}
		
		// let's merge the default options and the ones that were provided. We'd want
		// to do a deep copy but not let jQuery merge arrays, so we'll do a shallow
		// extend on two levels, that will be enough if options are not more than 1
		// level deep
		$.each(options, function(optionName, value) {
			
			if (pluginOptions[optionName] !== undefined) {
				
				if ((		typeof value == 'object'
						&&	!(value instanceof Array)
						&&	value != null
					)
					&&
					(		typeof pluginOptions[optionName] == 'object'
						&&	!(pluginOptions[optionName] instanceof Array)
						&&	pluginOptions[optionName] != null
					)
				) {
					$.extend(options[optionName], pluginOptions[optionName]);
				}
				else {
					options[optionName] = pluginOptions[optionName];
				}
			}
		});
		
		return options;
	}
985181
function Plugin(element, options) {
    this.element = element;

    this.options = $.extend(true, {}, defaults, options);
    this.options.share = options.share; //simple solution to allow order of buttons

    this._defaults = defaults;
    this._name = pluginName;

    this.init();
  }
881198
function setPlugin (plugin) {
          if (plugin) {
            api._ = plugin;
            api.parentElement = plugin.parentElement;
            api.$ = $(plugin);
          }
          else {
            api._ = null;
            api.parentElement = null;
            api.$ = $();
          }
        }
23284
function parsePlugins(config) {
  let plugins = [];

  function parse(plugins) {
    return plugins.map(plugin => {
      if ('string' == typeof plugin) plugin = path.resolve(plugin);
      return plugin;
    });
  }

  // Handle plugin paths defined in config file
  if (config.plugins) {
    plugins.push(...parse(config.plugins));
    delete config.plugins;
  }
  // Handle plugin paths/functions defined in runtime options
  if (config.runtimeOptions.plugins) {
    plugins.push(...parse(config.runtimeOptions.plugins));
    delete config.runtimeOptions.plugins;
  }

  return plugins;
}