code: def write_truncated_subsegments(
      input_manifest_dict: Dict[str, dict],
      _subsegment_dict: Dict[str, dict],
      output_manifest_path: str,
      step_count: int,
      deci: int,
  ):
      """
      Write subsegments to manifest filepath.
  
      Args:
          input_manifest_dict (dict): Input manifest dictionary
          _subsegment_dict (dict): Input subsegment dictionary
          output_manifest_path (str): Path to output manifest file
          step_count (int): Number of the unit segments you want to create per utterance
          deci (int): Rounding number of decimal places
      """
      with open(output_manifest_path, "w") as output_manifest_fp:
          for uniq_id, subseg_dict in _subsegment_dict.items():
              subseg_array = np.array(subseg_dict["ts"])
              subseg_array_idx = np.argsort(subseg_array, axis=0)
              chunked_set_count = (
                  subseg_array_idx.shape[0] // step_count
              )
  
              for idx in range(chunked_set_count - 1):
                  chunk_index_stt = subseg_array_idx[:, 0][
                      idx * step_count
                  ]
                  chunk_index_end = subseg_array_idx[:, 1][
                      (idx + 1) * step_count
                  ]
                  offset_sec = subseg_array[chunk_index_stt, 0]
                  end_sec = subseg_array[chunk_index_end, 1]
                  dur = round(end_sec - offset_sec, deci)
                  meta = input_manifest_dict[uniq_id]
                  meta["offset"] = offset_sec
                  meta["duration"] = dur
                  json.dump(meta, output_manifest_fp)
                  output_manifest_fp.write("\n")
  
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 7 for calling a global function with example usage: write_truncated_subsegments(input_manifest_dict, _subsegment_dict, output_manifest_path, step_count, deci) without return types