code: def _get_annotator_agreement_with_consensus(
      labels_multiannotator: np.ndarray,
      consensus_label: np.ndarray,
  ) -> np.ndarray:
      """Returns the fractions of annotators that agree with the consensus label per example. Note that the
      fraction for each example only considers the annotators that labeled that particular 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.
  
      Returns
      -------
      annotator_agreement : np.ndarray
          An array of shape ``(N,)`` with the fraction of annotators that agree with each consensus label.
      """
      annotator_agreement = np.zeros(len(labels_multiannotator))
      for i, labels in enumerate(labels_multiannotator):
          annotator_agreement[i] = np.mean(
              labels[~np.isnan(labels)] == consensus_label[i]
          )
  
      return annotator_agreement
  
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 9 for calling a global function with example usage: _get_annotator_agreement_with_consensus(labels_multiannotator, consensus_label) and returns: annotator_agreement