code: def _get_consensus_quality_score(
      consensus_label: np.ndarray,
      pred_probs: np.ndarray,
      num_annotations: np.ndarray,
      annotator_agreement: np.ndarray,
      quality_method: str = "crowdlab",
      label_quality_score_kwargs: dict = {},
  ) -> np.ndarray:
      """Return scores representing quality of the consensus label for each example.
  
      Parameters
      ----------
      labels_multiannotator : np.ndarray
          2D numpy array of multiple given labels for each example with shape ``(N, M)``,
          where N is the number of examples and M is the number of annotators.
          For more details, labels in the same format expected by the `~cleanlab.multiannotator.get_label_quality_multiannotator`.
      consensus_label : np.ndarray
          An array of shape ``(N,)`` with the consensus labels aggregated from all annotators.
      pred_probs : np.ndarray
          An array of shape ``(N, K)`` of posterior predicted probabilities, ``P(label=k|x)``.
          For details, predicted probabilities in the same format expected by the `~cleanlab.multiannotator.get_label_quality_multiannotator`.
      num_annotations : np.ndarray
          An array of shape ``(N,)`` with the number of annotators that have labeled each example.
      annotator_agreement : np.ndarray
          An array of shape ``(N,)`` with the fraction of annotators that agree with each consensus label.
      quality_method : str, default = "crowdlab" (Options: ["crowdlab", "agreement"])
          Specifies the method used to calculate the quality of the consensus label.
          For valid quality methods, view `~cleanlab.multiannotator.get_label_quality_multiannotator`
  
      Returns
      -------
      consensus_quality_score : np.ndarray
          An array of shape ``(N,)`` with the quality score of the consensus.
      """
  
      valid_methods = [
          "crowdlab",
          "agreement",
      ]
  
      if quality_method == "crowdlab":
          consensus_quality_score = get_label_quality_scores(
              consensus_label, pred_probs, **label_quality_score_kwargs
          )
  
      elif quality_method == "agreement":
          consensus_quality_score = annotator_agreement
  
      else:
          raise ValueError(
              f"""
              {quality_method} is not a valid consensus quality method!
              Please choose a valid quality_method: {valid_methods}
              """
          )
  
      return consensus_quality_score
  
imports: import warnings
  import numpy
  import pandas
  from typing import List, Dict, Any, Union, Tuple, Optional
  from cleanlab.rank import get_label_quality_scores
  from cleanlab.internal.util import get_num_classes, value_counts
  from cleanlab.internal.constants import CLIPPING_LOWER_BOUND
  from cleanlab.internal.multiannotator_utils import assert_valid_inputs_multiannotator, assert_valid_pred_probs, check_consensus_label_classes, find_best_temp_scaler, temp_scale_pred_probs
label_desc: Use image node_id 14 for calling a global function with example usage: _get_consensus_quality_score(consensus_label, pred_probs, num_annotations, annotator_agreement, quality_method, label_quality_score_kwargs) and returns: consensus_quality_score