code: def get_confident_thresholds(
      labels: LabelLike,
      pred_probs: np.ndarray,
      multi_label: bool = False,
  ) -> np.ndarray:
      """Returns expected (average) "self-confidence" for each class.
  
      The confident class threshold for a class j is the expected (average) "self-confidence" for class j,
      i.e. the model-predicted probability of this class averaged amongst all examples labeled as class j.
  
      Parameters
      ----------
      labels : np.ndarray or list
        Given class labels for each example in the dataset, some of which may be erroneous,
        in same format expected by :py:func:`filter.find_label_issues <cleanlab.filter.find_label_issues>` function.
  
      pred_probs : np.ndarray
        Model-predicted class probabilities for each example in the dataset,
        in same format expected by :py:func:`filter.find_label_issues <cleanlab.filter.find_label_issues>` function.
  
      multi_label : bool, default = False
        Set ``False`` if your dataset is for regular (multi-class) classification, where each example belongs to exactly one class.
        Set ``True`` if your dataset is for multi-label classification, where each example can belong to multiple classes.
        See documentation of `~cleanlab.count.compute_confident_joint` for details.
  
      Returns
      -------
      confident_thresholds : np.ndarray
        An array of shape ``(K, )`` where K is the number of classes.
      """
      if multi_label:
          assert isinstance(labels, list)
          return _get_confident_thresholds_multilabel(
              labels=labels, pred_probs=pred_probs
          )
      else:
          # When all_classes != unique_classes the class threshold for the missing classes is set to
          # BIG_VALUE such that no valid prob >= BIG_VALUE (no example will be counted in missing classes)
          # REQUIRES: pred_probs.max() >= 1
          # TODO: if you want this to work for arbitrary softmax outputs where pred_probs.max()
          #  may exceed 1, change BIG_VALUE = 2 --> BIG_VALUE = 2 * pred_probs.max(). Downside of
          #  this approach is that there will be no standard value returned for missing classes.
          labels = labels_to_array(labels)
          all_classes = range(pred_probs.shape[1])
          unique_classes = get_unique_classes(labels)
          BIG_VALUE = 2
          confident_thresholds = [
              np.mean(pred_probs[:, k][labels == k])
              if k in unique_classes
              else BIG_VALUE
              for k in all_classes
          ]
          confident_thresholds = np.clip(
              confident_thresholds,
              a_min=CONFIDENT_THRESHOLDS_LOWER_BOUND,
              a_max=None,
          )
          return confident_thresholds
  
imports: from sklearn.linear_model import LogisticRegression
  from sklearn.model_selection import StratifiedKFold
  from sklearn.metrics import confusion_matrix
  import sklearn.base
  import numpy
  import warnings
  from typing import Tuple, Union, Optional
  from cleanlab.typing import LabelLike
  from cleanlab.internal.multilabel_utils import stack_complement, get_onehot_num_classes
  from cleanlab.internal.constants import TINY_VALUE, CONFIDENT_THRESHOLDS_LOWER_BOUND, FLOATING_POINT_COMPARISON
  from cleanlab.internal.util import value_counts_fill_missing_classes, clip_values, clip_noise_rates, round_preserving_row_totals, append_extra_datapoint, train_val_split, get_num_classes, get_unique_classes, is_torch_dataset, is_tensorflow_dataset
  from cleanlab.internal.latent_algebra import compute_inv_noise_matrix, compute_py, compute_noise_matrix_from_inverse
  from cleanlab.internal.validation import assert_valid_inputs, labels_to_array
label_desc: Use image node_id 17 for calling a global function with example usage: get_confident_thresholds(labels, pred_probs, multi_label) and returns: _get_confident_thresholds_multilabel, confident_thresholds