Builds a name to plugin map from the original list of plugins supplied
515215
private void buildNameMap() {
        nameMap = new HashMap<String, GrailsPlugin>();
        for (GrailsPlugin plugin : originalPlugins) {
            nameMap.put(plugin.getName(), plugin);
        }
    }
880983
def load_plugins(self, plugins):
        

        def instantiate(plugin):
            return plugin() if inspect.isclass(plugin) else plugin

        loaded_plugins = []
        plugins_seen = []

        # Iterate over plugins in reverse to permit users to override default
        # plugin config
        for plugin in reversed(plugins):
            if not is_plugin(plugin) or plugin.name in plugins_seen:
                continue
            # Build the plugins list in reverse to restore original order
            loaded_plugins.insert(0, instantiate(plugin))
            plugins_seen.append(plugin.name)

        return loaded_plugins
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);
        }
    });
}
1120455
def list_plugins(self):
        

        vals = self.plugins.items()

        return {x: y for x, y in vals}
352000
def get_frontend_aware_plug_names(self):
    """"""
    return [name for name, plug in six.iteritems(self._plugs_by_name)
            if isinstance(plug, FrontendAwareBasePlug)]
1132066
def build_projection_kwargs(cls, source, mapping):
        """"""
        return cls._map_arg_names(source, cls._default_attr_mapping + mapping)
801624
def get_name(self, plugin):
        
        for name, val in self._name2plugin.items():
            if plugin == val:
                return name
1230805
function _mapExtnames(filename, opts) {
    Object.keys(opts.extMap).forEach(function (ext) {
        var extPattern = new RegExp( escPathPattern(ext) + '$' );
        if (extPattern.test(filename)) {
            filename = filename.replace(extPattern, opts.extMap[ext]);
        }
    });
    return filename;
}
795318
function buildMap( map, part ){

    var name =          makeName( part.fileName );

    if ( map[name] ){
        map[name].parts.push( part );
    } else {
        map[name] = {
            name:       name,
            parts:      [ part ],
        };
    }

    return map;
}
1296409
def mapped(cls, key='id', **kwargs):
    """"""
    kwargs.setdefault('metadata', {})
    kwargs['metadata']['jsonldPredicate'] = {'mapSubject': key}
    kwargs.setdefault('default', attr.Factory(list))

    def converter(value):
        """Convert mapping to a list of instances."""
        if isinstance(value, dict):
            result = []
            for k, v in iteritems(value):
                if not hasattr(cls, 'from_cwl'):
                    vv = dict(v)
                    vv[key] = k
                else:
                    vv = attr.evolve(cls.from_cwl(v), **{key: k})
                result.append(vv)
        else:
            result = value

        def fix_keys(data):
            """Fix names of keys."""
            for a in fields(cls):
                a_name = a.name.rstrip('_')
                if a_name in data:
                    yield a.name, data[a_name]

        return [
            cls(**{kk: vv
                   for kk, vv in fix_keys(v)}) if not isinstance(v, cls) else v
            for v in result
        ]

    kwargs['converter'] = converter
    return attr.ib(**kwargs)
1089140
private void buildDerivedPluginList() {

        // find their dependencies
        for (int i = 0; i < explicitlyNamedPlugins.size(); i++) {
            GrailsPlugin plugin = explicitlyNamedPlugins.get(i);

            // recursively add in plugin dependencies
            addPluginDependencies(derivedPlugins, plugin);
        }
    }
641665
private Map<PluginClassLoaderDef, ClassLoader> build(Collection<PluginClassLoaderDef> defs, ClassloaderBuilder builder) {
    Map<PluginClassLoaderDef, ClassLoader> result = new HashMap<>();
    Map<String, ClassLoader> classloadersByBasePluginKey = builder.build();
    for (PluginClassLoaderDef def : defs) {
      ClassLoader classloader = classloadersByBasePluginKey.get(def.getBasePluginKey());
      if (classloader == null) {
        throw new IllegalStateException(String.format("Fail to create classloader for plugin [%s]", def.getBasePluginKey()));
      }
      result.put(def, classloader);
    }
    return result;
  }
106105
function(name){
        for (var i = 0, len = _pluginList.length ; i < len ; i++){
            var plugin = _pluginList[i];
            if (name === plugin.name) {
                return true;
            }
        }
        return false;
    }
228640
def mapper(module, entry_point,
           modpath='pkg_resources', globber='root', modname='es6',
           fext=JS_EXT, registry=_utils):
    

    modname_f = modname if callable(modname) else _utils['modname'][modname]

    return {
        modname_f(modname_fragments): join(base, subpath)
        for modname_fragments, base, subpath in modgen(
            module, entry_point=entry_point,
            modpath=modpath, globber=globber,
            fext=fext, registry=_utils)
    }
7148
public Map<String, PluginInfo> getPluginsMap() {
        Map<String, PluginInfo> pluginsMap = new HashMap<>();
        for (UpdateRepository repository : getRepositories()) {
            pluginsMap.putAll(repository.getPlugins());
        }

        return pluginsMap;
    }
1088404
function convertPropertyNames (context, pkg, map , root, waiting) {
	if(!map) {
		return map;
	}
	var clone = {}, value;
	for(var property in map ) {
		value = convertName(context, pkg, map, root, property, waiting);
		if(typeof value === 'string') {
			clone[value] = map[property];
		}

		// do root paths b/c we don't know if they are going to be included with the package name or not.
		if(root) {
			value = convertName(context, pkg, map, false, property, waiting);
			if(typeof value === 'string') {
				clone[value] = map[property];
			}
		}
	}
	return clone;
}
1304588
private Map<String,Namespace> buildByPrefixMap()
    {
        int len = mNamespaces.size();
        if (len == 0) {
            return Collections.emptyMap();
        }

        LinkedHashMap<String,Namespace> m = new LinkedHashMap<String,Namespace>(1 + len + (len>>1));
        for (int i = 0; i < len; ++i) {
            Namespace ns = mNamespaces.get(i);
            String prefix = ns.getPrefix();
            if (prefix == null) { // shouldn't happen but...
                prefix = "";
            }
            m.put(prefix, ns);
        }
        return m;
    }