Returns the node containing the lowest value strictly higher than the given one.
334483
public Node<T> searchNearestHigher(long value, boolean acceptEquals) {
    	if (root == null) return null;
    	return searchNearestHigher(root, value, acceptEquals);
    }
313317
def closest_value(root, target):
    
    a = root.val
    kid = root.left if target < a else root.right
    if not kid:
        return a
    b = closest_value(kid, target)
    return min((a,b), key=lambda x: abs(target-x))
193084
private Node<T> removeMax(Node<T> h, boolean updateLast) { 
        if (h.left != null && h.left.red)
            h = rotateRight(h);

        if (h.right == null)
            return null;

        if (!h.right.red && (h.right.left == null || !h.right.left.red))
            h = moveRedRight(h);

        h.right = removeMax(h.right, updateLast);
        if (h.right == null && updateLast)
        	last = h;
        return balance(h);
    }
687726
public boolean lessThanOrEqual(XObject obj2)
          throws javax.xml.transform.TransformerException
  {

    // In order to handle the 'all' semantics of 
    // nodeset comparisons, we always call the 
    // nodeset function.  Because the arguments 
    // are backwards, we call the opposite comparison
    // function.
    if (obj2.getType() == XObject.CLASS_NODESET)
      return obj2.greaterThanOrEqual(this);

    return this.num() <= obj2.num();
  }
202854
public Node<T> getMax() {
		if (size == 0) return null;
		Node<RedBlackTreeLong<T>> e = ranges.getMax();
		return e.getElement().getMax();
	}
634187
private static int compareNodes(String node1, String node2) {
        assert node1 != null;
        assert node2 != null;
        
        if (node1.equals(node2)) {
            return 0;
        }
        if (node1.length() > 0 && node1.charAt(0) == '{') {
            if (node2.length() > 0 && node2.charAt(0) == '{') {
                return 0;  // Both nodes are parameters; names are irrelevant
            }
            return 1;  // r1 is a parameter but r2 is not, so r2 should come first
        }
        if (node2.length() > 0 && node2.charAt(0) == '{') {
            return -1;   // r2 is a parameter but r1 is not, so r1 should come first
        }
        return node1.compareTo(node2);  // neither node is a parameter
    }
994233
public TreeGraphNode highestNodeWithSameHead() {
    TreeGraphNode node = this;
    while (true) {
      TreeGraphNode parent = safeCast(node.parent());
      if (parent == null || parent.headWordNode() != node.headWordNode()) {
        return node;
      }
      node = parent;
    }
  }
138087
function containsNodeOrEqual(outerNode, innerNode) {
    return outerNode.range[0] <= innerNode.range[0] && outerNode.range[1] >= innerNode.range[1]
}
390906
public static <T> Optional<T> lowestCommonAncestor(TreeDef.Parented<T> treeDef, List<T> nodes) {
		if (nodes.size() == 0) {
			return Optional.empty();
		} else {
			Optional<T> soFar = Optional.of(nodes.get(0));
			for (int i = 1; i < nodes.size() && soFar.isPresent(); ++i) {
				soFar = lowestCommonAncestor(treeDef, soFar.get(), nodes.get(i));
			}
			return soFar;
		}
	}
1224822
def LessThan(self, value):
    
    self._awql = self._CreateSingleValueCondition(value, '<')
    return self._query_builder
1130572
def eigenvalue(nodes, node=None):
    
    if node is None:
        return sorted([eigenvalue(nodes, n) for n in nodes])[0]  # return lowest eigenvalue
    else:
        return len([1 for n in nodes if hops(node, n)])
561969
def lower(self):
        
        q = self.copy()
        q.addFunction(Query.Function.Lower)
        return q
661208
function glb(tree, node, key, comp, low) {
    if (node === tree.z) {
        return low;
    }
    else if (comp(key, node.key) >= 0) {
        // The node key is a valid lower bound, but may not be the greatest.
        // Take the right link in search of larger keys.
        return maxNode(node, glb(tree, node.r, key, comp, low), comp);
    }
    else {
        // Take the left link in search of smaller keys.
        return glb(tree, node.l, key, comp, low);
    }
}
969060
private V findSmallest(Node node) {
        if (node == null) {
            return null;
        }

        while (node.left != null) {
            node = node.left;
        }

        return node.item;
    }
832030
def smallest(self):
        

        heap = self._heap
        v, k = heap[0]
        while k not in self or self[k] != v:
            heappop(heap)
            v, k = heap[0]

        return k
1002325
def visit_slice(self, node):
        """"""
        lower = node.lower.accept(self) if node.lower else ""
        upper = node.upper.accept(self) if node.upper else ""
        step = node.step.accept(self) if node.step else ""
        if step:
            return "%s:%s:%s" % (lower, upper, step)
        return "%s:%s" % (lower, upper)
792544
function lower (value) {
  if (value === null || value === undefined) {
    return value
  }
  return String.prototype.toLowerCase.call(value)
}