code: def _midiae_ld_helper(
      ld_input, ld_rec, curve, db_key, i, step, label, tag
  ):
      """Helper function to plot loudness info with MIDI AE."""
      fig = plt.figure(figsize=(6.0, 4.0))
  
      plt.plot(ld_input, linewidth=1.5, label="input ld")
      plt.plot(ld_rec, "g", linewidth=1.25, label="rec ld")
      plt.step(curve, "r", linewidth=0.75, label=label)
  
      plt.gca().yaxis.set_major_locator(MaxNLocator(integer=True))
      plt.legend()
      fig_summary(f"{tag}/{db_key}_{i + 1}", fig, step)
  
imports: import io
  import ddsp
  from ddsp.core import tf_float32
  from ddsp.training.plotting import pianoroll_plot_setup
  import matplotlib.patches
  import matplotlib.pyplot
  from matplotlib.ticker import MaxNLocator
  import note_seq
  from note_seq import sequences_lib
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 12 for calling a global function with example usage: _midiae_ld_helper(ld_input, ld_rec, curve, db_key, i, step, label, tag) without return types