def heapiter(heap):
    # An iterator returning a heap's elements, smallest-first.
    try:
        while 1:
            yield heappop(heap)
    except __HOLE__:
        pass
dataset/ETHPy150Open babble/babble/include/jython/Lib/test/test_heapq.py/heapiter