code: def test_iir_phase():
      """Test IIR filter phase."""
      sig, sfreq, ind_one = np.zeros(101), 10, 50
      sig[ind_one] = 1
      iir_params = dict(ftype="butter", order=2, output="sos")
  
      # forward IIR
      sig_f = filter_data(
          sig,
          sfreq,
          0.6,
          None,
          method="iir",
          phase="forward",
          iir_params=iir_params,
      )
      # test if output is zero before peak
      assert_allclose(sig_f[:ind_one], np.zeros(ind_one))
      # test if power is lower after filtering
      assert np.linalg.norm(sig) > np.linalg.norm(sig_f)
  
      # forward-backward IIR
      sig_fb = filter_data(
          sig,
          sfreq,
          0.6,
          None,
          method="iir",
          phase="zero",
          iir_params=iir_params,
      )
      # test if filtered signal is symmetric
      assert_allclose(sig_fb, sig_fb[::-1], rtol=1e-5, atol=1e-6)
      # test if peak is not shifted
      assert np.argmax(sig_fb) == ind_one
      # test if power is lower after bilateral filtering
      assert np.linalg.norm(sig_f) > np.linalg.norm(sig_fb)
  
imports: import numpy
  import pytest
  from numpy.fft import fft, fftfreq
  from numpy.testing import assert_allclose, assert_almost_equal, assert_array_almost_equal, assert_array_equal, assert_array_less
  from scipy.signal import butter, freqz, sosfreqz
  from scipy.signal import resample
  from mne import Epochs, create_info
  from mne._fiff.pick import _DATA_CH_TYPES_SPLIT
  from mne.filter import _length_factors, _overlap_add_filter, _resample_stim_channels, _smart_pad, construct_iir_filter, create_filter, design_mne_c_filter, detrend, estimate_ringing_samples, filter_data, notch_filter, resample
  from mne.io import RawArray, read_raw_fif
  from mne.utils import catch_logging, requires_mne, run_subprocess, sum_squared
label_desc: Use image node_id 6 for calling a global function with example usage: test_iir_phase() without return types