code: def _compute_label_quality_scores(
      labels: np.ndarray,
      pred_probs: np.ndarray,
      *,
      method: str = "self_confidence",
      adjust_pred_probs: bool = False,
      confident_thresholds: Optional[np.ndarray] = None,
  ) -> np.ndarray:
      """Internal implementation of get_label_quality_scores that assumes inputs
      have already been checked and are valid. This speeds things up.
      Can also take in pre-computed confident_thresholds to further accelerate things.
      """
      scoring_funcs = {
          "self_confidence": get_self_confidence_for_each_label,
          "normalized_margin": get_normalized_margin_for_each_label,
          "confidence_weighted_entropy": get_confidence_weighted_entropy_for_each_label,
      }
      try:
          scoring_func = scoring_funcs[method]
      except KeyError:
          raise ValueError(
              f"""
              {method} is not a valid scoring method for rank_by!
              Please choose a valid rank_by: self_confidence, normalized_margin, confidence_weighted_entropy
              """
          )
      if adjust_pred_probs:
          if method == "confidence_weighted_entropy":
              raise ValueError(
                  f"adjust_pred_probs is not currently supported for {method}."
              )
          pred_probs = _subtract_confident_thresholds(
              labels=labels,
              pred_probs=pred_probs,
              confident_thresholds=confident_thresholds,
          )
  
      scoring_inputs = {"labels": labels, "pred_probs": pred_probs}
      label_quality_scores = scoring_func(**scoring_inputs)
      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 2 for calling a global function with example usage: _compute_label_quality_scores(labels, pred_probs) and returns: label_quality_scores