code: def main(
      filelist,
      manifest,
      id,
      out,
      split=False,
      create_segments=False,
      min_count=10,
  ):
      if os.path.exists(out):
          os.remove(out)
      if filelist:
          lines = read_file(filelist=filelist, id=id)
          lines = process_map(get_duration, lines, chunksize=100)
          out_file = os.path.splitext(filelist)[0] + "_manifest.json"
          write_file(out_file, lines, range(len(lines)))
      else:
          lines = read_manifest(manifest)
  
      lines = process_map(get_duration, lines, chunksize=100)
  
      if create_segments:
          print(f"creating and writing segments to {CWD}")
          lines = process_map(
              filter_manifest_line, lines, chunksize=100
          )
          temp = []
          for line in lines:
              temp.extend(line)
          del lines
          lines = temp
  
      speakers = [x["label"] for x in lines]
  
      if min_count:
          speakers, lines = count_and_consider_only(
              speakers, lines, abs(min_count)
          )
  
      write_file(out, lines, range(len(lines)))
      path = os.path.dirname(out)
      if split:
          speakers = [x["label"] for x in lines]
          sss = StratifiedShuffleSplit(
              n_splits=1, test_size=0.1, random_state=42
          )
          for train_idx, test_idx in sss.split(speakers, speakers):
              print(
                  "number of train samples after split: ",
                  len(train_idx),
              )
  
          out = os.path.join(path, "train.json")
          write_file(out, lines, train_idx)
          out = os.path.join(path, "dev.json")
          write_file(out, lines, test_idx)
  
file_path: NeMo/scripts/speaker_tasks/filelist_to_manifest.py
imports: import argparse
  import json
  import os
  import random
  import librosa
  import numpy
  import soundfile
  import sox
  from sklearn.model_selection import StratifiedShuffleSplit
  from tqdm.contrib.concurrent import process_map
  from nemo.collections.asr.parts.utils.manifest_utils import read_manifest
label_desc: Use image node_id 7 for calling a global function with example usage: main(filelist, manifest, id, out, split, create_segments, min_count) without return types