import socket


def is_port_available(port: int, host="0.0.0.0"):
    """
    Check if a port is available
    """
    assert isinstance(port, int)

    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    result = True
    try:
        sock.bind((host, port))
    except:
        result = False
    sock.close()
    return result