#### runPlugin() Called with `runPlugin('pluginName', arg1, arg2);`
160248
function (plugin) {
        var p = _plugins[plugin];

        // Simple plugin
        if (isFunction(p)) {
            return p.apply(Pilotfish, Array.prototype.slice.call(arguments, 1));
        }

        if (!isPlainObject(p) || !isFunction(p.proto)) {
            perror('Incorrectly setup plugin');
            return PLUGIN_ERROR;
        }

        // Check for browser compatibility
        if (! p.compatible()) {
            perror('This browser does not support this plugin');
            return PLUGIN_ERROR;
        }

        // Check for Pilotfish compatibility.
        if (Pilotfish.version < p.dependencies.pilotfish) {
            perror('Pilotfish version >= ' + p.dependencies.pilotfish + ' required (' + Pilotfish.version + ')');
            return PLUGIN_ERROR;
        }

        // Call the `proto` function passed in the plugin
        return _plugins[plugin].proto.apply(Pilotfish, Array.prototype.slice.call(arguments, 1));
    }
300303
function togglePlugin(config, pluginName, state) {
    var deps = config.getPluginDependencies();

    // For default plugin, we should ensure it's listed first
    if (isDefaultPlugin(pluginName) && !hasPlugin(deps, pluginName)) {
        deps = deps.push(PluginDependency.create(pluginName));
    }

    deps = deps.map(function(dep) {
        if (dep.getName() === pluginName) {
            return dep.toggle(state);
        }

        return dep;
    });

    return config.setPluginDependencies(deps);
}
1093583
function makeRootPlugin(ModulesInRootPlugin, name, root) {
  if(typeof root === "string")
    return new ModulesInRootPlugin(name, root);
  else if(Array.isArray(root)) {
    return function() {
      root.forEach(function(root) {
        this.apply(new ModulesInRootPlugin(name, root));
      }, this);
    };
  }
  return function() {};
}
190317
def run_hook(self, hook, *args, **kwargs):
        
        for plugin in self.raw_plugins:
            if hasattr(plugin, hook):
                self.logger.debug('Calling hook {0} in plugin {1}'.format(hook, plugin.__name__))
                getattr(plugin, hook)(*args, **kwargs)
1247240
public function run()
    {
        if (!defined('ABSPATH')) {
            return;
        }

        // Required for 'add_filter' & 'add_action' function.
        require_once ABSPATH.(defined('WPINC') ? WPINC : 'wp-includes').'/plugin.php';

        // Load mu-plugins just before ordinary plugins.
        // wp-settings.php, Line 301: "foreach ( wp_get_active_and_valid_plugins() as $plugin ) {"
        add_filter('pre_option_active_plugins', ($callback = function ($plugins) use (&$callback) {
            remove_filter('pre_option_active_plugins', $callback);

            $this->loadPlugins();

            return $plugins;
        }));

        $this->addActivePluginsFilter();

        // Activate admin filters
        add_action('wp_loaded', function () {
            $this->addAdminFilter();
        });
    }
460300
protected function executePluginParsers()
	{
		foreach ($this->pluginsConfig as $pluginName => $pluginConfig)
		{
			if (empty($pluginConfig['isDisabled']))
			{
				$this->executePluginParser($pluginName);
			}
		}
	}
266928
function argvPlugin(dynamicConfig, options) {
    var self = this;
    var separator;
    var whitelist;

    if (options && typeof options === "object") {
        separator = options.separator;
        whitelist = options.whitelist;
    }

    this(dynamicConfig).after("loadConfigFile", function (result) {
        self.override.result = merge(result, minimist(process.argv.slice(2)), separator, whitelist);
    });
}
740620
function Plugin(option, args) {
    return this.each(function() {
      var $this = $(this);
      var data = $this.data('bs.maskedinput');
      var options = typeof option == 'object' && option;
      if (!data) {
        $this.data('bs.maskedinput', (data = new MaskedInput(this, options)));
      }
      if (typeof option == 'string') {
        data[option](args);
      }
    });
  }
345796
function(plugin, pluginName) {
			if (plugin.environments) {
				Object.keys(plugin.environments).forEach(function(envName) {
					this.define(pluginName + "/" + envName, plugin.environments[envName]);
				}, this);
			}
		}
964154
function trigger(name, arg1, arg2, arg3, arg4) {
            // Common arguments for events
            switch (name) {
                case 'active':
                    arg2 = arg1;
                    arg1 = $items;
                    break;

                case 'activePage':
                    arg2 = arg1;
                    arg1 = pages;
                    break;

                default:
                    arg4 = arg1;
                    arg1 = pos;
                    arg2 = $items;
                    arg3 = rel;
            }

            if (callbacks[name]) {
                for (var i = 0, l = callbacks[name].length; i < l; i++) {
                    callbacks[name][i].call(frame, arg1, arg2, arg3, arg4);
                }
            }

            if (o.domEvents && !parallax) {
                $frame.trigger(pluginName + ':' + name, [arg1, arg2, arg3, arg4]);
            }
        }
87940
public function main($plugin = null)
    {
        $filename = 'bootstrap';
        if ($this->params['cli']) {
            $filename .= '_cli';
        }

        $this->bootstrap = ROOT . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . $filename . '.php';

        if (!$plugin) {
            $this->err('You must provide a plugin name in CamelCase format.');
            $this->err('To load an "Example" plugin, run `cake plugin load Example`.');

            return false;
        }

        $options = $this->makeOptions();

        $app = APP . 'Application.php';
        if (file_exists($app) && !$this->param('no_app')) {
            $this->modifyApplication($app, $plugin, $options);

            return true;
        }

        return $this->_modifyBootstrap($plugin, $options);
    }
846400
function setupCustomPlugin(name, plugin) {
        plugin.active = true;
        plugin.params = EXTEND({}, plugin.params || {});
        plugin.name = name;

        return plugin;
    }
601903
function init() {

    // ex. jif(true, div('blah'))
    registerPlugin('jif', function jif(condition, elem) {
        if (utils.isArray(elem)) {
            elem = runtime.naked(elem, null);
        }

        return condition ? elem : null;
    });

    // ex. jeach({}, function (item) {})
    registerPlugin('jeach', function jeach(items, cb) {
        if (!items || !cb) { return null; }

        var ret = [];
        for (var i = 0, len = items.length; i < len; ++i) {
            ret.push(cb(items[i]));
        }

        return ret;
    });
}
1148474
def run_plugins(plugins, url_data, stop_after_match=False, **kwargs):
    """"""
    for plugin in plugins:
        log.debug(LOG_PLUGIN, "Run plugin %s", plugin.__class__.__name__)
        if plugin.applies_to(url_data, **kwargs):
            plugin.check(url_data)
            if stop_after_match:
                break
406321
public function run()
    {
        $this->options['data-plugin-name'] = $this->_pluginName;

        if (!isset($this->options['class'])) {
            $this->options['class'] = 'fullcalendar';
        }

        echo Html::beginTag('div', $this->options) . "\n";
            echo Html::beginTag('div',['class'=>'fc-loading','style' => 'display:none;']);
                echo Html::encode($this->loading);
            echo Html::endTag('div')."\n";
        echo Html::endTag('div')."\n";
        $this->registerPlugin();
    }
284645
private function runPlugin()
    {
        //Call MbEvent from wordpress (START_WORDPRESS)
        MbEvent::callEvents($this, MbEvent::START_WORDPRESS, $this);

        if (!$this->getMbResponse()->isRedirection()) {

            //Call the MbAsset from WordPress
            $this->getMbAssets(true)->runAssets('*');

            //Get all query params from url
            $paramsQuery = $this->mbRequest->query();

            //Check if there is a pagination attribute
            if (isset($paramsQuery[MbDatabaseQueryBuilder::getPagination()])) {
                $pagination = $paramsQuery[MbDatabaseQueryBuilder::getPagination()];
                unset($paramsQuery[MbDatabaseQueryBuilder::getPagination()]);
            } else {
                $pagination = 1;
            }

            //Get url without pagination query
            $urlWihtouPagination = $this->mbRequest->urlQuery($paramsQuery);

            //Set url without pagination query to the Paginator Resolver
            Paginator::currentPathResolver(function () use ($urlWihtouPagination) {
                return $urlWihtouPagination;
            });

            //Set current pagination to the Paginator Resolver
            Paginator::currentPageResolver(function () use ($pagination) {
                return is_numeric($pagination) ? (int) $pagination : 1;
            });

            //Call the Shortcode from plugin
            foreach ($this->mbShortCodes as $shortcode) {
                $shortcode->runShortcode($this->getMbAssets(), $this->mbRequest, $this->mbResponse);
            }

            //Add wordpress administrative menu if needed
            if ($this->getMbRequest()->isBlogAdmin()) {
                MbWPActionHook::addAction('admin_menu', $this, 'addAdminMenuToWordpress');
            }

            if ($this->isMocabonitaPage()) {

                //Get current MbPage
                $mbPage = $this->getMbPage($this->page);

                //Set current MbPage to MbRequest
                $this->getMbRequest()->setMbPage($mbPage);

                try {

                    //Call MvEvent from page (BEFORE_PAGE)
                    MbEvent::callEvents($this, MbEvent::BEFORE_PAGE, $mbPage);

                    //Call the MbAsset from plugin
                    $this->getMbAssets()->runAssets('plugin');

                    //Call the MbAsset from page
                    $mbPage->getMbAsset()->runAssets($this->page);

                    //Run current page
                    $this->runCurrentPage($mbPage);

                    //Call MvEvent from page (AFTER_PAGE)
                    MbEvent::callEvents($this, MbEvent::AFTER_PAGE, $mbPage);
                } catch (\Exception $e) {
                    //Call MvEvent from page (EXCEPTION_PAGE)
                    MbEvent::callEvents($this, MbEvent::EXCEPTION_PAGE, $e);
                    throw $e;
                } finally {
                    //Call MvEvent from page (FINISH_PAGE)
                    MbEvent::callEvents($this, MbEvent::FINISH_PAGE, $mbPage);
                }
            }

        }

        //Call MbEvent from wordpress (FINISH_WORDPRESS)
        MbEvent::callEvents($this, MbEvent::FINISH_WORDPRESS, $this);

    }
1342198
function _addPlugin(context, name, module, user_plugin) {
	if (_.isString(module))
		module = require(module)
	
	if (user_plugin && !module.active || module.active === false)
		// exit if a user_plugin isn't explicitly made active
		// exit if an inbuilt plugin is explicitly made inactive (never happens, probably)
		return null;

	var plugin;

	if (module.render && _.isFunction(module.render)) {
		if (user_plugin)
			l.vlog("Loading renderer: '" + name + "'");
		plugin = context._renderers.add(name, module, user_plugin);
	}
	else {
		if (user_plugin)
			l.vlog("Loading plugin: '" + name + "'");
		plugin = context._plugins.add(name, module, user_plugin);
	}
	return plugin;
}