def METHOD_NAME(port: int) -> bool:
    """Returns if a localhost port is active.
    :param port: Port to check.
    :return: Returns if the port is open.
    """
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    result = sock.connect_ex(("127.0.0.1", port))
    sock.close()
    return result == 0