code: def get_confidence_weighted_entropy_for_each_label(
      labels: np.ndarray, pred_probs: np.ndarray
  ) -> np.ndarray:
      """Returns the "confidence weighted entropy" label-quality score for each datapoint.
  
      This is a function to compute label-quality scores for classification datasets,
      where lower scores indicate labels less likely to be correct.
  
      "confidence weighted entropy" is defined as the normalized entropy divided by "self-confidence".
      The returned values are a transformed version of this score, in order to
      ensure values between 0-1 with lower values indicating more likely mislabeled data.
  
      Parameters
      ----------
      labels : np.ndarray
        Labels in the same format expected by the `~cleanlab.rank.get_label_quality_scores` function.
  
      pred_probs : np.ndarray
        Predicted-probabilities in the same format expected by the `~cleanlab.rank.get_label_quality_scores` function.
  
      Returns
      -------
      label_quality_scores : np.ndarray
        Contains one score (between 0 and 1) per example.
        Lower scores indicate more likely mislabeled examples.
      """
  
      self_confidence = get_self_confidence_for_each_label(
          labels, pred_probs
      )
      self_confidence = np.clip(
          self_confidence, a_min=CLIPPING_LOWER_BOUND, a_max=None
      )
  
      # Divide entropy by self confidence
      label_quality_scores = (
          get_normalized_entropy(pred_probs) / self_confidence
      )
  
      # Rescale
      clipped_scores = np.clip(
          label_quality_scores, a_min=CLIPPING_LOWER_BOUND, a_max=None
      )
      label_quality_scores = (
          np.log(label_quality_scores + 1) / clipped_scores
      )
  
      return label_quality_scores
  
file_path: cleanlab/cleanlab/rank.py
imports: import numpy
  from sklearn.metrics import log_loss
  from typing import List, Optional
  import warnings
  from cleanlab.internal.validation import assert_valid_inputs
  from cleanlab.internal.constants import CLIPPING_LOWER_BOUND
  from cleanlab.internal.label_quality_utils import _subtract_confident_thresholds, get_normalized_entropy
label_desc: Use image node_id 8 for calling a global function with example usage: get_confidence_weighted_entropy_for_each_label(labels, pred_probs) and returns: label_quality_scores