original_docstring: Replace an element in the heap
          
docstring: Replace an element in the heap
docstring_tokens: Replace an element in the heap
code: def update(self, old, new):
          """Replace an element in the heap
          """
          i = self.rank[old]     # change value at index i
          del self.rank[old]
          self.heap[i] = new
          self.rank[new] = i
          if old < new:          # maintain heap order
              self.down(i)
          else:
              self.up(i)
code_tokens: def update ( self , old , new ) : i = self . rank [ old ] del self . rank [ old ] self . heap [ i ] = new self . rank [ new ] = i if old < new : self . down ( i ) else : self . up ( i )
short_docstring: Replace an element in the heap
short_docstring_tokens: Replace an element in the heap
comment: """Replace an element in the heap
          """$SEP$# change value at index i$SEP$# maintain heap order