code: def _CreateExamplesAndExpectedInputs(
      self, truncated_length, lengths, expected_num_inputs
  ):
      hparams = copy.deepcopy(configs.DEFAULT_HPARAMS)
      examples = []
      expected_inputs = []
  
      for i, length in enumerate(lengths):
          wav_samples = np.zeros(
              (
                  int(
                      (length / data.hparams_frames_per_second(hparams))
                      * hparams.sample_rate
                  ),
                  1,
              ),
              np.float32,
          )
          wav_data = audio_io.samples_to_wav_data(
              wav_samples, hparams.sample_rate
          )
  
          num_frames = data.wav_to_num_frames(
              wav_data,
              frames_per_second=data.hparams_frames_per_second(hparams),
          )
  
          seq = self._SyntheticSequence(
              num_frames / data.hparams_frames_per_second(hparams),
              i + constants.MIN_MIDI_PITCH,
          )
  
          examples.append(self._FillExample(seq, wav_data, "ex%d" % i))
          expected_inputs += self._ExampleToInputs(
              examples[-1], truncated_length
          )
      self.assertEqual(expected_num_inputs, len(expected_inputs))
      return examples, expected_inputs
  
imports: import copy
  import tempfile
  import time
  from magenta.models.onsets_frames_transcription import configs
  from magenta.models.onsets_frames_transcription import constants
  from magenta.models.onsets_frames_transcription import data
  from note_seq import audio_io
  from note_seq import sequences_lib
  from note_seq import testing_lib
  from note_seq.protobuf import music_pb2
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 6 for calling the DataTest obj's underlying member method code with example usage: obj._CreateExamplesAndExpectedInputs(truncated_length, lengths, expected_num_inputs) and returns: examples,  expected_inputs