#NEWLINE# def __iter__( self , min = min , nowfun = monotonic , pop = heapq . heappop , push = heapq . heappush ) : #NEWLINE# #INDENT# 'This iterator yields a tuple of ``(entry, wait_seconds)``,\n        where if entry is :const:`None` the caller should wait\n        for ``wait_seconds`` until it polls the schedule again.' #NEWLINE# max_interval = self . max_interval #NEWLINE# queue = self . _queue #NEWLINE# while 1 : #NEWLINE# #INDENT# if queue : #NEWLINE# #INDENT# eventA = queue [ 0 ] #NEWLINE# ( now , eta ) = ( nowfun ( ) , eventA [ 0 ] ) #NEWLINE# if ( now < eta ) : #NEWLINE# #INDENT# ( yield ( min ( ( eta - now ) , max_interval ) , None ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# eventB = pop ( queue ) #NEWLINE# if ( eventB is eventA ) : #NEWLINE# #INDENT# entry = eventA [ 2 ] #NEWLINE# if ( not entry . canceled ) : #NEWLINE# #INDENT# ( yield ( None , entry ) ) #NEWLINE# #UNINDENT# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# push ( pop , eventB ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# ( yield ( None , None ) )