code: def _get_ch_type(inst, ch_type):
      _validate_type(ch_type, (str, list, tuple), "ch_type")
      valid_ch_types = ("auto",) + _ELECTRODE_CH_TYPES
      if isinstance(ch_type, str):
          _check_option("ch_type", ch_type, valid_ch_types)
          if ch_type != "auto":
              ch_type = [ch_type]
      elif isinstance(ch_type, (list, tuple)):
          for type_ in ch_type:
              _validate_type(type_, str, "ch_type")
              _check_option("ch_type", type_, valid_ch_types[1:])
          ch_type = list(ch_type)
  
      # if ch_type is 'auto', search through list to find first reasonable
      # reference-able channel type.
      if ch_type == "auto":
          for type_ in _ELECTRODE_CH_TYPES:
              if type_ in inst:
                  ch_type = [type_]
                  logger.info(
                      "%s channel type selected for "
                      "re-referencing" % DEFAULTS["titles"][type_]
                  )
                  break
          # if auto comes up empty, or the user specifies a bad ch_type.
          else:
              raise ValueError(
                  "No EEG, ECoG, sEEG or DBS channels found "
                  "to rereference."
              )
      return ch_type
  
file_path: mne-python/mne/_fiff/reference.py
imports: import numpy
  from ..defaults import DEFAULTS
  from ..fixes import pinv
  from ..utils import _check_option, _check_preload, _on_missing, _validate_type, fill_doc, logger, verbose, warn
  from .constants import FIFF
  from .meas_info import _check_ch_keys
  from .pick import _ELECTRODE_CH_TYPES, pick_channels, pick_channels_forward, pick_types
  from .proj import _has_eeg_average_ref_proj, make_eeg_average_ref_proj, setup_proj
label_desc: Use image node_id 7 for calling a global function with example usage: _get_ch_type(inst, ch_type) and returns: ch_type