#NEWLINE# def get_pushes( self , capture_all = False ) : #NEWLINE# #INDENT# '\n        Returns a generator that yields push promises from the server. Note\n        that this method is not idempotent; promises returned in one call will\n        not be returned in subsequent calls. Iterating through generators\n        returned by multiple calls to this method simultaneously results in\n        undefined behavior.\n\n        :param capture_all: If ``False``, the generator will yield all buffered\n            push promises without blocking. If ``True``, the generator will\n            first yield all buffered push promises, then yield additional ones\n            as they arrive, and terminate when the original stream closes.\n        ' #NEWLINE# while True : #NEWLINE# #INDENT# for pair in self . promised_headers . items ( ) : #NEWLINE# #INDENT# ( yield pair ) #NEWLINE# #UNINDENT# self . promised_headers = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( ( not capture_all ) or self . remote_closed ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# self . _recv_cb ( )