cache parent name if required (like ancestor). currently used only for UI.
438498
public CaseInsensitiveString getDirectParentName() {
        String stringPath = path();
        if (stringPath == null) {
            return null;
        }
        int index = stringPath.lastIndexOf(DELIMITER);
        return index == -1 ? path : new CaseInsensitiveString(stringPath.substring(index + 1, stringPath.length()));
    }
1213322
def is_ancestor(self, child_key_name, ancestor_key_name):
        """"""

        # all keys are descendents of None
        if ancestor_key_name is None:
            return True

        one_up_parent = self.dct[child_key_name]['parent']
        if child_key_name == ancestor_key_name:
            # debatable semantics, but a person lies in his/her own
            # ancestry tree
            return True
        elif one_up_parent is None:
            return False
        else:
            return self.is_ancestor(one_up_parent, ancestor_key_name)
712409
def _lookup_node_parent(self, node):
        
        # Basic caching of our internal ancestry dict to help performance
        if not node in self.CACHED_ANCESTRY_DICT:
            # Given node isn't in cached ancestry dictionary, rebuild this now
            ancestry_dict = dict(
                (c, p) for p in self._impl_document.getiterator() for c in p)
            self.CACHED_ANCESTRY_DICT = ancestry_dict
        return self.CACHED_ANCESTRY_DICT[node]
976819
function(name, parent) {
      
      this.name = name;
      this.parent = parent;
      
      // if the parent has a custom context the child should inherit it
      if (parent._context && (parent._context._id !== parent._id)) {
        
        this._context = parent._context;
        if (this.scenes) {
          _.each(this.scenes , function(scene) {
            scene.attach(scene.name, this);
          }, this);
        }
      }
      return this;
    }
1345197
def get_cached_placeholder_output(parent_object, placeholder_name):
    
    if not PlaceholderRenderingPipe.may_cache_placeholders():
        return None

    language_code = get_parent_language_code(parent_object)
    cache_key = get_placeholder_cache_key_for_parent(parent_object, placeholder_name, language_code)
    return cache.get(cache_key)
764820
def _build_cache():
    """"""
    query = current_app.config['COLLECTIONS_DELETED_RECORDS']
    for collection in Collection.query.filter(
            Collection.dbquery.isnot(None)).all():
        yield collection.name, dict(
            query=query.format(dbquery=collection.dbquery),
            ancestors=set(_ancestors(collection)),
        )
    raise StopIteration
858606
protected void inheritAttributes()
        throws CacheReloadException
    {
        Type parent = getParentType();
        final List<Attribute> attributesTmp = new ArrayList<>();
        while (parent != null) {
            for (final Attribute attribute : getParentType().getAttributes().values()) {
                attributesTmp.add(attribute.copy(getId()));
            }
            parent = parent.getParentType();
        }
        addAttributes(true, attributesTmp.toArray(new Attribute[attributesTmp.size()]));
    }
355030
public void clearCacheIncludingAncestors() {
		clearCache();
		if (getParentMessageSource() instanceof ReloadableResourceBundleMessageSource) {
			((ReloadableResourceBundleMessageSource) getParentMessageSource()).clearCacheIncludingAncestors();
		} else if (getParentMessageSource() instanceof org.springframework.context.support.ReloadableResourceBundleMessageSource) {
            ((org.springframework.context.support.ReloadableResourceBundleMessageSource) getParentMessageSource()).clearCacheIncludingAncestors();
		}
	}
701888
def get_parent(self, update=False):
        
        if self.is_root():
            return
        try:
            if update:
                del self._cached_parent_obj
            else:
                return self._cached_parent_obj
        except AttributeError:
            pass
        # parent = our most direct ancestor
        self._cached_parent_obj = self.get_ancestors().reverse()[0]
        return self._cached_parent_obj
593762
private void ensureAccessible(Key<?> key, GinjectorBindings parent, GinjectorBindings child) {
    // Parent will be null if it is was an optional dependency and it couldn't be created.
    if (parent != null && !child.equals(parent) && !child.isBound(key)) {
      PrettyPrinter.log(logger, TreeLogger.DEBUG,
          "In %s: inheriting binding for %s from the parent %s", child, key, parent);
      Context context = Context.format("Inheriting %s from parent", key);

      // We don't strictly need all the extra checks in addBinding, but it can't hurt.  We know, for
      // example, that there will not be any unresolved bindings for this key.
      child.addBinding(key, bindingFactory.getParentBinding(key, parent, context));
    }
  }
91810
def update_name(self, name):
        """"""
        if name != self.name:
            self.parent.types[name] = self
            del self.parent.types[self.name]
            self.name = name
1034403
def get_parent(self):
        """"""
        if not self.has_cached_parent:
            if self.parent is not None:
                self._parent_block = self.runtime.get_block(self.parent)
            else:
                self._parent_block = None
            self._parent_block_id = self.parent
        return self._parent_block
631278
def _ancestors(collection):
    """"""
    for index, c in enumerate(collection.path_to_root()):
        if index > 0 and c.dbquery is not None:
            raise StopIteration
        yield c.name
    raise StopIteration
1081506
def parent_id?(item)
      parent.id && item.send(foreign_key).eql?(parent.id)
    end
776206
function Context(view, parentContext) {
        this.view = view;
        this.cache = {
            '.': this.view,
            '@each': function each() {
                var returns = [];
                for (var k in this) {
                    returns.push({ '@key': k, '@value': this[k] });
                }
                return returns;
            }
        };
        this.parent = parentContext;
    }
865032
def getparent(self, profile):
        """"""
        assert self.parent
        for inputtemplate in profile.input:
            if inputtemplate == self.parent:
                return inputtemplate
        raise Exception("Parent InputTemplate '"+self.parent+"' not found!")
489363
def get_parent_id(element):
        """"""
        if 'parent' in element.attrib:
            return element.attrib['parent']
        else:
            return element.getparent().attrib[add_ns('id')]