def _bubbleup(self, node, v):
        """a[i] is as low as v need be.  Bubble it up."""
        a = self._a
        while node > 1:
            parent = node >> 1
            if not v < a[parent]:          # comparison
                break
            a[node] = a[parent]
            node = parent
        a[node] = v
a[i] is as low as v need be.  Bubble it up.
recipes/Python/81693_Heapbased_priority_queue/recipe-81693.py