#NEWLINE# def exhaust( stream_or_iterable ) : #NEWLINE# #INDENT# '\n    Completely exhausts an iterator or stream.\n\n    Raise a MultiPartParserError if the argument is not a stream or an iterable.\n    ' #NEWLINE# iterator = None #NEWLINE# try : #NEWLINE# #INDENT# iterator = iter ( stream_or_iterable ) #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# iterator = ChunkIter ( stream_or_iterable , 16384 ) #NEWLINE# #UNINDENT# if ( __ is None ) : #NEWLINE# #INDENT# raise MultiPartParserError ( 'multipartparser.exhaust() was passed a non-iterable or stream parameter' ) #NEWLINE# #UNINDENT# for __ in iterator : #NEWLINE# #INDENT# pass