original_docstring: the value of heap[i] has increased. Maintain heap invariant.
docstring: the value of heap[i] has increased. Maintain heap invariant.
docstring_tokens: the value of heap [ i ] has increased . Maintain heap invariant .
code: def down(self, i):
          """the value of heap[i] has increased. Maintain heap invariant."""
          x = self.heap[i]
          n = len(self.heap)
          while True:
              left = 2 * i       # climb down the tree
              right = left + 1
              if (right < n and self.heap[right] < x and
                      self.heap[right] < self.heap[left]):
                  self.heap[i] = self.heap[right]
                  self.rank[self.heap[right]] = i   # go back up right child
                  i = right
              elif left < n and self.heap[left] < x:
                  self.heap[i] = self.heap[left]
                  self.rank[self.heap[left]] = i    # go back up left child
                  i = left
              else:
                  self.heap[i] = x   # insertion index found
                  self.rank[x] = i
                  return
code_tokens: def down ( self , i ) : x = self . heap [ i ] n = len ( self . heap ) while True : left = 2 * i right = left + 1 if ( right < n and self . heap [ right ] < x and self . heap [ right ] < self . heap [ left ] ) : self . heap [ i ] = self . heap [ right ] self . rank [ self . heap [ right ] ] = i i = right elif left < n and self . heap [ left ] < x : self . heap [ i ] = self . heap [ left ] self . rank [ self . heap [ left ] ] = i i = left else : self . heap [ i ] = x self . rank [ x ] = i return
short_docstring: the value of heap[i] has increased.
short_docstring_tokens: the value of heap [ i ] has increased .
comment: """the value of heap[i] has increased. Maintain heap invariant."""$SEP$# climb down the tree$SEP$# go back up right child$SEP$# go back up left child$SEP$# insertion index found