#NEWLINE# def pop( self ) : #NEWLINE# #INDENT# 'Pop an arbitrary element from the stack.' #NEWLINE# try : #NEWLINE# #INDENT# key = heapq . heappop ( self . heap ) #NEWLINE# return self . elements [ key ] #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# raise StopIteration