:returns: the parent node of the current node object.
            Caches the result in the object itself to help in loops.
175068
def get_parent(self, update=False):
        
        depth = int(len(self.path) / self.steplen)
        if depth <= 1:
            return
        try:
            if update:
                del self._cached_parent_obj
            else:
                return self._cached_parent_obj
        except AttributeError:
            pass
        parentpath = self._get_basepath(self.path, depth - 1)
        self._cached_parent_obj = get_result_class(
            self.__class__).objects.get(path=parentpath)
        return self._cached_parent_obj
624161
public Node root() {
        Node node = this;
        while (node.parentNode != null)
            node = node.parentNode;
        return node;
    }
1325839
def parent(self, parent):
        
        self._parent = parent
        self.graph.add(
            (self.asNode(), RDF_NAMESPACES.CAPITAINS.parent, parent.asNode())
        )
        parent._add_member(self)
124184
def get_node_parent_class(node):
    """"""

    while node.parent:  # pragma no branch
        if isinstance(node, ClassDef):
            return node

        node = node.parent
1197993
def root(self):
        

        if not self.parent:
            return self

        con = self.parent

        while con.parent:
            con = con.parent

        return con
376137
def remove(self):
        
        if self.parent:
            for i, node in enumerate(self.parent.children):
                if node is self:
                    self.parent.changed()
                    del self.parent.children[i]
                    self.parent = None
                    return i
1240868
def parent(self) -> Optional['CtsReference']:
        
        if self.start.depth == 1 and (self.end is None or self.end.depth <= 1):
            return None
        else:
            if self.start.depth > 1 and (self.end is None or self.end.depth == 0):
                return CtsReference("{0}{1}".format(
                    ".".join(self.start.list[:-1]),
                    self.start.subreference or ""
                ))
            elif self.start.depth > 1 and self.end is not None and self.end.depth > 1:
                _start = self.start.list[0:-1]
                _end = self.end.list[0:-1]
                if _start == _end and \
                        self.start.subreference is None and \
                        self.end.subreference is None:
                    return CtsReference(
                        ".".join(_start)
                    )
                else:
                    return CtsReference("{0}{1}-{2}{3}".format(
                        ".".join(_start),
                        self.start.subreference or "",
                        ".".join(_end),
                        self.end.subreference or ""
                    ))
739196
def get_parent_page(self):
        
        if self.current_level == 1:
            # 'root' page
            return None
        else:
            return self.page_data[(self.current_level - 1, self.current_count)]
263828
def parent(self):
        
        if len(self._path) == 1:
            return None
        else:
            parent_path = self._path[:-1]
        return self._client.document(*parent_path)
912933
def get_parent_folder(self):
        
        if self.root:
            return None
        if self.parent:
            return self.parent

        if self.parent_id:
            self.parent = self.get_folder(folder_id=self.parent_id)
        return self.parent
346489
def get_parent(self):
        
        if not self._parent:
            self._parent = yield self.parent_resource.get(self.parent_id)

        raise Return(self._parent)
1180369
def _get_next_child_node(self, parent):
        
        children_keys = list(parent.children)
        sorted_keys = sorted(children_keys)
        for key in sorted_keys:
            node = parent.children[key]
            if node.job_record is None:
                self.timetable.assign_job_record(node)
                return node
            elif self.should_skip_tree_node(node):
                continue
            elif node.job_record.is_active:
                return node

        # special case, when all children of the parent node are not suitable for processing
        new_parent = self._get_next_parent_node(parent)
        if new_parent is not None:
            # in case all nodes are processed or blocked - look for next valid parent node
            return self._get_next_child_node(new_parent)
        else:
            # if all valid parents are exploited - return current node
            process_name = parent.children[sorted_keys[0]].process_name
            time_qualifier = parent.children[sorted_keys[0]].time_qualifier
            actual_timeperiod = time_helper.actual_timeperiod(time_qualifier)
            return self.get_node(process_name, actual_timeperiod)
1037820
def nodes(self):
        
        if not hasattr(self, '_nodes'):
            base_url = "{}/{}".format(NodeBalancerConfig.api_endpoint, NodeBalancerNode.derived_url_path)
            result = self._client._get_objects(base_url, NodeBalancerNode, model=self, parent_id=(self.id, self.nodebalancer_id))

            self._set('_nodes', result)

        return self._nodes
831489
function() {
            var parent = this.getParent();

            if(parent && parent.children) {
                parent.children.splice(this.index, 1);
                parent._setChildrenIndices();
                delete this.parent;
            }

            // every cached attr that is calculated via node tree
            // traversal must be cleared when removing a node
            this._clearSelfAndDescendantCache(STAGE);
            this._clearSelfAndDescendantCache(ABSOLUTE_TRANSFORM);
            this._clearSelfAndDescendantCache(VISIBLE);
            this._clearSelfAndDescendantCache(LISTENING);
            this._clearSelfAndDescendantCache(ABSOLUTE_OPACITY);

            return this;
        }
235280
def get_parent_bank_nodes(self):
        
        parent_bank_nodes = []
        for node in self._my_map['parentNodes']:
            parent_bank_nodes.append(BankNode(
                node._my_map,
                runtime=self._runtime,
                proxy=self._proxy,
                lookup_session=self._lookup_session))
        return BankNodeList(parent_bank_nodes)
1240056
public Node parentNode() {

		if (currentNode == null)
			return null;

		Node node = getParentNode(currentNode);

		if (node != null)
			currentNode = node;

		return node;

	}
919654
def get_parent_element(self):
        """"""
        return {AUDIT_REF_STATE: self.context.audit_record,
                SIGNATURE_REF_STATE: self.context.signature}[self.ref_state]