and the node's parent never changes. Still, it doesn't hurt.
489651
public synchronized float get() {
    Progress node = this;
    while (node.parent != null) {                 // find the root
      node = parent;
    }
    return node.getInternal();
  }
312773
private static NodeAVL set(PersistentStore store, NodeAVL x,
                               boolean isleft, NodeAVL n) {

        if (isleft) {
            x = x.setLeft(store, n);
        } else {
            x = x.setRight(store, n);
        }

        if (n != null) {
            n.setParent(store, x);
        }

        return x;
    }
1361943
function(node, root) {
    var pn = node.parentNode;
    while (pn) {
      if (pn == root) {
        break;
      }
      pn = pn.parentNode;
    }
    return !!pn;
  }
1240056
public Node parentNode() {

		if (currentNode == null)
			return null;

		Node node = getParentNode(currentNode);

		if (node != null)
			currentNode = node;

		return node;

	}
68332
def update(self):
        
        diff = self._diff()
        if not diff:
            # Nothing to do!
            return
        self.parent.update_node(self, diff)
154811
private void allowLoneBlock(Node parent) {
    if (loneBlocks.isEmpty()) {
      return;
    }

    if (loneBlocks.peek() == parent) {
      loneBlocks.pop();
    }
  }
1347595
function(zIndex) {
            if (!this.parent) {
                Kinetic.Util.warn('Node has no parent. zIndex parameter is ignored.');
                return;
            }
            var index = this.index;
            this.parent.children.splice(index, 1);
            this.parent.children.splice(zIndex, 0, this);
            this.parent._setChildrenIndices();
            return this;
        }
1118478
def mark_parents_expanded node
      # i am setting parents as expanded, but NOT firing handlers - XXX separate this into expand_parents
      _path = node.tree_path
      _path.each do |e| 
        # if already expanded parent then break we should break
        set_expanded_state(e, true) 
      end
    end
691109
function (element) {
    var currentNode = element.parentNode
    while (currentNode) {
      if (currentNode.tagName === 'HTML') {
        return true
      }
      if (currentNode.nodeType === 11) {
        return false
      }
      currentNode = currentNode.parentNode
    }
    return false
  }
482435
function() {
            if (!this.parent) {
                Kinetic.Util.warn('Node has no parent. moveUp function is ignored.');
                return;
            }
            var index = this.index,
                len = this.parent.getChildren().length;
            if(index < len - 1) {
                this.parent.children.splice(index, 1);
                this.parent.children.splice(index + 1, 0, this);
                this.parent._setChildrenIndices();
                return true;
            }
            return false;
        }
702618
function( ancestor, descendant, within )
    {
        var node = within ? descendant.parentNode : descendant;
        while( node )
        {
            if( node === ancestor )
                return true;
            node = node.parentNode;
        }
        return false;
    }
398403
private void checkNodeRecursive(Node node)
	{
		if (isDangling(node))
		{
			removeNode(node);

			for (Edge edge : node.getUpstream())
			{
				checkNodeRecursive(edge.getSourceNode());
			}
			for (Edge edge : node.getDownstream())
			{
				checkNodeRecursive(edge.getTargetNode());
			}
			for (Node parent : node.getUpperEquivalent())
			{
				checkNodeRecursive(parent);
			}
			for (Node child : node.getLowerEquivalent())
			{
				checkNodeRecursive(child);
			}
		}
	}
164799
function () {
		var element = this.element,
			childNodes = element.childNodes,
			i = childNodes.length,
			node;

		while (i--) {
			node = childNodes[i];
			node.parentNode.removeChild(node);
		}
	}
159864
def node_ancestor(node, levels)
      while levels > 0
        node = node.node_parent
        return unless node
        levels -= 1
      end

      node
    end
374293
function isNodeIgnored(node) {
    const parent = node.parent;

    if (!parent) {
        // Root was reached.
        return false;
    }

    if (parent.some((child) => (child.type === 'comment' && PATTERN_IGNORE.test(child.text)))) {
        // Instruction to ignore the node was detected.
        return true;
    }

    // Check the instruction on one level above.
    return isNodeIgnored(parent);
}
658926
function safeInsert(root, curr, next) {
      root.insertBefore(curr, next.parentNode && next);
    }
789005
def ensureVisible(self):
        
        parent = self.parent()
        while parent:
            parent.setExpanded(True)
            parent = parent.parent()