code: def _calibrate_confident_joint_multilabel(
      confident_joint: np.ndarray, labels: list
  ) -> np.ndarray:
      """Calibrates the confident joint for multi-label classification data. Here
          input `labels` is a list of lists (or list of iterable).
          This is intended as a helper function. You should probably
          be using `calibrate_confident_joint(multi_label=True)` instead.
  
  
          See `calibrate_confident_joint` docstring for more info.
  
      Parameters
      ----------
      confident_joint : np.ndarray
          Refer to documentation for this argument in count.calibrate_confident_joint() for details.
  
      labels : list
          Refer to documentation for this argument in count.calibrate_confident_joint() for details.
  
      multi_label : bool, optional
          Refer to documentation for this argument in count.calibrate_confident_joint() for details.
  
      Returns
      -------
      calibrated_cj : np.ndarray
        An array of shape ``(K, 2, 2)`` of type float representing a valid
        estimate of the joint *counts* of noisy and true labels in a one-vs-rest fashion.
      """
      y_one, num_classes = get_onehot_num_classes(labels)
      calibrate_confident_joint_list: np.ndarray = np.ndarray(
          shape=(num_classes, 2, 2), dtype=np.int64
      )
      for class_num, (cj, y) in enumerate(
          zip(confident_joint, y_one.T)
      ):
          calibrate_confident_joint_list[
              class_num
          ] = calibrate_confident_joint(cj, labels=y)
  
      return calibrate_confident_joint_list
  
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 5 for calling a global function with example usage: _calibrate_confident_joint_multilabel(confident_joint, labels) and returns: calibrate_confident_joint_list