code: def _check_excludes_includes(chs, info=None, allow_bads=False):
      """Ensure that inputs to exclude/include are list-like or "bads".
  
      Parameters
      ----------
      chs : any input, should be list, tuple, set, str
          The channels passed to include or exclude.
      allow_bads : bool
          Allow the user to supply "bads" as a string for auto exclusion.
  
      Returns
      -------
      chs : list
          Channels to be excluded/excluded. If allow_bads, and chs=="bads",
          this will be the bad channels found in 'info'.
      """
      from .meas_info import Info
  
      if not isinstance(chs, (list, tuple, set, np.ndarray)):
          if allow_bads is True:
              if not isinstance(info, Info):
                  raise ValueError(
                      "Supply an info object if allow_bads is true"
                  )
              elif chs != "bads":
                  raise ValueError(
                      'If chs is a string, it must be "bads"'
                  )
              else:
                  chs = info["bads"]
          else:
              raise ValueError(
                  'include/exclude must be list, tuple, ndarray, or "bads". You provided '
                  f"type {type(chs)}."
              )
      return chs
  
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 20 for calling a global function with example usage: _check_excludes_includes(chs, info, allow_bads) and returns: chs