code: def get_spectrogram(audio, rotate=False, size=1024):
      """Compute logmag spectrogram."""
      mag = ddsp.spectral_ops.compute_logmag(
          tf_float32(audio), size=size
      )
      if rotate:
          mag = np.rot90(mag)
      return mag
  
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 3 for calling a global function with example usage: get_spectrogram(audio, rotate, size) and returns: mag