code: def test_filter_picks():
      """Test filter picking."""
      data = np.random.RandomState(0).randn(3, 1000)
      fs = 1000.0
      kwargs = dict(l_freq=None, h_freq=40.0)
      filt = filter_data(data, fs, **kwargs)
      # don't include seeg, dbs or stim in this list because they are in the one
      # below to ensure default cases are treated properly
      for kind in ("eeg", "grad", "emg", "misc", "dbs"):
          for picks in (None, [-2], kind, "k"):
              # With always at least one data channel
              info = create_info(
                  ["s", "k", "t"], fs, ["seeg", kind, "stim"]
              )
              raw = RawArray(data.copy(), info)
              raw.filter(picks=picks, **kwargs)
              if picks is None:
                  if kind in _DATA_CH_TYPES_SPLIT:  # should be included
                      want = np.concatenate((filt[:2], data[2:]))
                  else:  # shouldn't
                      want = np.concatenate((filt[:1], data[1:]))
              else:  # just the kind of interest ([-2], kind, 'j' should be eq.)
                  want = np.concatenate((data[:1], filt[1:2], data[2:]))
              assert_allclose(raw.get_data(), want)
  
              # Now with sometimes no data channels
              info = create_info(["k", "t"], fs, [kind, "stim"])
              raw = RawArray(data[1:].copy(), info.copy())
              if picks is None and kind not in _DATA_CH_TYPES_SPLIT:
                  with pytest.raises(
                      ValueError, match="yielded no channels"
                  ):
                      raw.filter(picks=picks, **kwargs)
              else:
                  raw.filter(picks=picks, **kwargs)
                  want = want[1:]
                  assert_allclose(raw.get_data(), want)
  
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 21 for calling a global function with example usage: test_filter_picks() without return types