code: def pick_types(
      info,
      meg=False,
      eeg=False,
      stim=False,
      eog=False,
      ecg=False,
      emg=False,
      ref_meg="auto",
      *,
      misc=False,
      resp=False,
      chpi=False,
      exci=False,
      ias=False,
      syst=False,
      seeg=False,
      dipole=False,
      gof=False,
      bio=False,
      ecog=False,
      fnirs=False,
      csd=False,
      dbs=False,
      temperature=False,
      gsr=False,
      eyetrack=False,
      include=(),
      exclude="bads",
      selection=None,
  ):
      """Pick channels by type and names.
  
      Parameters
      ----------
      %(info_not_none)s
      %(pick_types_params)s
  
      Returns
      -------
      sel : array of int
          Indices of good channels.
      """
      # NOTE: Changes to this function's signature should also be changed in
      # PickChannelsMixin
      _validate_type(meg, (bool, str), "meg")
  
      exclude = _check_info_exclude(info, exclude)
      nchan = info["nchan"]
      pick = np.zeros(nchan, dtype=bool)
  
      _check_meg_type(ref_meg, allow_auto=True)
      _check_meg_type(meg)
      if isinstance(ref_meg, str) and ref_meg == "auto":
          ref_meg = (
              "comps" in info
              and info["comps"] is not None
              and len(info["comps"]) > 0
              and meg is not False
          )
  
      for param in (
          eeg,
          stim,
          eog,
          ecg,
          emg,
          misc,
          resp,
          chpi,
          exci,
          ias,
          syst,
          seeg,
          dipole,
          gof,
          bio,
          ecog,
          csd,
          dbs,
          temperature,
          gsr,
      ):
          if not isinstance(param, bool):
              w = (
                  "Parameters for all channel types (with the exception of "
                  '"meg", "ref_meg", "fnirs", and "eyetrack") must be of type '
                  "bool, not {}."
              )
              raise ValueError(w.format(type(param)))
  
      param_dict = dict(
          eeg=eeg,
          stim=stim,
          eog=eog,
          ecg=ecg,
          emg=emg,
          misc=misc,
          resp=resp,
          chpi=chpi,
          exci=exci,
          ias=ias,
          syst=syst,
          seeg=seeg,
          dbs=dbs,
          dipole=dipole,
          gof=gof,
          bio=bio,
          ecog=ecog,
          csd=csd,
          temperature=temperature,
          gsr=gsr,
          eyetrack=eyetrack,
      )
  
      # avoid triage if possible
      if isinstance(meg, bool):
          for key in ("grad", "mag"):
              param_dict[key] = meg
      if isinstance(fnirs, bool):
          for key in _FNIRS_CH_TYPES_SPLIT:
              param_dict[key] = fnirs
      warned = [False]
      for k in range(nchan):
          ch_type = channel_type(info, k)
          try:
              pick[k] = param_dict[ch_type]
          except KeyError:  # not so simple
              assert (
                  ch_type
                  in ("grad", "mag", "ref_meg")
                  + _FNIRS_CH_TYPES_SPLIT
                  + _EYETRACK_CH_TYPES_SPLIT
              )
              if ch_type in ("grad", "mag"):
                  pick[k] = _triage_meg_pick(info["chs"][k], meg)
              elif ch_type == "ref_meg":
                  pick[k] = _triage_meg_pick(info["chs"][k], ref_meg)
              elif ch_type in ("eyegaze", "pupil"):
                  pick[k] = _triage_eyetrack_pick(
                      info["chs"][k], eyetrack
                  )
              else:  # ch_type in ('hbo', 'hbr')
                  pick[k] = _triage_fnirs_pick(
                      info["chs"][k], fnirs, warned
                  )
  
      # restrict channels to selection if provided
      if selection is not None:
          # the selection only restricts these types of channels
          sel_kind = [
              FIFF.FIFFV_MEG_CH,
              FIFF.FIFFV_REF_MEG_CH,
              FIFF.FIFFV_EEG_CH,
          ]
          for k in np.where(pick)[0]:
              if (
                  info["chs"][k]["kind"] in sel_kind
                  and info["ch_names"][k] not in selection
              ):
                  pick[k] = False
  
      myinclude = [info["ch_names"][k] for k in range(nchan) if pick[k]]
      myinclude += include
  
      if len(myinclude) == 0:
          sel = np.array([], int)
      else:
          sel = pick_channels(
              info["ch_names"], myinclude, exclude, ordered=False
          )
  
      return sel
  
imports: import re
  from copy import deepcopy
  import numpy
  from ..utils import _check_option, _ensure_int, _validate_type, fill_doc, logger, verbose, warn
  from .constants import FIFF
label_desc: Use image node_id 10 for calling a global function with example usage: pick_types(info, meg, eeg, stim, eog, ecg, emg, ref_meg) and returns: sel