code: def test_mag_phase(data_format):
      n_ch = 1
      n_fft, hop_length, win_length = 512, 256, 512
  
      src_mono, batch_src, input_shape = get_audio(
          data_format=data_format, n_ch=n_ch
      )
  
      mag_phase_layer = get_stft_mag_phase(
          input_shape=input_shape,
          n_fft=n_fft,
          win_length=win_length,
          hop_length=hop_length,
          input_data_format=data_format,
          output_data_format=data_format,
      )
      model = tensorflow.keras.models.Sequential()
      model.add(mag_phase_layer)
      mag_phase_kapre = model(batch_src)[0]  # a 2d image shape
  
      ch_axis = 0 if data_format == "channels_first" else 2  # non-batch
      mag_phase_ref = np.stack(
          librosa.magphase(
              librosa.stft(
                  src_mono,
                  n_fft=n_fft,
                  hop_length=hop_length,
                  win_length=win_length,
                  center=False,
              ).T
          ),
          axis=ch_axis,
      )
      np.testing.assert_equal(
          mag_phase_kapre.shape, mag_phase_ref.shape
      )
      # magnitude test
      np.testing.assert_allclose(
          np.take(
              mag_phase_kapre,
              [
                  0,
              ],
              axis=ch_axis,
          ),
          np.take(
              mag_phase_ref,
              [
                  0,
              ],
              axis=ch_axis,
          ),
          atol=2e-4,
      )
  
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 13 for calling a global function with example usage: test_mag_phase(data_format) without return types