Returns a generator of parents up to :reference:, including reference
        If :reference: is *None* root is assumed
        Closest ancestor goes first
509710
def get_trace(self, reference=None):
        
        item = self
        while item:
            yield item
            if item == reference:
                return
            item = item.parent

        if reference is not None:
            raise Exception(
                'Reference {} is not in Ancestry'.format(reference))
610314
def _ancestors(
            self, qname: Union[QualName, bool] = None) -> List[InstanceNode]:
        """"""
        return self.up()._ancestors(qname)
109147
def parent(self):
        
        if not self._meta.parent:
            return None

        if not self.__parent__:
            self.__parent__ = self._meta.parent()

        return self.__parent__
639038
function getAllAncestors(el, ancestors = []) {
    const nextAncestor = el.parentNode;

    if (!nextAncestor) {
        return ancestors;
    }

    ancestors.push(nextAncestor);

    return getAllAncestors(nextAncestor, ancestors);
}
940039
def ancestors
      node  = self
      nodes = []
      nodes << node = node.parent while node.parent
      nodes
    end
1073537
function getAncestors(node) {
  var path = [];
  var current = node;
  while (current.parent) {
    path.unshift(current);
    current = current.parent;
  }
  return path;
}
688672
def get_parent(self, update=False):
        """"""
        if self._meta.proxy_for_model:
            # the current node is a proxy model; the returned parent
            # should be the same proxy model, so we need to explicitly
            # fetch it as an instance of that model rather than simply
            # following the 'parent' relation
            if self.parent_id is None:
                return None
            else:
                return self.__class__.objects.get(pk=self.parent_id)
        else:
            return self.parent
883194
def get_klass_parents(gi_name):
    '''
    
    '''
    res = []
    parents = __HIERARCHY_GRAPH.predecessors(gi_name)
    if not parents:
        return []
    __get_parent_link_recurse(parents[0], res)
    return res
968710
def traverse_ancestors(self, include_self=True):
        '''
        '''
        if not isinstance(include_self, bool):
            raise TypeError("include_self must be a bool")
        if include_self:
            c = self
        else:
            c = self.parent
        while c is not None:
            yield c; c = c.parent
738517
def root(self):
        
        ret = self
        while hasattr(ret, 'parent') and ret.parent:
            ret = ret.parent
        return ret if isinstance(ret, SchemaABC) else None
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
72802
def parent(self):
    '''

    '''
    if '/' in self._string:
      return Key(self.list[:-1])
    raise ValueError('%s is base key (it has no parent)' % repr(self))
931979
@Override
    public List<? extends Tree> getAncestors() {
        if ( getParent()==null ) return null;
        List<Tree> ancestors = new ArrayList<Tree>();
        Tree t = this;
        t = t.getParent();
        while ( t!=null ) {
            ancestors.add(0, t); // insert at start
            t = t.getParent();
        }
        return ancestors;
    }
120791
def iter_ancestors(self):
        
        node = self
        while node.up is not None:
            yield node.up
            node = node.up
982917
def parents( self, node ):
        """"""
        if 'index' in node:
            index = node['index']()
            parents = list(meliaeloader.children( node, index, 'parents' ))
            return parents 
        return []
988892
def parent(self):
        
        parent = list(self.graph.objects(self.asNode(), RDF_NAMESPACES.DTS.parent))
        if parent:
            return self.parent_class(parent[0])
        return None
1116239
def get_ancestors(self, limit: int, header: BlockHeader) -> Tuple[BaseBlock, ...]:
        
        ancestor_count = min(header.block_number, limit)

        # We construct a temporary block object
        vm_class = self.get_vm_class_for_block_number(header.block_number)
        block_class = vm_class.get_block_class()
        block = block_class(header=header, uncles=[])

        ancestor_generator = iterate(compose(
            self.get_block_by_hash,
            operator.attrgetter('parent_hash'),
            operator.attrgetter('header'),
        ), block)
        # we peel off the first element from the iterator which will be the
        # temporary block object we constructed.
        next(ancestor_generator)

        return tuple(take(ancestor_count, ancestor_generator))