code: def test_save_and_load_pitch_segments(self, test_data_dir):
      pitch_name = "pitch_test"
      voiced_mask_name = "voiced_mask_test"
      voiced_prob_name = "voiced_prob_test"
      audio_filepath = (
          Path(test_data_dir)
          / "tts"
          / "mini_ljspeech"
          / "wavs"
          / "LJ003-0182.wav"
      )
      manifest_entry = {"audio_filepath": audio_filepath}
  
      offset1 = 1.0
      duration1 = 1.0
      offset2 = 2.5
      duration2 = 1.2
      start1, end1 = self._compute_start_end_frames(
          offset=offset1, duration=duration1
      )
      start2, end2 = self._compute_start_end_frames(
          offset=offset2, duration=duration2
      )
      manifest_entry_segment1 = {
          "audio_filepath": audio_filepath,
          "offset": offset1,
          "duration": duration1,
      }
      manifest_entry_segment2 = {
          "audio_filepath": audio_filepath,
          "offset": offset2,
          "duration": duration2,
      }
  
      pitch_featurizer = PitchFeaturizer(
          pitch_name=pitch_name,
          voiced_mask_name=voiced_mask_name,
          voiced_prob_name=voiced_prob_name,
          hop_length=self.hop_len,
          sample_rate=self.sample_rate,
      )
  
      with self._create_test_dir() as test_dir:
          feature_dir = test_dir / "feature"
          pitch_featurizer.save(
              manifest_entry=manifest_entry,
              audio_dir=test_data_dir,
              feature_dir=feature_dir,
          )
          pitch_dict = pitch_featurizer.load(
              manifest_entry=manifest_entry,
              audio_dir=test_data_dir,
              feature_dir=feature_dir,
          )
          pitch_dict_segment1 = pitch_featurizer.load(
              manifest_entry=manifest_entry_segment1,
              audio_dir=test_data_dir,
              feature_dir=feature_dir,
          )
          pitch_dict_segment2 = pitch_featurizer.load(
              manifest_entry=manifest_entry_segment2,
              audio_dir=test_data_dir,
              feature_dir=feature_dir,
          )
  
      pitch = pitch_dict[pitch_name]
      voiced_mask = pitch_dict[voiced_mask_name]
      voiced_prob = pitch_dict[voiced_prob_name]
  
      pitch_segment1 = pitch_dict_segment1[pitch_name]
      voiced_mask_segment1 = pitch_dict_segment1[voiced_mask_name]
      voiced_prob_segment1 = pitch_dict_segment1[voiced_prob_name]
  
      pitch_segment2 = pitch_dict_segment2[pitch_name]
      voiced_mask_segment2 = pitch_dict_segment2[voiced_mask_name]
      voiced_prob_segment2 = pitch_dict_segment2[voiced_prob_name]
  
      torch.testing.assert_close(pitch_segment1, pitch[start1:end1])
      torch.testing.assert_close(
          voiced_mask_segment1, voiced_mask[start1:end1]
      )
      torch.testing.assert_close(
          voiced_prob_segment1, voiced_prob[start1:end1]
      )
  
      torch.testing.assert_close(pitch_segment2, pitch[start2:end2])
      torch.testing.assert_close(
          voiced_mask_segment2, voiced_mask[start2:end2]
      )
      torch.testing.assert_close(
          voiced_prob_segment2, voiced_prob[start2:end2]
      )
  
imports: import contextlib
  import tempfile
  from pathlib import Path
  import numpy
  import pytest
  import soundfile
  import torch
  from nemo.collections.tts.parts.preprocessing.features import EnergyFeaturizer, MelSpectrogramFeaturizer, PitchFeaturizer
label_desc: Use image node_id 9 for calling the TestTTSFeatures obj's underlying member method code with example usage: obj.test_save_and_load_pitch_segments(test_data_dir) without return types