code: def get_subsegments(merged_segs, max_subseg_dur=3.0, overlap=1.5):
      """Divides bigger segments into smaller sub-segments"""
  
      shift = max_subseg_dur - overlap
      subsegments = []
  
      # These rows are in RTTM format
      for row in merged_segs:
          seg_dur = float(row[4])
          rec_id = row[1]
  
          if seg_dur > max_subseg_dur:
              num_subsegs = int(seg_dur / shift)
              # Taking 0.01 sec as small step
              seg_start = float(row[3])
              seg_end = seg_start + seg_dur
  
              # Now divide this segment (new_row) in smaller subsegments
              for i in range(num_subsegs):
                  subseg_start = seg_start + i * shift
                  subseg_end = min(
                      subseg_start + max_subseg_dur - 0.01, seg_end
                  )
                  subseg_dur = subseg_end - subseg_start
  
                  new_row = [
                      "SPEAKER",
                      rec_id,
                      "0",
                      str(round(float(subseg_start), 4)),
                      str(round(float(subseg_dur), 4)),
                      "<NA>",
                      "<NA>",
                      row[7],
                      "<NA>",
                      "<NA>",
                  ]
  
                  subsegments.append(new_row)
  
                  # Break if exceeding the boundary
                  if subseg_end >= seg_end:
                      break
          else:
              subsegments.append(row)
  
      return subsegments
  
file_path: speechbrain/recipes/AMI/ami_prepare.py
imports: import os
  import logging
  import xml.etree.ElementTree
  import glob
  import json
  from ami_splits import get_AMI_split
  from speechbrain.dataio.dataio import load_pkl, save_pkl
label_desc: Use image node_id 6 for calling a global function with example usage: get_subsegments(merged_segs, max_subseg_dur, overlap) and returns: subsegments