parameters: (heap, item)
return_statement: return returnitem
docstring: Maxheap version of a heappop followed by a heappush.
docstring_summary: Maxheap version of a heappop followed by a heappush.
docstring_tokens: Maxheap version of a heappop followed by a heappush .
function: def _heapreplace_max(heap, item):
      """Maxheap version of a heappop followed by a heappush."""
      returnitem = heap[0]    # raises appropriate IndexError if heap is empty
      heap[0] = item
      _siftup_max(heap, 0)
      return returnitem
function_tokens: def _heapreplace_max ( heap , item ) : returnitem = heap [ 0 ] # raises appropriate IndexError if heap is empty heap [ 0 ] = item _siftup_max ( heap , 0 ) return returnitem