code: def test_estimate_ringing():
      """Test our ringing estimation function."""
      # Actual values might differ based on system, so let's be approximate
      for kind in ("ba", "sos"):
          for thresh, lims in (
              (0.1, (30, 60)),  # 47
              (0.01, (300, 600)),  # 475
              (0.001, (3000, 6000)),  # 4758
              (0.0001, (30000, 60000)),
          ):  # 37993
              n_ring = estimate_ringing_samples(
                  butter(3, thresh, output=kind)
              )
              assert (
                  lims[0] <= n_ring <= lims[1]
              ), "%s %s: %s <= %s <= %s" % (
                  kind,
                  thresh,
                  lims[0],
                  n_ring,
                  lims[1],
              )
      with pytest.warns(RuntimeWarning, match="properly estimate"):
          assert estimate_ringing_samples(butter(4, 0.00001)) == 100000
  
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 3 for calling a global function with example usage: test_estimate_ringing() without return types