code: def _get_lengths_librispeech(
      files: List[str], path: str, ext_audio: str
  ) -> List[int]:
      lengths = []
      for file_path in files:
          speaker_id, chapter_id, utterance_id = file_path.split("-")
          fileid_audio = (
              speaker_id + "-" + chapter_id + "-" + utterance_id
          )
          file_audio = fileid_audio + ext_audio
          file_audio = os.path.join(
              path, speaker_id, chapter_id, file_audio
          )
          length = torchaudio.info(file_audio).num_frames
          lengths.append(length)
      return lengths
  
imports: import math
  import os
  import sys
  from pathlib import Path
  from typing import Dict, Iterator, List, Optional, Tuple, Union
  import numpy
  import torch
  import torch.distributed
  import torchaudio
  from torch import Tensor
  from torch.utils.data import BatchSampler, Dataset, DistributedSampler
  from utils import _get_label2id
label_desc: Use image node_id 3 for calling a global function with example usage: _get_lengths_librispeech(files, path, ext_audio) and returns: lengths