code: def load_midi(args):
      # Note(Yuning): note duration from '.midi' for Opencpop cannot be used here.
      # We only extract tempo from '.midi'.
      midis = {}
      for i in range(2001, 2101):
          midi_path = os.path.join(
              args.src_data, "raw_data", "midis", "{}.midi".format(i)
          )
          midi_obj = miditoolkit.midi.parser.MidiFile(midi_path)
          tempos = midi_obj.tempo_changes
          tempos.sort(key=lambda x: (x.time, x.tempo))
          assert len(tempos) == 1
          tempo = int(tempos[0].tempo + 0.5)
          midis[i] = tempo
      return midis
  
file_path: espnet/egs2/opencpop/svs1/local/data_prep.py
imports: import argparse
  import os
  import shutil
  import librosa
  import miditoolkit
  import numpy
  from espnet2.fileio.score_scp import SingingScoreWriter
label_desc: Use image node_id 3 for calling a global function with example usage: load_midi(args) and returns: midis