code: def thumbnailWrapper(inputFile, thumbnailWrapperSize):
      st_window = 0.5
      st_step = 0.5
      if not os.path.isfile(inputFile):
          raise Exception("Input audio file not found!")
  
      [fs, x] = audioBasicIO.read_audio_file(inputFile)
      if fs == -1:  # could not read file
          return
  
      [A1, A2, B1, B2, Smatrix] = aS.music_thumbnailing(
          x, fs, st_window, st_step, thumbnailWrapperSize
      )
  
      # write thumbnailWrappers to WAV files:
      if inputFile.endswith(".wav"):
          thumbnailWrapperFileName1 = inputFile.replace(
              ".wav", "_thumb1.wav"
          )
          thumbnailWrapperFileName2 = inputFile.replace(
              ".wav", "_thumb2.wav"
          )
      if inputFile.endswith(".mp3"):
          thumbnailWrapperFileName1 = inputFile.replace(
              ".mp3", "_thumb1.mp3"
          )
          thumbnailWrapperFileName2 = inputFile.replace(
              ".mp3", "_thumb2.mp3"
          )
      wavfile.write(
          thumbnailWrapperFileName1, fs, x[int(fs * A1) : int(fs * A2)]
      )
      wavfile.write(
          thumbnailWrapperFileName2, fs, x[int(fs * B1) : int(fs * B2)]
      )
      print(
          "1st thumbnailWrapper (stored in file {0:s}): {1:4.1f}sec"
          " -- {2:4.1f}sec".format(thumbnailWrapperFileName1, A1, A2)
      )
      print(
          "2nd thumbnailWrapper (stored in file {0:s}): {1:4.1f}sec"
          " -- {2:4.1f}sec".format(thumbnailWrapperFileName2, B1, B2)
      )
  
      # Plot self-similarity matrix:
      fig = plt.figure()
      ax = fig.add_subplot(111, aspect="auto")
      plt.imshow(Smatrix)
      # Plot best-similarity diagonal:
      Xcenter = (A1 / st_step + A2 / st_step) / 2.0
      Ycenter = (B1 / st_step + B2 / st_step) / 2.0
  
      e1 = matplotlib.patches.Ellipse(
          (Ycenter, Xcenter),
          thumbnailWrapperSize * 1.4,
          3,
          angle=45,
          linewidth=3,
          fill=False,
      )
      ax.add_patch(e1)
  
      plt.plot(
          [B1 / st_step, Smatrix.shape[0]],
          [A1 / st_step, A1 / st_step],
          color="k",
          linestyle="--",
          linewidth=2,
      )
      plt.plot(
          [B2 / st_step, Smatrix.shape[0]],
          [A2 / st_step, A2 / st_step],
          color="k",
          linestyle="--",
          linewidth=2,
      )
      plt.plot(
          [B1 / st_step, B1 / st_step],
          [A1 / st_step, Smatrix.shape[0]],
          color="k",
          linestyle="--",
          linewidth=2,
      )
      plt.plot(
          [B2 / st_step, B2 / st_step],
          [A2 / st_step, Smatrix.shape[0]],
          color="k",
          linestyle="--",
          linewidth=2,
      )
  
      plt.xlim([0, Smatrix.shape[0]])
      plt.ylim([Smatrix.shape[1], 0])
  
      ax.yaxis.set_label_position("right")
      ax.yaxis.tick_right()
  
      plt.xlabel("frame no")
      plt.ylabel("frame no")
      plt.title("Self-similarity matrix")
  
      plt.show()
  
imports: from __future__ import print_function
  import argparse
  import os
  import numpy
  import glob
  import matplotlib.pyplot
  import ShortTermFeatures
  import MidTermFeatures
  import audioTrainTest
  import audioSegmentation
  import audioVisualization
  import audioBasicIO
  import scipy.io.wavfile
  import matplotlib.patches
label_desc: Use image node_id 22 for calling a global function with example usage: thumbnailWrapper(inputFile, thumbnailWrapperSize) without return types