code: def main(
      hyp_rttm_list_path: str,
      ref_rttm_list_path: str,
      hyp_ctm_list_path: str,
      ref_ctm_list_path: str,
      hyp_json_list_path: str,
      diar_eval_mode: str = "all",
      root_path: str = "./",
  ):
      # Read filepath list files
      hyp_rttm_list = (
          read_file_path(hyp_rttm_list_path)
          if hyp_rttm_list_path
          else None
      )
      ref_rttm_list = (
          read_file_path(ref_rttm_list_path)
          if ref_rttm_list_path
          else None
      )
      hyp_ctm_list = (
          read_file_path(hyp_ctm_list_path)
          if hyp_ctm_list_path
          else None
      )
      ref_ctm_list = (
          read_file_path(ref_ctm_list_path)
          if ref_ctm_list_path
          else None
      )
      hyp_json_list = (
          read_file_path(hyp_json_list_path)
          if hyp_json_list_path
          else None
      )
  
      audio_rttm_map_dict = make_meta_dict(hyp_rttm_list, ref_rttm_list)
  
      trans_info_dict = (
          make_trans_info_dict(hyp_json_list) if hyp_json_list else None
      )
  
      all_hypothesis = get_pyannote_objs_from_rttms(hyp_rttm_list)
      all_reference = get_pyannote_objs_from_rttms(ref_rttm_list)
  
      diar_score = evaluate_der(
          audio_rttm_map_dict=audio_rttm_map_dict,
          all_reference=all_reference,
          all_hypothesis=all_hypothesis,
          diar_eval_mode=diar_eval_mode,
      )
  
      # Get session-level diarization error rate and speaker counting error
      der_results = OfflineDiarWithASR.gather_eval_results(
          diar_score=diar_score,
          audio_rttm_map_dict=audio_rttm_map_dict,
          trans_info_dict=trans_info_dict,
          root_path=root_path,
      )
  
      if ref_ctm_list is not None:
          # Calculate WER and cpWER if reference CTM files exist
          if hyp_ctm_list is not None:
              wer_results = OfflineDiarWithASR.evaluate(
                  audio_file_list=hyp_rttm_list,
                  hyp_trans_info_dict=None,
                  hyp_ctm_file_list=hyp_ctm_list,
                  ref_ctm_file_list=ref_ctm_list,
              )
          elif hyp_json_list is not None:
              wer_results = OfflineDiarWithASR.evaluate(
                  audio_file_list=hyp_rttm_list,
                  hyp_trans_info_dict=trans_info_dict,
                  hyp_ctm_file_list=None,
                  ref_ctm_file_list=ref_ctm_list,
              )
          else:
              raise ValueError(
                  "Hypothesis information is not provided in the correct format."
              )
      else:
          wer_results = {}
  
      # Print average DER, WER and cpWER
      OfflineDiarWithASR.print_errors(
          der_results=der_results, wer_results=wer_results
      )
  
      # Save detailed session-level evaluation results in `root_path`.
      OfflineDiarWithASR.write_session_level_result_in_csv(
          der_results=der_results,
          wer_results=wer_results,
          root_path=root_path,
          csv_columns=OfflineDiarWithASR.get_csv_columns(),
      )
      return None
  
file_path: NeMo/scripts/speaker_tasks/eval_diar_with_asr.py
imports: import argparse
  import json
  import os
  from nemo.collections.asr.metrics.der import evaluate_der
  from nemo.collections.asr.parts.utils.diarization_utils import OfflineDiarWithASR
  from nemo.collections.asr.parts.utils.manifest_utils import read_file
  from nemo.collections.asr.parts.utils.speaker_utils import get_uniqname_from_filepath, labels_to_pyannote_object, rttm_to_labels
label_desc: Use image node_id 5 for calling a global function with example usage: main(hyp_rttm_list_path, ref_rttm_list_path, hyp_ctm_list_path, ref_ctm_list_path, hyp_json_list_path, diar_eval_mode, root_path) and returns: None