import socket


def check_free_port(host, port):
    """Check if a given port is available."""
    sock = socket.socket()
    try:
        sock.bind((host, port))
        sock.close()
        print("host {} on port {} is AVAILABLE".format(host, port))
        return(True)
    except Exception as e:
        print(e)
        print("host {} on port {} is BUSY".format(host, port))
        sock.close()
        return(False)