code: def assert_approx_phase(a, b, atol=1e-2, acceptable_fail_ratio=0.01):
      """Testing approximate phase.
      Tflite phase is approximate, some values will always have a large error
      So makes more sense to count the number that are within tolerance
      """
      count_failed = np.sum(np.abs(a - b) > atol)
      assert (
          count_failed / a.size < acceptable_fail_ratio
      ), "too many inaccuracte phase bins: {} bins out of {} incorrect".format(
          count_failed, a.size
      )
  
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 4 for calling a global function with example usage: assert_approx_phase(a, b, atol, acceptable_fail_ratio) without return types