code: def test_perfectly_reconstructing_stft_istft(
      waveform_data_format, stft_data_format, hop_ratio
  ):
      n_ch = 1
      src_mono, batch_src, input_shape = get_audio(
          data_format=waveform_data_format, n_ch=n_ch
      )
      time_axis = (
          1 if waveform_data_format == "channels_first" else 0
      )  # non-batch!
      len_src = input_shape[time_axis]
  
      n_fft = 2048
      hop_length = int(2048 * hop_ratio)
      n_added_frames = int(1 / hop_ratio) - 1
  
      stft, istft = get_perfectly_reconstructing_stft_istft(
          stft_input_shape=input_shape,
          n_fft=n_fft,
          hop_length=hop_length,
          waveform_data_format=waveform_data_format,
          stft_data_format=stft_data_format,
      )
      # Test - [STFT -> ISTFT]
      model = tf.keras.models.Sequential([stft, istft])
  
      recon_waveform = model(batch_src)
  
      # trim off the pad_begin part
      len_pad_begin = n_fft - hop_length
      if waveform_data_format == "channels_first":
          recon_waveform = recon_waveform[
              :, :, len_pad_begin : len_pad_begin + len_src
          ]
      else:
          recon_waveform = recon_waveform[
              :, len_pad_begin : len_pad_begin + len_src, :
          ]
  
      np.testing.assert_allclose(batch_src, recon_waveform, atol=1e-5)
  
      # Test - [ISTFT -> STFT]
      S = librosa.stft(
          src_mono, n_fft=n_fft, hop_length=hop_length
      ).T.astype(
          np.complex64
      )  # (time, freq)
  
      ch_axis = (
          1 if stft_data_format == "channels_first" else 3
      )  # batch shape
      S = np.expand_dims(S, (0, ch_axis))
      model = tf.keras.models.Sequential([istft, stft])
      recon_S = model(S)
  
      # trim off the frames coming from zero-pad result
      n = n_added_frames
      n_added_frames += n
      if stft_data_format == "channels_first":
          if n != 0:
              S = S[:, :, n:-n, :]
          recon_S = recon_S[:, :, n_added_frames:-n_added_frames, :]
      else:
          if n != 0:
              S = S[:, n:-n, :, :]
          recon_S = recon_S[:, n_added_frames:-n_added_frames, :, :]
  
      np.testing.assert_equal(S.shape, recon_S.shape)
      allclose_complex_numbers(S, recon_S)
  
imports: import pytest
  import numpy
  import tensorflow
  import tensorflow.keras
  import librosa
  from kapre import STFT, Magnitude, Phase, Delta, InverseSTFT, ApplyFilterbank, ConcatenateFrequencyMap, STFTTflite, MagnitudeTflite, PhaseTflite
  from kapre.composed import get_melspectrogram_layer, get_log_frequency_spectrogram_layer, get_stft_mag_phase, get_perfectly_reconstructing_stft_istft, get_stft_magnitude_layer, get_frequency_aware_conv2d
  from utils import get_audio, save_load_compare, predict_using_tflite
label_desc: Use image node_id 14 for calling a global function with example usage: test_perfectly_reconstructing_stft_istft(waveform_data_format, stft_data_format, hop_ratio) without return types