class_docstr: Splits wav and midi files for the dataset.
class_docstr_tok: ["Splits","wav","and","midi","files","for","the","dataset","."]
code: def process(self, paths):
      midi_path, wav_path_base = paths
  
      if self._add_wav_glob:
          wav_paths = tf.io.gfile.glob(wav_path_base + "*")
      else:
          wav_paths = [wav_path_base]
  
      if midi_path:
          base_ns = midi_io.midi_file_to_note_sequence(midi_path)
          base_ns.filename = midi_path
      else:
          base_ns = music_pb2.NoteSequence()
  
      for wav_path in wav_paths:
          logging.info("Creating Example %s:%s", midi_path, wav_path)
          wav_data = tf.io.gfile.GFile(wav_path, "rb").read()
  
          ns = copy.deepcopy(base_ns)
  
          # Use base names.
          ns.id = "%s:%s" % (
              wav_path.replace(self._wav_dir, ""),
              midi_path.replace(self._midi_dir, ""),
          )
  
          Metrics.counter("create_example", "read_midi_wav").inc()
  
          example = audio_label_data_utils.create_example(
              ns.id, ns, wav_data
          )
  
          Metrics.counter("create_example", "created_example").inc()
          yield example
  
file_path: magenta/magenta/models/onsets_frames_transcription/onsets_frames_transcription_create_tfrecords.py
imports: import collections
  import copy
  import csv
  import os
  from absl import app
  from absl import flags
  from absl import logging
  import apache_beam
  from apache_beam.metrics import Metrics
  from magenta.models.onsets_frames_transcription import audio_label_data_utils
  from note_seq import midi_io
  from note_seq.protobuf import music_pb2
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the CreateExampleDoFn obj's underlying member method code with example usage: obj.process(paths) without return types