code: def test_filter_auto():
      """Test filter auto parameters."""
      # test that our overlap-add filtering doesn't introduce strange
      # artifacts (from mne_analyze mailing list 2015/06/25)
      N = 300
      sfreq = 100.0
      lp = 10.0
      sine_freq = 1.0
      x = np.ones(N)
      t = np.arange(N) / sfreq
      x += np.sin(2 * np.pi * sine_freq * t)
      x_orig = x.copy()
      for pad in ("reflect_limited", "reflect", "edge"):
          for fir_design in ("firwin2", "firwin"):
              kwargs = dict(fir_design=fir_design, pad=pad)
              x = x_orig.copy()
              x_filt = filter_data(x, sfreq, None, lp, **kwargs)
              assert_array_equal(x, x_orig)
              n_edge = 10
              assert_allclose(
                  x[n_edge:-n_edge], x_filt[n_edge:-n_edge], atol=1e-2
              )
              assert_array_equal(
                  x_filt,
                  filter_data(x, sfreq, None, lp, None, **kwargs),
              )
              assert_array_equal(x, x_orig)
              assert_array_equal(
                  x_filt, filter_data(x, sfreq, None, lp, **kwargs)
              )
              assert_array_equal(x, x_orig)
              assert_array_equal(
                  x_filt,
                  filter_data(x, sfreq, None, lp, copy=False, **kwargs),
              )
              assert_array_equal(x, x_filt)
  
      # degenerate conditions
      pytest.raises(ValueError, filter_data, x, -sfreq, 1, 10)
      pytest.raises(ValueError, filter_data, x, sfreq, 1, sfreq * 0.75)
      with pytest.raises(
          ValueError, match="Data to be filtered must be real"
      ):
          filter_data(x.astype(np.float32), sfreq, None, 10)
      with pytest.raises(
          ValueError, match="Data to be filtered must be real"
      ):
          filter_data([1j], 1000.0, None, 40.0)
      with pytest.raises(TypeError, match="instance of ndarray"):
          filter_data("foo", 1000.0, None, 40.0)
      # gh-10258
      raw = RawArray([[0.0]], create_info(1, 1000.0, "eeg"))
      with pytest.raises(
          TypeError, match=r".*copy\(\)\.filter\(\.\.\.\)` in.*"
      ):
          filter_data(raw, 1000.0, None, 40.0)
      with pytest.raises(
          TypeError, match=r".*copy\(\)\.notch_filter\(\.\.\..*"
      ):
          notch_filter(raw, 1000.0, [60.0])
  
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 15 for calling a global function with example usage: test_filter_auto() without return types