code: def main(meta_path, f0_dir, splits, nshards_list):
      speaker_to_stat = defaultdict(F0Stat)
      if len(nshards_list) == 1:
          nshards_list = nshards_list * len(splits)
      else:
          assert len(nshards_list) == len(splits)
  
      for split, nshards in zip(splits, nshards_list):
          config, audio_paths, codes, durs, speakers = load_meta(
              meta_path, split
          )
          path_to_f0 = load_f0(f"{f0_dir}/{split}", nshards)
  
          # segment-level data
          data = prepare_seg_data(
              config, audio_paths, codes, durs, speakers, path_to_f0
          )
          dump_seg_data(data, config.manifests[split])
  
          # speaker f0
          for audio_path, speaker in tqdm(zip(audio_paths, speakers)):
              f0 = path_to_f0[audio_path]
              speaker_to_stat[speaker].update(f0)
          dump_speaker_f0_stat(speaker_to_stat, config.manifests[split])
  
file_path: fairseq/examples/textless_nlp/pgslm/prepare_dataset.py
imports: from multiprocessing import Pool
  import os
  from collections import defaultdict
  from itertools import starmap
  import torch
  from npy_append_array import NpyAppendArray
  from tqdm import tqdm
  from data_utils import dump_speaker_f0_stat, F0Stat, load_f0
  from fairseq.data.codedataset import ExpressiveCodeDataConfig, parse_manifest, F0_FRAME_SPACE, align_f0_to_durations
  from fairseq.tasks.speech_ulm_task import UnitDictionary
label_desc: Use image node_id 6 for calling a global function with example usage: main(meta_path, f0_dir, splits, nshards_list) without return types