Configure name map: My goal here is to associate a named object
        with a specific function
548708
def bind_keys(self, objects):
        """"""
        for object in objects:
            if object.keys != None:
                for key in object.keys:
                    if key != None:
                        self.bind_key_name(key, object.name)
569950
def _create_mapping(self, func, switch):
        """"""
        mapping = {}
        for feature in self.data['features']:
            content = func(feature)
            if switch == 'style':
                for key, value in content.items():
                    if isinstance(value, MacroElement):
                        # Make sure objects are rendered:
                        if value._parent is None:
                            value._parent = self.geojson_obj
                            value.render()
                        # Replace objects with their Javascript var names:
                        content[key] = "{{'" + value.get_name() + "'}}"
            key = self._to_key(content)
            mapping.setdefault(key, []).append(self.get_feature_id(feature))
        self._set_default_key(mapping)
        return mapping
515215
private void buildNameMap() {
        nameMap = new HashMap<String, GrailsPlugin>();
        for (GrailsPlugin plugin : originalPlugins) {
            nameMap.put(plugin.getName(), plugin);
        }
    }
819735
public static <T> Map<String, T> getByName(List<T> namedObjects, Function<T, String> nameFn) {
        return getByName(namedObjects, nameFn, mergeFirst());
    }
1258523
def attach(object, name):
    
    def decorator(func):
        setattr(object, name, func)
        return func
    return decorator
779935
def set_object(self, name: str, pobj: ParameterObject) -> None:
        """"""
        self.objects[zlib.crc32(name.encode())] = pobj
443874
def NAME(self, node):
        """"""
        # Locate the name in locals / function / globals scopes.
        if isinstance(node.ctx, (ast.Load, ast.AugLoad)):
            self.handle_node_load(node)
            if (node.id == 'locals' and isinstance(self.scope, FunctionScope)
                    and isinstance(node.parent, ast.Call)):
                # we are doing locals() call in current scope
                self.scope.uses_locals = True
        elif isinstance(node.ctx, (ast.Store, ast.AugStore)):
            self.handle_node_store(node)
        elif isinstance(node.ctx, ast.Del):
            self.handle_node_delete(node)
        else:
            # must be a Param context -- this only happens for names in function
            # arguments, but these aren't dispatched through here
            raise RuntimeError("Got impossible expression context: %r" % (node.ctx,))
43719
def onTagDel(self, name, func):
        '''
        

        '''
        if '*' in name:
            self.ontagdelglobs.add(name, func)
        else:
            self.ontagdels[name].append(func)
203743
public static void bind(final Context _ctx,
                            final String _nameStr,
                            final Object _object)
        throws NamingException
    {
        final Name names = _ctx.getNameParser("").parse(_nameStr);
        if (names.size() > 0)  {
            Context subCtx = _ctx;
            for (int idx = 0; idx < names.size() - 1; idx++)  {
                final String name = names.get(idx);
                try {
                    subCtx = (Context) subCtx.lookup(name);
                    if (Util.LOG.isDebugEnabled())  {
                        Util.LOG.debug("Subcontext " + name + " already exists");
                    }
                } catch (final NameNotFoundException e) {
                    subCtx = subCtx.createSubcontext(name);
                    if (Util.LOG.isDebugEnabled())  {
                        Util.LOG.debug("Subcontext " + name + " created");
                    }
                }
            }
            subCtx.rebind(names.get(names.size() - 1), _object);
            if (Util.LOG.isDebugEnabled())  {
                Util.LOG.debug("Bound object to " + names.get(names.size() - 1));
            }
        }
    }
1146834
function serializeKey( name ) {
   const identifier = /^[A-Za-z$_][A-Za-z0-9$_]*$/.test( name );
   const keyword = [
      'if', 'else',
      'switch', 'case', 'default',
      'try', 'catch', 'finally',
      'function', 'return',
      'var', 'let', 'const'
   ].indexOf( name ) >= 0;

   return ( identifier && !keyword ) ? name : `"${name}"`;
}
1336691
def named_objs(objlist, namesdict=None):
    
    objs = OrderedDict()

    if namesdict is not None:
        objtoname = {hashable(v): k for k, v in namesdict.items()}

    for obj in objlist:
        if namesdict is not None and hashable(obj) in objtoname:
            k = objtoname[hashable(obj)]
        elif hasattr(obj, "name"):
            k = obj.name
        elif hasattr(obj, '__name__'):
            k = obj.__name__
        else:
            k = as_unicode(obj)
        objs[k] = obj
    return objs
575217
function(obj, map, name) {

        var entry = map.get(Object(obj));

        if (!entry)
            throw new TypeError;

        return entry[name];
    }
256365
def name_targets(func):
    
    def wrap(*a, **kw):
        ret = func(*a, **kw)
        return dict(zip(ret[:-1], ret[-1]))
    return wrap
661081
function bindAll(self: Object, fnNames: Array<string>) {
  fnNames.forEach(name => {
    /* eslint-disable no-param-reassign */
    self[name] = self[name].bind(self);
    /* eslint-enable no-param-reassign */
  });
}
436088
function mapObjectInPlace(o, fn, ctxt) {
  for (let key in o) {
    if (o.hasOwnProperty(key)) {
      o[key] = fn.call(ctxt, o[key], key, o);
    }
  }
  return o;
}
702065
function(sName, mAnnotations, mTarget) {
		// Everything in here must be on Term level, so we overwrite the target with the data from the source

		if (Array.isArray(mAnnotations[sName])) {
			// This is a collection - make sure it stays one
			mTarget[sName] = mAnnotations[sName].slice(0);
		} else {
			// Make sure the map exists in the target
			mTarget[sName] = mTarget[sName] || {};

			for (var sKey in mAnnotations[sName]) {
				mTarget[sName][sKey] = mAnnotations[sName][sKey];
			}
		}
	}
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)