import socket


def is_listening(host, port):
    """Check if a service is listening there."""
    s = socket.socket()
    try:
        s.connect((host, port))
        return True
    except socket.error:
        return False