Find the current maximum element id (recursively).
199134
public static int findMaxElementId(VoltXMLElement root) {
        int retval = 0;
        if (root != null) {
            String strId = root.attributes.get("id");
            if (strId != null) {
                retval = Integer.parseInt(strId);
            }
            for (VoltXMLElement child : root.children) {
                int childMaxId = findMaxElementId(child);
                if (retval < childMaxId) {
                    retval = childMaxId;
                }
            }
        }
        return retval;
    }
406500
private int getMaxStep()
    {
        if (path != null)
        {
            final int steps;
            if (pathStopped)
            {
                steps = currentStep;
            }
            else
            {
                steps = path.getLength();
            }
            return steps;
        }
        return 0;
    }
1166360
def get_max_value_key(dic):
    """"""
    v = np.array(list(dic.values()))
    k = np.array(list(dic.keys()))

    maxima = np.where(v == np.max(v))[0]
    if len(maxima) == 1:
        return k[maxima[0]]
    else:
        # In order to be consistent, always selects the minimum key
        # (guaranteed to be unique) when there are multiple maximum values.
        return k[maxima[np.argmin(k[maxima])]]
492372
def _max(self):
        """"""
        return (
            self.range[1] if (self.range and self.range[1] is not None) else
            (max(map(abs, self._values)) if self._values else None)
        )
885941
def _max(self):
        """"""
        return (
            self.range[1] if (self.range and self.range[1] is not None) else
            (max(self.yvals) if self.yvals else None)
        )
378780
def get_maximum_index(indices):
    """"""
    def _maximum_idx_single(idx):
        if isinstance(idx, slice):
            start = -1
            stop = 0
            if idx.start is not None:
                start = idx.start.__index__()
            if idx.stop is not None:
                stop = idx.stop.__index__()
            return max(start, stop - 1)
        else:
            return idx.__index__()
    if isinstance(indices, tuple):
        return max((_maximum_idx_single(i) for i in indices), default=-1)
    else:
        return _maximum_idx_single(indices)
1065499
def check
      last_max = -1
      unless (min_id = @page_records.first.min_id) == 0
        raise RuntimeError, "min_id of first record (#{min_id}) " +
          "must be 0."
      end

      @page_records.each do |pr|
        unless pr.min_id == last_max + 1
          raise RuntimeError, "max_id of previous record (#{last_max}) " +
            "must be exactly 1 smaller than current record (#{pr.min_id})."
        end
        last_max = pr.max_id
        pr.check
      end

      unless last_max == 2 ** 64
        raise RuntimeError, "max_id of last records " +
          "(#{@page_records.last.max_id}) must be #{2 ** 64})."
      end
    end
836684
function max(x) {
        var value;
        for (var i = 0; i < x.length; i++) {
            // On the first iteration of this loop, max is
            // undefined and is thus made the maximum element in the array
            if (x[i] > value || value === undefined) value = x[i];
        }
        return value;
    }
1143070
def max_n(self):
        """"""
        return max(term.max_n() for term in self.terms if term.ops)
40107
private long findMaxTimestamp() {
        if (!isInit) {
            init();
        }
        long max = 0;
        for (int i = 0; i < allNodes.length; i++) {
            if (allNodes[i] != null && allNodes[i].getLastTimestamp() > max) {
                max = allNodes[i].getLastTimestamp();
            }
        }
        return max;
    }
271787
public int max() {
    int max = Integer.MIN_VALUE;
    for (E key : map.keySet()) {
      max = Math.max(max, getIntCount(key));
    }
    return max;
  }
773862
def depth(self) -> int:
        
        if len(self.children):
            return 1 + max([child.depth for child in self.children])
        else:
            return 1
561797
def max_pathlen(self):
        

        pathlen = self.pathlen
        if self.parent is None:
            return pathlen

        max_parent = self.parent.max_pathlen

        if max_parent is None:
            return pathlen
        elif pathlen is None:
            return max_parent - 1
        else:
            return min(self.pathlen, max_parent - 1)
1171920
public Pair<T> max() {
        int maxCount = 0;
        TLongIntIterator iter = counts.iterator();
        long maxIndex = 0;

        while (!iter.hasNext()) {
            iter.advance();

            int count = iter.value();
            if (count > maxCount) {
                maxIndex = iter.key();
                maxCount = count;
            }
        }
        if (maxCount == 0)
            return null;
        
        int i = (int)(maxIndex >>> 32);
        int j = (int)(maxIndex & 0xfffffff);
        return new Pair<T>(elementIndices.lookup(i), 
                           elementIndices.lookup(j));
    }
1236114
private int findMaxElementIndex()
  {
    switch (heapSize) {
      case 1:
        return 0; // The lone element in the queue is the maximum.
      case 2:
        return 1; // The lone element in the maxHeap is the maximum.
      default:
        // The max element must sit on the first level of the maxHeap. It is
        // actually the *lesser* of the two from the maxHeap's perspective.
        int offset1 = buf.getInt(1 * Integer.BYTES);
        int offset2 = buf.getInt(2 * Integer.BYTES);
        return maxComparator.compare(offset1, offset2) <= 0 ? 1 : 2;
    }
  }
828142
def _next_id(self):
        
        id_str_lst = self.xpath('./p:sldId/@id')
        return max([255]+[int(id_str) for id_str in id_str_lst])+1
1082609
function getMaxElement(side, elements) {
    var elementsLength = elements.length,
      elVal = 0,
      maxVal = 0,
      Side = capitalizeFirstLetter(side),
      timer = getNow()

    for (var i = 0; i < elementsLength; i++) {
      elVal =
        elements[i].getBoundingClientRect()[side] +
        getComputedStyle('margin' + Side, elements[i])
      if (elVal > maxVal) {
        maxVal = elVal
      }
    }

    timer = getNow() - timer

    log('Parsed ' + elementsLength + ' HTML elements')
    log('Element position calculated in ' + timer + 'ms')

    chkEventThottle(timer)

    return maxVal
  }