code: def check_eval_samples(self):
      print(" > Filtering invalid eval samples!!")
      new_samples = []
      for sample in self.samples:
          try:
              tseq, _, wav, _, _, _ = self.load_item(sample)
          except:
              continue
          # Basically, this audio file is nonexistent or too long to be supported by the dataset.
          if (
              wav is None
              or (
                  self.max_wav_len is not None
                  and wav.shape[-1] > self.max_wav_len
              )
              or (
                  self.max_text_len is not None
                  and tseq.shape[0] > self.max_text_len
              )
          ):
              continue
          new_samples.append(sample)
      self.samples = new_samples
      print(" > Total eval samples after filtering:", len(self.samples))
  
file_path: TTS/TTS/tts/layers/xtts/trainer/dataset.py
imports: import os
  import random
  import sys
  import torch
  import torch.nn.functional
  import torch.utils.data
  from TTS.tts.models.xtts import load_audio
label_desc: Use image node_id 2 for calling the XTTSDataset obj's underlying member method code with example usage: obj.check_eval_samples() without return types