code: def evaluate_der(
      audio_rttm_map_dict,
      all_reference,
      all_hypothesis,
      diar_eval_mode="all",
  ):
      """
      Evaluate with a selected diarization evaluation scheme
  
      AUDIO_RTTM_MAP (dict):
          Dictionary containing information provided from manifestpath
      all_reference (list[uniq_name,annotation]):
          reference annotations for score calculation
      all_hypothesis (list[uniq_name,annotation]):
          hypothesis annotations for score calculation
      diar_eval_mode (str):
          Diarization evaluation modes
  
          diar_eval_mode == "full":
              DIHARD challenge style evaluation, the most strict way of evaluating diarization
              (collar, ignore_overlap) = (0.0, False)
          diar_eval_mode == "fair":
              Evaluation setup used in VoxSRC challenge
              (collar, ignore_overlap) = (0.25, False)
          diar_eval_mode == "forgiving":
              Traditional evaluation setup
              (collar, ignore_overlap) = (0.25, True)
          diar_eval_mode == "all":
              Compute all three modes (default)
      """
      eval_settings = []
      if diar_eval_mode == "full":
          eval_settings = [(0.0, False)]
      elif diar_eval_mode == "fair":
          eval_settings = [(0.25, False)]
      elif diar_eval_mode == "forgiving":
          eval_settings = [(0.25, True)]
      elif diar_eval_mode == "all":
          eval_settings = [(0.0, False), (0.25, False), (0.25, True)]
      else:
          raise ValueError(
              "`diar_eval_mode` variable contains an unsupported value"
          )
  
      for collar, ignore_overlap in eval_settings:
          diar_score = score_labels(
              AUDIO_RTTM_MAP=audio_rttm_map_dict,
              all_reference=all_reference,
              all_hypothesis=all_hypothesis,
              collar=collar,
              ignore_overlap=ignore_overlap,
          )
      return diar_score
  
file_path: NeMo/nemo/collections/asr/metrics/der.py
imports: import itertools
  from itertools import permutations
  from typing import Dict, List, Optional, Tuple
  import numpy
  import torch
  from pyannote.core import Segment, Timeline
  from pyannote.metrics.diarization import DiarizationErrorRate
  from nemo.collections.asr.metrics.wer import word_error_rate
  from nemo.collections.asr.parts.utils.optimization_utils import linear_sum_assignment
  from nemo.utils import logging
label_desc: Use image node_id 5 for calling a global function with example usage: evaluate_der(audio_rttm_map_dict, all_reference, all_hypothesis, diar_eval_mode) and returns: diar_score