human
Complete this python program:
def iterable_middleware(app):
assistant
#Here is the Python code you requested.

    """Guarantee that the app returns an iterable
    """
    def inner(environ, start_response):
        rv = app(environ, start_response)
        class Iterable(object, ):
            def __iter__(self):
                return iter(rv)
            if hasattr(rv, 'close'):
                def close(self):
                    rv.close()
        return Iterable()
    return inner