code: def assert_valid_pred_probs(
      pred_probs: Optional[np.ndarray] = None,
      pred_probs_unlabeled: Optional[np.ndarray] = None,
      ensemble: bool = False,
  ):
      """Validate format of pred_probs for multiannotator active learning functions"""
      if pred_probs is None and pred_probs_unlabeled is None:
          raise ValueError(
              "pred_probs and pred_probs_unlabeled cannot both be None, specify at least one of the two."
          )
  
      if ensemble:
          if pred_probs is not None:
              if not isinstance(pred_probs, np.ndarray):
                  raise TypeError("pred_probs must be a numpy array.")
              if pred_probs.ndim != 3:
                  error_message = "pred_probs must be a 3d array."
                  if pred_probs.ndim == 2:  # pragma: no cover
                      error_message += " If you have a 2d pred_probs array (ie. only one predictor), use the non-ensemble version of this function."
                  raise ValueError(error_message)
  
          if pred_probs_unlabeled is not None:
              if not isinstance(pred_probs_unlabeled, np.ndarray):
                  raise TypeError(
                      "pred_probs_unlabeled must be a numpy array."
                  )
              if pred_probs_unlabeled.ndim != 3:
                  error_message = (
                      "pred_probs_unlabeled must be a 3d array."
                  )
                  if pred_probs_unlabeled.ndim == 2:  # pragma: no cover
                      error_message += " If you have a 2d pred_probs_unlabeled array, use the non-ensemble version of this function."
                  raise ValueError(error_message)
  
          if (
              pred_probs is not None
              and pred_probs_unlabeled is not None
          ):
              if pred_probs.shape[2] != pred_probs_unlabeled.shape[2]:
                  raise ValueError(
                      "pred_probs and pred_probs_unlabeled must have the same number of classes"
                  )
  
      else:
          if pred_probs is not None:
              if not isinstance(pred_probs, np.ndarray):
                  raise TypeError("pred_probs must be a numpy array.")
              if pred_probs.ndim != 2:
                  error_message = "pred_probs must be a 2d array."
                  if pred_probs.ndim == 3:  # pragma: no cover
                      error_message += " If you have a 3d pred_probs array, use the ensemble version of this function."
                  raise ValueError(error_message)
  
          if pred_probs_unlabeled is not None:
              if not isinstance(pred_probs_unlabeled, np.ndarray):
                  raise TypeError(
                      "pred_probs_unlabeled must be a numpy array."
                  )
              if pred_probs_unlabeled.ndim != 2:
                  error_message = (
                      "pred_probs_unlabeled must be a 2d array."
                  )
                  if pred_probs_unlabeled.ndim == 3:  # pragma: no cover
                      error_message += " If you have a 3d pred_probs_unlabeled array, use the non-ensemble version of this function."
                  raise ValueError(error_message)
  
          if (
              pred_probs is not None
              and pred_probs_unlabeled is not None
          ):
              if pred_probs.shape[1] != pred_probs_unlabeled.shape[1]:
                  raise ValueError(
                      "pred_probs and pred_probs_unlabeled must have the same number of classes"
                  )
  
file_path: cleanlab/cleanlab/internal/multiannotator_utils.py
imports: from cleanlab.typing import LabelLike
  from typing import Optional, Tuple
  import warnings
  import numpy
  import pandas
  from cleanlab.internal.validation import assert_valid_class_labels
  from cleanlab.internal.numerics import softmax
  from cleanlab.internal.util import get_num_classes, value_counts
label_desc: Use image node_id 2 for calling a global function with example usage: assert_valid_pred_probs(pred_probs, pred_probs_unlabeled, ensemble) without return types