def pop(self):
        """pop v from PQ and return it."""
        a = self._a
        result = a[1]
        leaf = self._holetoleaf(1)
        if leaf != len(self):
            a[leaf] = a[-1]
            self._bubbleup(leaf, a[-1])
        self._a = a[:-1]
        return result
pop v from PQ and return it.
recipes/Python/81693_Heapbased_priority_queue/recipe-81693.py