code: def read_vad(vad_file):
      """
      Read VAD segments from a file.
      """
      vad_dict = defaultdict(list)
      with open(vad_file) as f:
          for line in f:
              if line[0] == "#":
                  continue
              fname, segments = line.replace(", ", ",").split("\t")
  
              channelid = None
              if fname[-9:] in ["/channel1", "/channel2"]:
                  channelid = int(fname[-1])
                  fname = fname[:-9]
  
              segment_list = []
              for segment in segments.split():
                  assert segment[0] == "(" and segment[-1] == ")", (
                      segment,
                      line,
                  )
                  assert len(segment.split(",")) == 2, (segment, line)
                  start, end = segment[1:-1].split(",")
                  start, end = float(start), float(end)
                  segment_list.append((start, end, channelid))
  
              vad_dict[fname].extend(segment_list)
      print(
          f"Read VAD segments of {len(vad_dict)} files from {vad_file}"
      )
      return vad_dict
  
file_path: textlesslib/examples/expresso/dataset/processing/create_short_segments_dataset.py
imports: import os
  from tqdm import tqdm
  import soundfile
  from pathlib import Path
  from time import time
  from collections import defaultdict
label_desc: Use image node_id 3 for calling a global function with example usage: read_vad(vad_file) and returns: vad_dict