code: def plot_sweep(
      waveform,
      sample_rate,
      title,
      max_sweep_rate=48000,
      offset=DEFAULT_OFFSET,
  ):
      x_ticks = [
          100,
          500,
          1000,
          5000,
          10000,
          20000,
          max_sweep_rate // 2,
      ]
      y_ticks = [1000, 5000, 10000, 20000, sample_rate // 2]
  
      time, freq = _get_freq_ticks(
          max_sweep_rate, offset, sample_rate // 2
      )
      freq_x = [
          f if f in x_ticks and f <= max_sweep_rate // 2 else None
          for f in freq
      ]
      freq_y = [
          f
          for f in freq
          if f in y_ticks and 1000 <= f <= sample_rate // 2
      ]
  
      figure, axis = plt.subplots(1, 1)
      _, _, _, cax = axis.specgram(waveform[0].numpy(), Fs=sample_rate)
      plt.xticks(time, freq_x)
      plt.yticks(freq_y, freq_y)
      axis.set_xlabel("Original Signal Frequency (Hz, log scale)")
      axis.set_ylabel("Waveform Frequency (Hz)")
      axis.xaxis.grid(True, alpha=0.67)
      axis.yaxis.grid(True, alpha=0.67)
      figure.suptitle(f"{title} (sample rate: {sample_rate} Hz)")
      plt.colorbar(cax)
  
imports: import torch
  import torchaudio
  import torchaudio.functional
  import torchaudio.transforms
  import math
  import timeit
  import librosa
  import matplotlib.colors
  import matplotlib.pyplot
  import pandas
  import resampy
  from IPython.display import Audio
label_desc: Use image node_id 5 for calling a global function with example usage: plot_sweep(waveform, sample_rate, title, max_sweep_rate, offset) without return types