code: def pick_channels(
      ch_names, include, exclude=[], ordered=None, *, verbose=None
  ):
      """Pick channels by names.
  
      Returns the indices of ``ch_names`` in ``include`` but not in ``exclude``.
  
      Parameters
      ----------
      ch_names : list of str
          List of channels.
      include : list of str
          List of channels to include (if empty include all available).
  
          .. note:: This is to be treated as a set. The order of this list
             is not used or maintained in ``sel``.
  
      exclude : list of str
          List of channels to exclude (if empty do not exclude any channel).
          Defaults to [].
      %(ordered)s
      %(verbose)s
  
      Returns
      -------
      sel : array of int
          Indices of good channels.
  
      See Also
      --------
      pick_channels_regexp, pick_types
      """
      if len(np.unique(ch_names)) != len(ch_names):
          raise RuntimeError(
              "ch_names is not a unique list, picking is unsafe"
          )
      _validate_type(ordered, (bool, None), "ordered")
      _check_excludes_includes(include)
      _check_excludes_includes(exclude)
      if not isinstance(include, list):
          include = list(include)
      if len(include) == 0:
          include = list(ch_names)
      if not isinstance(exclude, list):
          exclude = list(exclude)
      sel, missing = list(), list()
      for name in include:
          if name in ch_names:
              if name not in exclude:
                  sel.append(ch_names.index(name))
          else:
              missing.append(name)
      dep_msg = (
          "The default for pick_channels will change from ordered=False to "
          "ordered=True in 1.5"
      )
      if len(missing):
          if ordered is None:
              warn(
                  f"{dep_msg} and this will result in an error because the "
                  f"following channel names are missing:\n{missing}\n"
                  "Either fix your included names or explicitly pass "
                  "ordered=False.",
                  FutureWarning,
              )
          elif ordered:
              raise ValueError(
                  f"Missing channels from ch_names required by include:\n{missing}"
              )
      if not ordered:
          out_sel = np.unique(sel)
          if ordered is None and not np.array_equal(out_sel, sel):
              warn(
                  f"{dep_msg} and this will result in a change of behavior "
                  "because the resulting channel order will not match. Either "
                  "use a channel order that matches your instance or "
                  "pass ordered=False.",
                  FutureWarning,
              )
          sel = out_sel
      return np.array(sel, int)
  
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 3 for calling a global function with example usage: pick_channels(ch_names, include, exclude, ordered) and returns: np