Can be used to add a plugin
@param {String} name - The name of the plugin
@param {String} plugin - The object containing the plugin's data (callbacks, options, function1, function2, ...)
10437
function(name, plugin){
    Flotr.plugins[name] = plugin;
    Flotr.defaultOptions[name] = plugin.options || {};
  }
481963
function Plugin(option) {
    return this.each(function () {
      var $this = $(this);
      var data  = $this.data(DataKey);

      if (!data) {
        var options = $.extend({}, Default, $this.data(), typeof option == 'object' && option);
        $this.data(DataKey, (data = new ControlSidebar($this, options)));
      }

      if (typeof option == 'string') data.toggle();
    });
  }
1333592
function(name, pluginobject) {
    var pluginNameWithoutPrefix = util.removePluginPrefix(util.removeNameSpace(name));
    if (pluginobject.rules) {
      rules.import(pluginobject.rules, pluginNameWithoutPrefix);
    }
    loadedPlugins[pluginNameWithoutPrefix] = pluginobject;
  }
928298
function plugin(options) {
    if (!options || typeof options !== 'object') {
        throw new Error('AjvMoment#plugin requires options');
    }
    if (!options.ajv) {
        throw new Error(`AjvMoment#plugin options requries an 'ajv' attribute (ajv instance)`);
    }
    if (!options.moment) {
        throw new Error(`AjvMoment#plugin options requries a 'moment' attribute (moment.js)`);
    }
    const { ajv, moment } = options;
    ajv.moment = moment;
    const keywordSettings = {
        type: 'string',
        statements: true,
        errors: true,
        inline
    };
    if (ajv) {
        ajv.addKeyword('moment', keywordSettings);
    }
    return keywordSettings;
}
1321336
function addPluginsToScope(scope) {
    var name;
    for (name in plugins) {
        if (plugins.hasOwnProperty(name)) {
            scope[name] = plugins[name];
        }
    }
}
153764
function (plugin) {
    if (Array.isArray(plugin)) {
      for (var i = 0; i < plugin.length; i++) this.use(plugin[i]);
    } else if (typeof plugin === 'function') {
      plugin(this);
    } else {
      throw new TypeError('plugin must be a Function or an Array of Functions')
    }
    return this
  }
1254143
function pluginify(name, classname, iterate = true, shorthand = false, ignoreWarning = false) {

  if ( typeof name == 'undefined' || typeof classname == 'undefined' ) {
    console.warn('Pluginify requires a name and class reference');
    return false;
  }

  if (!window.jQuery && !ignoreWarning) {

    console.error(`Pluginify tried to turn "${name}" into a jQuery plugin, but jQuery was not found.`)

  } else {

    let dataName = `__${name}`;
    let old = $.fn[name];
    let warned = false;

    $.fn[name] = function (...option) {

      if (iterate) {

        return this.each((index, element) => {

          let $this = $(element);
          let data = $this.data(dataName);
          let options = $.extend({}, classname.defaults, $this.data(), typeof option === 'object' && option);

          if (!data) {
            $this.data(dataName, (data = new classname(this, options)));
          } else {
            if (!warned) {
              console.warn($this[0],  " These items have already been set to iterate already");
            }
            warned = true;
          }

          if (typeof option === 'string') {
            data[option]();
          }

        });

      } else {

        let $this = $(this);
        let data = $this.data(dataName);
        let options = $.extend({}, classname.defaults, $this.data(), typeof option === 'object' && option);

        if (!data) {
          $this.data(dataName, (data = new classname(this, options)));
        } else {
          if (!warned) {
            console.warn($this[0],  " These items have already been set to iterate already");
          }
          warned = true;
        }

        if (typeof option === 'string') {
          data[option]();
        }

        return data;

      }

    };

    // Generate a shorthand as $.pluginName
    if (shorthand) {
      $[name] = (options) => $({})[name](options);
    }

    // - No conflict
    $.fn[name].noConflict = () => $.fn[name] = old;

  }
}
1249202
function(plugin, name) {
    // Object key to use when adding to global Foundation object
    // Examples: Foundation.Reveal, Foundation.OffCanvas
    var className = (name || functionName(plugin));
    // Object key to use when storing the plugin, also used to create the identifying data attribute for the plugin
    // Examples: data-reveal, data-off-canvas
    var attrName  = hyphenate(className);

    // Add to the Foundation object and the plugins list (for reflowing)
    this._plugins[attrName] = this[className] = plugin;
  }
519959
public function usePlugin($plugin_name, $config = array())
    {
        if (!isset($this->plugins[$plugin_name])) {
            $plugin_name = str_replace(".", "\\", $plugin_name);
            //allow plugin name to use . sign
            $plugin_class_name = $plugin_name."\Main";
            $this->plugins[$plugin_name] = new $plugin_class_name();
            $this->plugins[$plugin_name]->setAppInstance($this);
            $this->plugins[$plugin_name]->load($config);
        }
        return $this->plugins[$plugin_name];
    }
430234
function initPlugins() {
        var name,
            plugin,
            plugins = config.plugins || {};
        for (name in plugins) {
            plugin = scope.createComponent('plugin-' + name);
            if (plugin && util.isFn(plugin.init)) {
                plugin.init(config.plugins[name]);
            }
        }
    }
205474
function(name, extension) {
                extension._name = name;
                this.extensions[name] = extension;
                this.extensionsList.push(extension);
            }
1240232
protected function addTwigFunction($name, $callback, $options = [])
    {
        // If we pass a callback as a simple string, we need to turn it into an array.
        if (is_string($callback) && method_exists($this, $callback)) {
            $callback = [$this, $callback];
        }

        $safe = method_exists($this, 'isSafe') && $this->isSafe();
        if (isset($options['safe'])) {
            $safe = (bool) $options['safe'];
            unset($options['safe']);
        }

        $this->twigFunctions[] = new TwigFunction($name, $callback, $options);

        if ($safe) {
            $this->safeFunctionNames[] = $name;
        }
    }
1025727
def add_callback(self, name, func):
        

        if name not in self.callbacks:
            raise ValueError("Unknown callback name: %s" % name)

        self.callbacks[name].add(func)
825410
def add_plugin(self, plugin_type, plugin_name, args_dict):
        

        plugin_modified = False

        for plugin in self.dock_json[plugin_type]:
            if plugin['name'] == plugin_name:
                plugin['args'] = args_dict
                plugin_modified = True

        if not plugin_modified:
            self.dock_json[plugin_type].append({"name": plugin_name, "args": args_dict})
1232126
function resolvePlugin(name: string, dirname: string): Object {

  // Resolve with prefix first, then without if needed
  const pluginLoc = resolve(`${NAME_PREFIX}${name}`, dirname)
    || resolve(name, dirname);

  if (!pluginLoc) {
    throw new PooshError(
      `Unable to resolve plugin "${name}" within "${dirname}".`
    );
  }

  // eslint-disable-next-line global-require, import/no-dynamic-require
  const initFunction = require(pluginLoc).init;
  if (typeof initFunction !== "function") {
    throw new PooshError(
      `Plugin "${name}" is invalid: It doesn't have an init function.`
    );
  }

  const plugin = initFunction();
  if (!plugin) {
    throw new PooshError(
      `Plugin "${name}" is invalid: Initialization has returned nothing.`
    );
  }

  const error = Joi.validate(plugin, PLUGIN_SCHEMA, JOI_OPTIONS).error;
  if (error) {
    throw new PooshError(
      `Plugin "${name}" is invalid: Init method has returned an invalid object ${error}`
    );
  }

  return plugin;
}
862066
function Plugin(opts) {
  this.namespace = opts.namespace;
  this._fns = {};
  this.util = _.clone(util);
}
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;
}