code: def _midiae_f0_helper(q_pitch, f0_midi, curve, i, step, label, tag):
      """Helper function to plot F0 info with MIDI AE."""
      min_, max_ = _get_reasonable_f0_min_max(f0_midi)
      plt.close("all")
      fig, ax, sp = pianoroll_plot_setup(figsize=(6.0, 4.0))
      sp.set_ylabel("MIDI Note Value")
  
      ax.step(q_pitch, "r", linewidth=1.0, label="q_pitch")
      ax.plot(f0_midi, "dodgerblue", linewidth=1.5, label="input f0")
      ax.plot(curve, "darkgreen", linewidth=1.25, label=label)
  
      ax.set_ylim(min_, max_)
      ax.yaxis.set_major_locator(MaxNLocator(integer=True))
      ax.legend()
      fig_summary(f"{tag}/ex_{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 10 for calling a global function with example usage: _midiae_f0_helper(q_pitch, f0_midi, curve, i, step, label, tag) without return types