code: def _picks_by_type_old(
      info, meg_combined=False, ref_meg=False, exclude="bads"
  ):
      """Use the old, slower _picks_by_type code."""
      picks_list = []
      has = [_contains_ch_type(info, k) for k in _DATA_CH_TYPES_SPLIT]
      has = dict(zip(_DATA_CH_TYPES_SPLIT, has))
      if has["mag"] and (meg_combined is not True or not has["grad"]):
          picks_list.append(
              (
                  "mag",
                  pick_types(
                      info,
                      meg="mag",
                      eeg=False,
                      stim=False,
                      ref_meg=ref_meg,
                      exclude=exclude,
                  ),
              )
          )
      if has["grad"] and (meg_combined is not True or not has["mag"]):
          picks_list.append(
              (
                  "grad",
                  pick_types(
                      info,
                      meg="grad",
                      eeg=False,
                      stim=False,
                      ref_meg=ref_meg,
                      exclude=exclude,
                  ),
              )
          )
      if has["mag"] and has["grad"] and meg_combined is True:
          picks_list.append(
              (
                  "meg",
                  pick_types(
                      info,
                      meg=True,
                      eeg=False,
                      stim=False,
                      ref_meg=ref_meg,
                      exclude=exclude,
                  ),
              )
          )
      for ch_type in _DATA_CH_TYPES_SPLIT:
          if ch_type in ["grad", "mag"]:  # exclude just MEG channels
              continue
          if has[ch_type]:
              picks_list.append(
                  (
                      ch_type,
                      pick_types(
                          info,
                          meg=False,
                          stim=False,
                          ref_meg=ref_meg,
                          exclude=exclude,
                          **{ch_type: True},
                      ),
                  )
              )
      return picks_list
  
imports: from copy import deepcopy
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from mne import Epochs, channel_indices_by_type, channel_type, create_info, make_ad_hoc_cov, pick_channels, pick_channels_cov, pick_channels_regexp, pick_info, pick_types, pick_types_forward, read_forward_solution, rename_channels
  from mne._fiff.constants import FIFF
  from mne._fiff.pick import _DATA_CH_TYPES_SPLIT, _contains_ch_type, _picks_by_type, _picks_to_idx, get_channel_type_constants
  from mne.channels import make_standard_montage
  from mne.datasets import testing
  from mne.io import RawArray, read_info, read_raw_bti, read_raw_fif, read_raw_kit
  from mne.preprocessing import compute_current_source_density
  from mne.utils import assert_object_equal, catch_logging
label_desc: Use image node_id 1 for calling a global function with example usage: _picks_by_type_old(info, meg_combined, ref_meg, exclude) and returns: picks_list