code: def _labels_to_binary(
      labels: List[List[int]],
      pred_probs: npt.NDArray["np.floating[T]"],
  ) -> np.ndarray:
      """Validate the inputs to the multilabel scorer. Also transform the labels to a binary representation."""
      assert_valid_inputs(
          X=None,
          y=labels,
          pred_probs=pred_probs,
          multi_label=True,
          allow_one_class=True,
      )
      num_classes = get_num_classes(
          labels=labels, pred_probs=pred_probs, multi_label=True
      )
      binary_labels = int2onehot(labels, K=num_classes)
      return binary_labels
  
file_path: cleanlab/cleanlab/multilabel_classification/rank.py
imports: from __future__ import annotations
  import numpy
  from typing import List, TypeVar, Dict, Any, Optional, Tuple, TYPE_CHECKING
  from cleanlab.internal.validation import assert_valid_inputs
  from cleanlab.internal.util import get_num_classes
  from cleanlab.internal.multilabel_utils import int2onehot
  from cleanlab.internal.multilabel_scorer import MultilabelScorer, ClassLabelScorer, Aggregator
label_desc: Use image node_id 1 for calling a global function with example usage: _labels_to_binary(labels, pred_probs) and returns: binary_labels