code: def make_segment(
      file_id, labels, threshold=30, sil=["pau", "br", "sil"]
  ):
      segments = []
      segment = SegInfo()
      for i in range(len(labels)):
          label = labels[i]
          # replace wrong phoneme with correct one
          if (
              "46" in file_id
              and label.label_id == "o"
              and labels[i - 1].label_id == "o"
          ):
              label.label_id = "i"
          # add missing phonemes
          if "64" in file_id and i == 34:
              segment.add(label.start, 8.237, "o")
              segment.add(8.237, 8.411, "t")
              segment.add(8.411, 8.505, "o")
              labels[i + 1].start = 8.505
              continue
          if "60" in file_id and label.label_id == "xx":
              segment.add(label.start, 5.452, "n")
              segment.add(5.452, label.end, "o")
              continue
          if label.label_id in sil:
              if len(segment.segs) > 0:
                  segments.extend(segment.split(threshold=threshold))
                  segment = SegInfo()
              continue
          segment.add(label.start, label.end, label.label_id)
  
      if len(segment.segs) > 0:
          segments.extend(segment.split(threshold=threshold))
  
      segments_w_id = {}
      id = 0
      for seg in segments:
          if len(seg) == 0:
              continue
          segments_w_id[pack_zero(file_id, id)] = seg
          id += 1
      return segments_w_id
  
file_path: espnet/egs2/pjs/svs1/local/prep_segments.py
imports: import argparse
  import math
  import os
  import sys
label_desc: Use image node_id 3 for calling a global function with example usage: make_segment(file_id, labels, threshold, sil) and returns: segments_w_id