code: def prepare_seg_data(
      config, audio_paths, codes, durs, speakers, path_to_f0
  ):
      ratio = config.code_hop_size / (
          config.sampling_rate * F0_FRAME_SPACE
      )
      seg_f0s = align_f0(path_to_f0, audio_paths, durs, ratio)
      data = {
          "codes": codes,
          "duration": durs,
          "f0": seg_f0s,
          "speaker": speakers,
          "path": audio_paths,
      }
      return data
  
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 4 for calling a global function with example usage: prepare_seg_data(config, audio_paths, codes, durs, speakers, path_to_f0) and returns: data