code: def validate_outputs(
      self, expected_num_examples, expected_feature_lengths
  ):
      all_examples = self.parse_tfrecord(
          "output.tfrecord-00000-of-00002"
      ) + self.parse_tfrecord("output.tfrecord-00001-of-00002")
  
      self.assertLen(all_examples, expected_num_examples)
      for ex in all_examples:
          self.assertCountEqual(
              expected_feature_lengths, ex.features.feature
          )
  
          for feat, expected_len in expected_feature_lengths.items():
              arr = ex.features.feature[feat].float_list.value
              try:
                  self.assertLen(arr, expected_len)
              except AssertionError as e:
                  raise AssertionError("feature: %s" % feat) from e
              self.assertFalse(any(np.isinf(arr)))
  
imports: import os
  import sys
  from absl import flags
  from absl.testing import absltest
  from absl.testing import parameterized
  from ddsp import spectral_ops
  from ddsp.training.data_preparation import prepare_tfrecord_lib
  import numpy
  import scipy.io.wavfile
  import tensorflow.compat.v2
label_desc: Use image node_id 4 for calling the PrepareTFRecordBeamTest obj's underlying member method code with example usage: obj.validate_outputs(expected_num_examples, expected_feature_lengths) without return types