code: def run(wave_name, wave_constructor, step):
      """Generate an audio waveform and write it to summaries.
  
      Waves will be generated at frequencies ranging from A4 to A5.
  
      Args:
        wave_name: the name of the wave being generated
        wave_constructor: a function that accepts a float32 frequency (in Hz) at
          which to construct a wave, and returns a tensor of shape
          [1, _samples(), `n`] representing audio data (for some number of
          channels `n`).
        step: number step
      """
      # For the given step, linearly interpolate a frequency between A4 (440 Hz)
      # and A5 (880 Hz) and create its waveform.
      f_min = 440.0
      f_max = 880.0
      t = step / (FLAGS.steps - 1)
      frequency = f_min * (1.0 - t) + f_max * t
      waveform = wave_constructor(frequency)
  
      # Optionally generate a description that will appear in TensorBoard
      # next to the audio. This one includes the source code behind the
      # waveform for context.
      source = "\n".join(
          "    %s" % line.rstrip()
          for line in inspect.getsourcelines(wave_constructor)[0]
      )
      description = "A wave of type `%r`, generated via:\n\n%s" % (
          wave_name,
          source,
      )
  
      # Write the audio waveform summary. The `waveform` is a
      # [num_clips, num_frames, num_channels] shaped tensor.
      tf.summary.audio(
          "waveform",
          waveform,
          FLAGS.sample_rate,
          step=step,
          description=description,
      )
  
file_path: tensorboard/tensorboard/plugins/audio/audio_demo.py
imports: import inspect
  import math
  import os.path
  from absl import app
  from absl import flags
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: run(wave_name, wave_constructor, step) without return types