human
Complete the below
def exhaust_stream(f):

    ''''Helper decorator for methods that exhausts the stream on return.'
    '''

Give me a the Python program you requested?
assistant
#Here is the Python program you requested.
    def wrapper(self, stream, *args, **kwargs):
        try:
            return f(self, stream, *args, **kwargs)
        finally:
            exhaust = getattr(stream, 'exhaust', None)
            if (exhaust is not None):
                exhaust()
            else:
                while 1:
                    chunk = stream.read((1024 * 64))
                    if (not chunk):
                        break
    return update_wrapper(wrapper, f)