def is_valid(message):
    """Check if message is not part of certain invalid labels."""
    invalid_labels_set = {"CHAT"}
    message_labels_set = set(message['labelIds'])
    # return False is set intersection is empty.
    return not bool(message_labels_set.intersection(invalid_labels_set))