human
Complete this python program:
def check_host(fn):
assistant
#Here is the Python program you requested.

    """Makes sure that the host exists.
    """
    def wrapped(self, req, id, service=None, *args, **kwargs):
        listed_hosts = _list_hosts(req, service)
        hosts = [h['host_name'] for h in listed_hosts]
        if (id in hosts):
            return fn(self, req, id, *args, **kwargs)
        raise exception.HostNotFound(host=id)
    return wrapped