Maxheap variant of _siftup
326651
def _siftup_max(heap, pos):
    ''
    endpos = len(heap)
    startpos = pos
    newitem = heap[pos]
    # Bubble up the larger child until hitting a leaf.
    childpos = 2*pos + 1    # leftmost child position
    while childpos < endpos:
        # Set childpos to index of larger child.
        rightpos = childpos + 1
        if rightpos < endpos and not heap[rightpos] < heap[childpos]:
            childpos = rightpos
        # Move the larger child up.
        heap[pos] = heap[childpos]
        pos = childpos
        childpos = 2*pos + 1
    # The leaf at pos is empty now.  Put newitem there, and bubble it up
    # to its final resting place (by sifting its parents down).
    heap[pos] = newitem
    _siftdown_max(heap, startpos, pos)
452318
def steps(current, target, max_steps):
    
    if current < 0 or current > 1.0:
        raise ValueError("current value %s is out of bounds (0.0-1.0)", current)
    if target < 0 or target > 1.0:
        raise ValueError("target value %s is out of bounds (0.0-1.0)", target)
    return int(abs((current * max_steps) - (target * max_steps)))
125447
def maximum(self, vars_list: List[str]) -> 'TensorFluent':
        '''
        '''
        return self._aggregation_op(tf.reduce_max, self, vars_list)
1328297
def siftdown(heap1, heap2, elt):
    """"""
    while elt * 2 + 1 < heap1.shape[0]:
        left_child = elt * 2 + 1
        right_child = left_child + 1
        swap = elt

        if heap1[swap] < heap1[left_child]:
            swap = left_child

        if right_child < heap1.shape[0] and heap1[swap] < heap1[right_child]:
            swap = right_child

        if swap == elt:
            break
        else:
            heap1[elt], heap1[swap] = heap1[swap], heap1[elt]
            heap2[elt], heap2[swap] = heap2[swap], heap2[elt]
            elt = swap
500421
def ems(self, value: float) -> 'Size':
        """"""
        raise_not_number(value)
        self.maximum = '{}em'.format(value)
        return self
232605
def heappushpop(heap, item):
    """"""
    if heap and heap[0] < item:
        item, heap[0] = heap[0], item
        _siftup(heap, 0)
    return item
877887
private void calculateMaxViewport() {
        tempMaximumViewport.set(0, MAX_WIDTH_HEIGHT, MAX_WIDTH_HEIGHT, 0);
        maxSum = 0.0f;
        for (SliceValue sliceValue : dataProvider.getPieChartData().getValues()) {
            maxSum += Math.abs(sliceValue.getValue());
        }
    }
1048384
def heappush(heap, item):
    """"""
    heap.append(item)
    _siftdown(heap, 0, len(heap)-1)
908928
def _heappush_max(heap, item):
    
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap) - 1)
351720
def offsets_for_max_size( max_size ):
    
    for i, max in enumerate( reversed( BIN_OFFSETS_MAX ) ):
        if max_size < max:
            break
    else:
        raise Exception( "%d is larger than the maximum possible size (%d)" % ( max_size, BIN_OFFSETS_MAX[0] ) )
    return BIN_OFFSETS[ ( len(BIN_OFFSETS) - i - 1 ) : ]
729899
def setMaximum( self, value ):
        
        super(XRatingSlider, self).setMaximum(value)
        
        self.adjustMinimumWidth()
991847
def next_frame_sv2p_atari_softmax():
  """"""
  hparams = next_frame_sv2p_atari()
  hparams.bottom = {}
  hparams.loss = {}
  hparams.top = {}
  hparams.internal_loss = True
  return hparams
1370678
def softmax(attrs, inputs, proto_obj):
    """"""
    if 'axis' not in attrs:
        attrs = translation_utils._add_extra_attributes(attrs, {'axis': 1})
    return 'softmax', attrs, inputs
1189274
@SuppressWarnings("unchecked")
	private void siftUp (int k, E x) {
		while (k > 0) {
			int parent = (k - 1) >>> 1;
			E e = (E)queue[parent];
			if (x.compareTo(e) >= 0) break;
			queue[k] = e;
			k = parent;
		}
		queue[k] = x;
	}
625141
def reduce_max(attrs, inputs, proto_obj):
    """"""
    new_attrs = translation_utils._fix_attribute_names(attrs, {'axes':'axis'})
    return 'max', new_attrs, inputs
236723
def _heapreplace_max(heap, item):
    """"""
    returnitem = heap[0]    # raises appropriate IndexError if heap is empty
    heap[0] = item
    _siftup_max(heap, 0)
    return returnitem
471312
public static int Maximum(ImageSource fastBitmap, int startX, int startY, int width, int height) {
        int max = 0;

        if (fastBitmap.isGrayscale()) {
            for (int i = startX; i < height; i++) {
                for (int j = startY; j < width; j++) {
                    int gray = fastBitmap.getRGB(j, i);
                    if (gray > max) {
                        max = gray;
                    }
                }
            }
        } else {
            for (int i = startX; i < height; i++) {
                for (int j = startY; j < width; j++) {
                    int gray = fastBitmap.getG(j, i);
                    if (gray > max) {
                        max = gray;
                    }
                }
            }
        }

        return max;
    }