code: def _find_exclude_idx(ch_names, exclude, include=None):
      """Find indices of all channels to exclude.
  
      If there are several channels called "A" and we want to exclude "A", then
      add (the index of) all "A" channels to the exclusion list.
      """
      if include:  # find other than include channels
          if exclude:
              raise ValueError(
                  "'exclude' must be empty if 'include' is assigned. "
                  f"Got {exclude}."
              )
          if isinstance(include, str):  # regex for channel names
              indices_include = []
              for idx, ch in enumerate(ch_names):
                  if re.match(include, ch):
                      indices_include.append(idx)
              indices = np.setdiff1d(
                  np.arange(len(ch_names)), indices_include
              )
              return indices
          # list of channel names
          return [
              idx
              for idx, ch in enumerate(ch_names)
              if ch not in include
          ]
  
      if isinstance(exclude, str):  # regex for channel names
          indices = []
          for idx, ch in enumerate(ch_names):
              if re.match(exclude, ch):
                  indices.append(idx)
          return indices
      # list of channel names
      return [idx for idx, ch in enumerate(ch_names) if ch in exclude]
  
imports: import os
  import re
  from datetime import datetime, timedelta, timezone
  import numpy
  from scipy.interpolate import interp1d
  from ..._fiff.constants import FIFF
  from ..._fiff.meas_info import _empty_info, _unique_channel_names
  from ..._fiff.utils import _blk_read_lims, _mult_cal_one
  from ...annotations import Annotations
  from ...filter import resample
  from ...utils import _validate_type, fill_doc, logger, verbose, warn
  from ..base import BaseRaw, _get_scaling
label_desc: Use image node_id 12 for calling a global function with example usage: _find_exclude_idx(ch_names, exclude, include) and returns: unknown, unknown, indices, indices