code: def test_resamp_stim_channel():
      """Test resampling of stim channels."""
      # Downsampling
      assert_array_equal(
          _resample_stim_channels([1, 0, 0, 0, 2, 0, 0, 0], 1, 2),
          [[1, 0, 2, 0]],
      )
      assert_array_equal(
          _resample_stim_channels([1, 0, 0, 0, 2, 0, 0, 0], 1, 1.5),
          [[1, 0, 0, 2, 0]],
      )
      assert_array_equal(
          _resample_stim_channels([1, 0, 0, 1, 2, 0, 0, 1], 1, 2),
          [[1, 1, 2, 1]],
      )
  
      # Upsampling
      assert_array_equal(
          _resample_stim_channels([1, 2, 3], 2, 1), [[1, 1, 2, 2, 3, 3]]
      )
      assert_array_equal(
          _resample_stim_channels([1, 2, 3], 2.5, 1),
          [[1, 1, 1, 2, 2, 3, 3, 3]],
      )
  
      # Proper number of samples in stim channel resampling from io/base.py
      data_chunk = np.zeros((1, 315600))
      for new_data_len in (52598, 52599, 52600, 52601, 315599, 315600):
          new_data = _resample_stim_channels(
              data_chunk, new_data_len, data_chunk.shape[1]
          )
          assert new_data.shape[1] == new_data_len
  
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 11 for calling a global function with example usage: test_resamp_stim_channel() without return types