code: def get_sample_lengths(librispeech_dataset):
      fileid_to_target_length = {}
  
      def _target_length(fileid):
          if fileid not in fileid_to_target_length:
              speaker_id, chapter_id, _ = fileid.split("-")
  
              file_text = (
                  speaker_id
                  + "-"
                  + chapter_id
                  + librispeech_dataset._ext_txt
              )
              file_text = os.path.join(
                  librispeech_dataset._path,
                  speaker_id,
                  chapter_id,
                  file_text,
              )
  
              with open(file_text) as ft:
                  for line in ft:
                      fileid_text, transcript = line.strip().split(
                          " ", 1
                      )
                      fileid_to_target_length[fileid_text] = len(
                          transcript
                      )
  
          return fileid_to_target_length[fileid]
  
      return [
          _target_length(fileid)
          for fileid in librispeech_dataset._walker
      ]
  
imports: import os
  import random
  import torch
  import torchaudio
  from pytorch_lightning import LightningDataModule
label_desc: Use image node_id 2 for calling a global function with example usage: get_sample_lengths(librispeech_dataset) and returns: unknown, fileid_to_target_length