class_docstr: Sort LibriSpeech samples by target length and batch to max token count.
class_docstr_tok: ["Sort","LibriSpeech","samples","by","target","length","and","batch","to","max","token","count","."]
code: def _target_length(self, fileid, fileid_to_target_length):
      if fileid not in fileid_to_target_length:
          speaker_id, chapter_id, _ = fileid.split("-")
  
          file_text = (
              speaker_id + "-" + chapter_id + self.base_dataset._ext_txt
          )
          file_text = os.path.join(
              self.base_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]
  
imports: import os
  from functools import partial
  from typing import List
  import sentencepiece
  import torch
  import torchaudio
  from common import Batch, batch_by_token_count, FunctionalModule, GlobalStatsNormalization, piecewise_linear_log, post_process_hypos, spectrogram_transform, WarmupLR
  from pytorch_lightning import LightningModule
  from torchaudio.models import emformer_rnnt_base, RNNTBeamSearch
label_desc: Use image node_id 2 for calling the CustomDataset obj's underlying member method code with example usage: obj._target_length(fileid, fileid_to_target_length) and returns: fileid_to_target_length