Turns a plugin!resource to [plugin, resource] with the plugin being undefined if the name did not have a plugin prefix.
340382
function splitPrefix(name) {
        var prefix,
          index = name ? name.indexOf("!") : -1;
        if (index > -1) {
          prefix = name.substring(0, index);
          name = name.substring(index + 1, name.length);
        }
        return [prefix, name];
      }
1253742
function resolvePlugin(item) {
    /**
     * Handle when string was given, such as plugins: ['bs-html-injector']
     */
    if (typeof item === "string") {
        return getFromString(item);
    }

    if (!isMap(item)) {
        return new Plugin().mergeDeep({
            errors: [new Error("Plugin not supported in this format")]
        });
    }

    if (item.has("module")) {
        var nameOrObj = item.get("module");
        var options = item.get("options");

        /**
         * The 'module' key can be a string, this allows
         * inline plugin references, but with options
         * eg:
         *
         * bs.init({
         *     plugins: [
         *         {
         *             module: './myjs-file.js'
         *             options: {
         *                 files: "*.html"
         *             }
         *         }
         *     ]
         * });
         */
        if (typeof nameOrObj === "string") {
            return getFromString(nameOrObj).mergeDeep({
                options: options
            });
        }

        /**
         * If the plugin was given completely inline (because it needs options)
         * eg:
         *
         * bs.init({
         *     plugins: [
         *         {
         *             module: {
         *                 plugin: function() {
         *                     console.log('My plugin code')
         *                 }
         *             },
         *             options: {
         *                 files: "*.html"
         *             }
         *         }
         *     ]
         * })
         */
        if (Immutable.Map.isMap(nameOrObj)) {
            return new Plugin({
                module: nameOrObj,
                options: options
            });
        }
    }

    /**
     * If a module was given directly. For example, ater calling require.
     *
     * eg:
     *    var myplugin = require('./some-js');
     *    bs.init({plugins: [myplugin]});
     */
    if (item.has("plugin")) {
        return new Plugin({
            module: item
        });
    }

    /**
     * If we reach here, the plugin option was used incorrectly
     */
    return new Plugin().mergeDeep({
        errors: [new Error("Plugin was not configured correctly")]
    });
}
854702
def plugin(cls, name):
        
        cls.loadPlugins()
        plugs = getattr(cls, '_%s__plugins' % cls.__name__, {})
        return plugs.get(nstr(name))
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;
		}
	}
850928
def _prepend_name_prefix(self, name):
        """"""
        if not self.name_prefix:
            return name
        base = self.name_prefix
        if base[0] != '/':
            base = '/' + base
        if name[0] != '/':
            name = '/' + name
        return base + name
478472
def create(name, options = {})
            last_slash = name.rindex("/")
            category = name[0 ... last_slash]
            plugin = name[last_slash .. -1]

            map = @plugins[category]
            if not map
                raise "Plugin category #{category} does not exist"
            elsif not map.has_key? plugin
                raise "Plugin #{plugin} does not exist in category #{category}"
            else
                map[plugin].new(options)
            end
        end
878309
function getPluginsConfig(pluginNames) {
  var pluginConfig = {};

  pluginNames.forEach(function(pluginName) {
    var pluginNamespace = util.getNamespace(pluginName),
      pluginNameWithoutNamespace = util.removeNameSpace(pluginName),
      pluginNameWithoutPrefix = util.removePluginPrefix(pluginNameWithoutNamespace),
      plugin = {},
      rules = {};

    if (!loadedPlugins[pluginNameWithoutPrefix]) {
      try {
        plugin = require(pluginNamespace + util.PLUGIN_NAME_PREFIX + pluginNameWithoutPrefix);
        loadedPlugins[pluginNameWithoutPrefix] = plugin;
      } catch (err) {
        plugin = { rulesConfig: {}};
      }
    } else {
      plugin = loadedPlugins[pluginNameWithoutPrefix];
    }

    if (!plugin.rulesConfig) {
      plugin.rulesConfig = {};
    }

    Object.keys(plugin.rulesConfig).forEach(function(item) {
      rules[pluginNameWithoutPrefix + '/' + item] = plugin.rulesConfig[item];
    });

    pluginConfig = util.mergeConfigs(pluginConfig, rules);
  });

  return {rules: pluginConfig};
}
801624
def get_name(self, plugin):
        
        for name, val in self._name2plugin.items():
            if plugin == val:
                return name
1264157
def get_plugin(name)
      raise "Unknown plugin: #{ name }" unless Capistrano::EXTENSIONS.keys.include?(name)
      self.send(name)
    end
29531
def find_plugin(self, name):
        """"""
        suffix = ".py"
        if not self.class_name:
            suffix = ""
        for i in self._get_paths():
            path = os.path.join(i, "%s%s" % (name, suffix))
            if os.path.exists(path):
                return path
        return None
476598
function pluginOnload( value ) {
            resource.state = MODULE_COMPLETED;
            resource.exports = value || true;
            modFireDefined( pluginAndResource );
        }
956064
function validatePluginName(plugin, pluginList) {
    if (!plugin.name)
        throw new Error(ApiHost.ERR_PLUGIN_MISSING_NAME_PROPERTY);

    pluginList.forEach(function (collectorPlugin) {
        if (plugin.name === collectorPlugin.name) {
            var msg = util.format(ApiHost.ERR_DUPLICATE_PLUGIN_NAME, plugin.name, plugin.extends);
            throw new Error(msg);
        }
    });
}
1045779
function(arr, prefix, start) {
      for(var i = 0, len = arr.length; i < len; i++) {
        var def = typeof arr[i] !== 'object' ?
          { id: prefix + arr[i] } :
          { id: prefix + arr[i].id, available: arr[i].available, isNotReservable: arr[i].isNotReservable };

        if(!rMap[def.id]) {
          addResourceToMap(rMap, def, start);
        }
      }
    }
630030
function pluginType(plugin) {
    var name = plugin.getName();
    return (name && name.indexOf(THEME_PREFIX) === 0) ? TYPE_THEME : TYPE_PLUGIN;
}
889383
function buildResourceMap(resourceDefinitions, start) {
    var map = {};
    if(resourceDefinitions) {
      for(var i = 0, len = resourceDefinitions.length; i < len; i++) {
        addResourceToMap(map, resourceDefinitions[i], start);
      }
    }

    return map;
  }
230621
function getNames (resourceType) {
  const aliases = [resourceType];
  if (resourceAliases[resourceType]) {
    return aliases.concat(resourceAliases[resourceType]);
  }
  return alias(resourceType);
}
777411
function getPluginConfig(config, pluginName) {
    var pluginsConfig = config.getValues().get('pluginsConfig');
    if (pluginsConfig === undefined) {
        return {};
    }
    var pluginConf = pluginsConfig.get(pluginName);
    if (pluginConf === undefined) {
        return {};
    } else {
        return pluginConf.toJS();
    }
}