code: def segments_manifest_to_subsegments_manifest(
      segments_manifest_file: str,
      subsegments_manifest_file: str = None,
      window: float = 1.5,
      shift: float = 0.75,
      min_subsegment_duration: float = 0.05,
      include_uniq_id: bool = False,
  ):
      """
      Generate subsegments manifest from segments manifest file
      Args:
          segments_manifest file (str): path to segments manifest file, typically from VAD output
          subsegments_manifest_file (str): path to output subsegments manifest file (default (None) : writes to current working directory)
          window (float): window length for segments to subsegments length
          shift (float): hop length for subsegments shift
          min_subsegments_duration (float): exclude subsegments smaller than this duration value
  
      Returns:
          returns path to subsegment manifest file
      """
      if subsegments_manifest_file is None:
          pwd = os.getcwd()
          subsegments_manifest_file = os.path.join(
              pwd, "subsegments.json"
          )
  
      with open(segments_manifest_file, "r") as segments_manifest, open(
          subsegments_manifest_file, "w"
      ) as subsegments_manifest:
          segments = segments_manifest.readlines()
          for segment in segments:
              segment = segment.strip()
              dic = json.loads(segment)
              audio, offset, duration, label = (
                  dic["audio_filepath"],
                  dic["offset"],
                  dic["duration"],
                  dic["label"],
              )
              subsegments = get_subsegments(
                  offset=offset,
                  window=window,
                  shift=shift,
                  duration=duration,
              )
              if include_uniq_id and "uniq_id" in dic:
                  uniq_id = dic["uniq_id"]
              else:
                  uniq_id = None
              for subsegment in subsegments:
                  start, dur = subsegment
                  if dur > min_subsegment_duration:
                      meta = {
                          "audio_filepath": audio,
                          "offset": start,
                          "duration": dur,
                          "label": label,
                          "uniq_id": uniq_id,
                      }
  
                      json.dump(meta, subsegments_manifest)
                      subsegments_manifest.write("\n")
  
      return subsegments_manifest_file
  
imports: import gc
  import json
  import math
  import os
  import shutil
  from copy import deepcopy
  from typing import Dict, List, Tuple, Union
  import numpy
  import omegaconf
  import soundfile
  import torch
  from pyannote.core import Annotation, Segment
  from tqdm import tqdm
  from nemo.collections.asr.data.audio_to_label import repeat_signal
  from nemo.collections.asr.parts.utils.longform_clustering import LongFormSpeakerClustering
  from nemo.collections.asr.parts.utils.offline_clustering import SpeakerClustering, get_argmin_mat, split_input_data
  from nemo.utils import logging
label_desc: Use image node_id 31 for calling a global function with example usage: segments_manifest_to_subsegments_manifest(segments_manifest_file, subsegments_manifest_file, window, shift, min_subsegment_duration, include_uniq_id) and returns: subsegments_manifest_file