code: def align_f0(path_to_f0, audio_paths, durs, ratio, mp=False):
      chunk_size = 2000
      num_procs = 40
      iterable = (
          (path_to_f0[p], d, ratio) for p, d in zip(audio_paths, durs)
      )
  
      seg_f0s = []
      if mp:
          with Pool(num_procs) as pool:
              iterator = tqdm(
                  pool.istarmap(_align_f0, iterable, chunk_size),
                  desc="align f0",
                  total=len(durs),
              )
              for seg_f0 in iterator:
                  seg_f0s.append(torch.from_numpy(seg_f0).float())
      else:
          iterator = tqdm(
              starmap(_align_f0, iterable),
              desc="align f0",
              total=len(durs),
          )
          for seg_f0 in iterator:
              seg_f0s.append(torch.from_numpy(seg_f0).float())
  
      return seg_f0s
  
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 3 for calling a global function with example usage: align_f0(path_to_f0, audio_paths, durs, ratio, mp) and returns: seg_f0s