code: def test_save_voiced_items_if_pt_file_not_exist(
      self, test_data_dir, sup_data_types, output_indices, tmp_path
  ):
      manifest_path = os.path.join(
          test_data_dir, "tts/mini_ljspeech/manifest.json"
      )
      sup_path = tmp_path / "sup_data"
      print(f"sup_path={sup_path}")
      dataset = TTSDataset(
          manifest_filepath=manifest_path,
          sample_rate=22050,
          sup_data_types=sup_data_types,
          sup_data_path=sup_path,
          text_tokenizer=EnglishPhonemesTokenizer(
              punct=True,
              stresses=True,
              chars=True,
              space=" ",
              apostrophe=True,
              pad_with_space=True,
              g2p=EnglishG2p(),
          ),
      )
  
      # load manifest
      audio_filepaths = []
      with open(manifest_path, "r", encoding="utf-8") as fjson:
          for line in fjson:
              audio_filepaths.append(json.loads(line)["audio_filepath"])
      base_data_dir = get_base_dir(audio_filepaths)
  
      dataloader = torch.utils.data.DataLoader(
          dataset=dataset, batch_size=1, collate_fn=dataset._collate_fn
      )
      for batch, audio_filepath in zip(dataloader, audio_filepaths):
          rel_audio_path = (
              Path(audio_filepath)
              .relative_to(base_data_dir)
              .with_suffix("")
          )
          rel_audio_path_as_text_id = str(rel_audio_path).replace(
              "/", "_"
          )
  
          for sup_data_type, output_index in zip(
              sup_data_types, output_indices
          ):
              sup_data = batch[output_index]
              sup_data = sup_data.squeeze(0)
              assert sup_data is not None
              assert torch.equal(
                  sup_data,
                  torch.load(
                      f"{sup_path}/{sup_data_type}/{rel_audio_path_as_text_id}.pt"
                  ),
              )
  
              if sup_data_type == "pitch":
                  pitch_lengths = batch[output_index + 1]
                  pitch_lengths = pitch_lengths.squeeze(0)
                  assert pitch_lengths is not None
  
          # test pitch, voiced_mask, and p_voiced do not have the same values.
          if len(sup_data_types) == 3:
              x = torch.load(
                  f"{sup_path}/{sup_data_types[0]}/{rel_audio_path_as_text_id}.pt"
              )
              y = torch.load(
                  f"{sup_path}/{sup_data_types[1]}/{rel_audio_path_as_text_id}.pt"
              )
              z = torch.load(
                  f"{sup_path}/{sup_data_types[2]}/{rel_audio_path_as_text_id}.pt"
              )
              assert not torch.equal(x, y)
              assert not torch.equal(x, z)
  
file_path: NeMo/tests/collections/tts/test_torch_tts.py
imports: import json
  import os
  from pathlib import Path
  import pytest
  import torch
  from nemo.collections.common.tokenizers.text_to_speech.tts_tokenizers import EnglishPhonemesTokenizer
  from nemo.collections.tts.data.dataset import TTSDataset
  from nemo.collections.tts.g2p.models.en_us_arpabet import EnglishG2p
  from nemo.collections.tts.parts.utils.tts_dataset_utils import get_base_dir
label_desc: Use image node_id 5 for calling the TestTTSDataset obj's underlying member method code with example usage: obj.test_save_voiced_items_if_pt_file_not_exist(test_data_dir, sup_data_types, output_indices, tmp_path) without return types