code: def pick_types_forward(
      orig,
      meg=False,
      eeg=False,
      ref_meg=True,
      seeg=False,
      ecog=False,
      dbs=False,
      include=[],
      exclude=[],
  ):
      """Pick by channel type and names from a forward operator.
  
      Parameters
      ----------
      orig : dict
          A forward solution.
      meg : bool | str
          If True include MEG channels. If string it can be 'mag', 'grad',
          'planar1' or 'planar2' to select only magnetometers, all gradiometers,
          or a specific type of gradiometer.
      eeg : bool
          If True include EEG channels.
      ref_meg : bool
          If True include CTF / 4D reference channels.
      seeg : bool
          If True include stereotactic EEG channels.
      ecog : bool
          If True include electrocorticography channels.
      dbs : bool
          If True include deep brain stimulation channels.
      include : list of str
          List of additional channels to include. If empty do not include any.
      exclude : list of str | str
          List of channels to exclude. If empty do not exclude any (default).
          If 'bads', exclude channels in orig['info']['bads'].
  
      Returns
      -------
      res : dict
          Forward solution restricted to selected channel types.
      """
      info = orig["info"]
      sel = pick_types(
          info,
          meg,
          eeg,
          ref_meg=ref_meg,
          seeg=seeg,
          ecog=ecog,
          dbs=dbs,
          include=include,
          exclude=exclude,
      )
      if len(sel) == 0:
          raise ValueError("No valid channels found")
      include_ch_names = [info["ch_names"][k] for k in sel]
  
      return pick_channels_forward(orig, include_ch_names)
  
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 14 for calling a global function with example usage: pick_types_forward(orig, meg, eeg, ref_meg, seeg, ecog, dbs, include, exclude) and returns: pick_channels_forward