code: def write_ctm(output_path: str, target_ctm: Dict[str, dict]):
      """
      Write ctm entries from diarization session to a .ctm file.
  
      Args:
          output_path (str): target file path
          target_ctm (dict): list of ctm entries
      """
      target_ctm.sort(key=lambda y: y[0])
      with open(output_path, "w") as outfile:
          for pair in target_ctm:
              tgt = pair[1]
              outfile.write(tgt)
  
imports: import json
  import os
  from collections import Counter
  from collections import OrderedDict
  from pathlib import Path
  from typing import Dict, List, Union
  import librosa
  import numpy
  from nemo.collections.asr.parts.utils.speaker_utils import audio_rttm_map, get_subsegments, get_uniqname_from_filepath, rttm_to_labels, segments_manifest_to_subsegments_manifest, write_rttm2manifest
  from nemo.utils.data_utils import DataStoreObject
label_desc: Use image node_id 17 for calling a global function with example usage: write_ctm(output_path, target_ctm) without return types