human
Solve the following python programming problem given the following code:
@gen.coroutine
def wait_for_spawner(spawner, timeout=10):
assistant
#Here is the Python program you requested.

    """Wait for an http server to show up
    polling at shorter intervals for early termination
    """
    deadline = (time.monotonic() + timeout)
    def wait():
        return spawner.server.wait_up(timeout=1, http=True)
    while (time.monotonic() < deadline):
        status = (yield spawner.poll())
        assert (status is None)
        try:
            (yield wait())
        except TimeoutError:
            continue
        else:
            break
    (yield wait())