code: def get_num_classes(
      labels=None, pred_probs=None, label_matrix=None, multi_label=None
  ) -> int:
      """Determines the number of classes based on information considered in a
      canonical ordering. label_matrix can be: noise_matrix, inverse_noise_matrix, confident_joint,
      or any other K x K matrix where K = number of classes.
      """
      if (
          pred_probs is not None
      ):  # pred_probs is number 1 source of truth
          return pred_probs.shape[1]
  
      if (
          label_matrix is not None
      ):  # matrix dimension is number 2 source of truth
          if label_matrix.shape[0] != label_matrix.shape[1]:
              raise ValueError(
                  f"label matrix must be K x K, not {label_matrix.shape}"
              )
          else:
              return label_matrix.shape[0]
  
      if labels is None:
          raise ValueError(
              "Cannot determine number of classes from None input"
          )
  
      return num_unique_classes(labels, multi_label=multi_label)
  
imports: import warnings
  import numpy
  import pandas
  from typing import Union, Tuple
  from cleanlab.typing import DatasetLike, LabelLike
  from cleanlab.internal.validation import labels_to_array
  from cleanlab.internal.constants import FLOATING_POINT_COMPARISON, TINY_VALUE
label_desc: Use image node_id 26 for calling a global function with example usage: get_num_classes(labels, pred_probs, label_matrix, multi_label) and returns: num_unique_classes, pred_probs, label_matrix