def METHOD_NAME(io_loop):
    """
    A context manager that will set the current ioloop to io_loop for the context
    """
    try:
        orig_loop = tornado.ioloop.IOLoop.current()
    except RuntimeError:
        orig_loop = None
    asyncio.set_event_loop(io_loop.asyncio_loop)
    try:
        yield
    finally:
        if orig_loop:
            asyncio.set_event_loop(orig_loop.asyncio_loop)
        else:
            asyncio.set_event_loop(None)