#NEWLINE# def stream( self , amt = ( 2 ** 16 ) , decode_content = None ) : #NEWLINE# #INDENT# "\n        A generator wrapper for the read() method. A call will block until\n        ``amt`` bytes have been read from the connection or until the\n        connection is closed.\n\n        :param amt:\n            How much of the content to read. The generator will return up to\n            much data per iteration, but may return less. This is particularly\n            likely when using compressed data. However, the empty string will\n            never be returned.\n\n        :param decode_content:\n            If True, will attempt to decode the body based on the\n            'content-encoding' header.\n        " #NEWLINE# if self . chunked : #NEWLINE# #INDENT# for line in self . read_chunked ( amt , decode_content = self ) : #NEWLINE# #INDENT# ( yield line ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# while ( not is_fp_closed ( self . _fp ) ) : #NEWLINE# #INDENT# data = self . read ( amt = amt , decode_content = decode_content ) #NEWLINE# if data : #NEWLINE# #INDENT# ( yield data )