class_docstr: Protected schema for the `FeedbackDataset` label questions, which are the ones that
  will require a label response from the user. This class should not be used directly,
  but instead use the classes that inherit from this one, which in this case are:
  `LabelSelectionQuestion` and `MultiLabelSelectionQuestion`.
  
  Args:
      type: The type of the question. Defaults to None and cannot/shouldn't be modified.
      labels: The list of labels of the label question. The labels must be unique, and
          the list must contain at least two unique labels. Additionally, `labels` can
          also be a dictionary of labels, where the keys are the labels, and the values
          are the labels that will be shown in the UI.
      visible_labels: The number of visible labels in the UI. Defaults to undefined,
          which means that it will be automatically set, otherwise it must be either None
          which means all the labels will be shown, or 3 or greater.
class_docstr_tok: ["Protected","schema","for","the","`","FeedbackDataset","`","label","questions",",","which","are","the","ones","that","will","require","a","label","response","from","the","user",".","This","class","should","not","be","used","directly",",","but","instead","use","the","classes","that","inherit","from","this","one",",","which","in","this","case","are",":","`","LabelSelectionQuestion","`","and","`","MultiLabelSelectionQuestion","`",".","Args",":","type",":","The","type","of","the","question",".","Defaults","to","None","and","can","not","\/should","n't","be","modified",".","labels",":","The","list","of","labels","of","the","label","question",".","The","labels","must","be","unique",",","and","the","list","must","contain","at","least","two","unique","labels",".","Additionally",",","`","labels","`","can","also","be","a","dictionary","of","labels",",","where","the","keys","are","the","labels",",","and","the","values","are","the","labels","that","will","be","shown","in","the","UI",".","visible_labels",":","The","number","of","visible","labels","in","the","UI",".","Defaults","to","undefined",",","which","means","that","it","will","be","automatically","set",",","otherwise","it","must","be","either","None","which","means","all","the","labels","will","be","shown",",","or","3","or","greater","."]
code: def visible_labels_must_be_valid(
      cls, values: Dict[str, Any]
  ) -> Dict[str, Any]:
      if values.get("visible_labels") == UNDEFINED:
          if len(values.get("labels")) > 20:
              warnings.warn(
                  "Since `visible_labels` has not been provided and the total number"
                  " of labels is greater than 20, `visible_labels` will be set to `20`.",
                  UserWarning,
                  stacklevel=1,
              )
              visible_labels = 20
          else:
              visible_labels = None
      else:
          visible_labels = values.get("visible_labels")
          total_labels = len(values.get("labels"))
          if visible_labels and visible_labels > total_labels:
              if total_labels >= 3:
                  warnings.warn(
                      f"`visible_labels={visible_labels}` is greater than the total number"
                      f" of labels ({total_labels}), so it will be set to `{total_labels}`.",
                      UserWarning,
                      stacklevel=1,
                  )
                  visible_labels = total_labels
              else:
                  warnings.warn(
                      f"`labels={values.get('labels')}` has less than 3 labels, so `visible_labels`"
                      " will be set to `None`, which means that all the labels will be visible.",
                      UserWarning,
                      stacklevel=1,
                  )
                  visible_labels = None
      values["visible_labels"] = visible_labels
      return values
  
imports: import warnings
  from abc import ABC, abstractmethod
  from typing import Any, Dict, List, Literal, Optional, Union
  from argilla.client.feedback.schemas.enums import QuestionTypes
  from argilla.client.feedback.schemas.utils import LabelMappingMixin
  from argilla.client.feedback.schemas.validators import title_must_have_value
  from argilla.pydantic_v1 import BaseModel, Extra, Field, conint, conlist, root_validator, validator
label_desc: Use image node_id 2 for calling the _LabelQuestion obj's underlying member method code with example usage: obj.visible_labels_must_be_valid(cls, values) and returns: values