code: def create_manifest_with_alignments(
      input_manifest_filepath,
      ctm_source_dir,
      output_manifest_filepath,
      data_format_style,
      silence_dur_threshold=0.1,
      output_precision=3,
  ):
      """
      Create new manifest file with word alignments using CTM files
  
      Args:
          input_manifest_filepath (str): Path to the input manifest file
          ctm_source_dir (str): Directory to read the CTM files from
          output_manifest_filepath (str): Path to the output manifest file containing word alignments
          precision (int): How many decimal places to keep in the manifest file
      """
      manifest = read_manifest(input_manifest_filepath)
  
      target_manifest = []
      src_i = 0
      tgt_i = 0
      while src_i < len(manifest):
          f = manifest[src_i]
          fn = f["audio_filepath"].split("/")[-1]
          filename = fn.split(".")[
              0
          ]  # assuming that there is only one period in the input filenames
          if "voxceleb" in data_format_style:
              fn_split = f["audio_filepath"].split("/")
              filename = (
                  fn_split[-3]
                  + "-"
                  + fn_split[-2]
                  + "-"
                  + fn_split[-1].split(".")[0]
              )
              ctm_filepath = os.path.join(
                  ctm_source_dir, filename + ".ctm"
              )
          else:
              ctm_filepath = os.path.join(
                  ctm_source_dir, filename + ".ctm"
              )
  
          if not os.path.isfile(ctm_filepath):
              logging.info(
                  f"Skipping {filename}.wav as there is no corresponding CTM file"
              )
              src_i += 1
              continue
  
          with open(ctm_filepath, "r") as ctm_file:
              lines = ctm_file.readlines()
  
          # One-word samples should be filtered out.
          if len(lines) <= 1:
              src_i += 1
              continue
  
          words = []
          end_times = []
          i = 0
          prev_end = 0
          for i in range(len(lines)):
              ctm = lines[i].split(" ")
              speaker_id, start, end = get_seg_info_from_ctm_line(
                  ctm_list=ctm, output_precision=output_precision
              )
              interval = start - prev_end
  
              if (i == 0 and interval > 0) or (
                  i > 0 and interval > silence_dur_threshold
              ):
                  words.append("")
                  end_times.append(start)
              elif i > 0:
                  end_times[-1] = start
  
              words.append(ctm[4])
              end_times.append(end)
  
              i += 1
              prev_end = end
  
          # append last end
          if f["duration"] > prev_end:
              words.append("")
              end_times.append(f["duration"])
  
          # build target manifest entry
          target_manifest.append(
              {
                  "audio_filepath": f["audio_filepath"],
                  "duration": f["duration"],
                  "text": f["text"],
                  "words": words,
                  "alignments": end_times,
                  "speaker_id": speaker_id,
              }
          )
  
          src_i += 1
          tgt_i += 1
  
      logging.info(
          f"Writing output manifest file to {output_manifest_filepath}"
      )
      write_manifest(output_manifest_filepath, target_manifest)
  
file_path: NeMo/scripts/speaker_tasks/create_alignment_manifest.py
imports: import argparse
  import os
  import shutil
  from pathlib import Path
  from typing import List
  from nemo.collections.asr.parts.utils.manifest_utils import get_ctm_line, read_manifest, write_ctm, write_manifest
  from nemo.utils import logging
label_desc: Use image node_id 6 for calling a global function with example usage: create_manifest_with_alignments(input_manifest_filepath, ctm_source_dir, output_manifest_filepath, data_format_style, silence_dur_threshold, output_precision) without return types