code: def make_eeg_average_ref_proj(
      info, activate=True, *, ch_type="eeg", verbose=None
  ):
      """Create an EEG average reference SSP projection vector.
  
      Parameters
      ----------
      %(info_not_none)s
      activate : bool
          If True projections are activated.
      ch_type : str
          The channel type to use for reference projection.
          Valid types are ``'eeg'``, ``'ecog'``, ``'seeg'`` and ``'dbs'``.
  
          .. versionadded:: 1.2
      %(verbose)s
  
      Returns
      -------
      proj: instance of Projection
          The SSP/PCA projector.
      """
      if info.get("custom_ref_applied", False):
          raise RuntimeError(
              "A custom reference has been applied to the "
              "data earlier. Please use the "
              "mne.io.set_eeg_reference function to move from "
              "one EEG reference to another."
          )
  
      _validate_type(ch_type, (list, tuple, str), "ch_type")
      singleton = False
      if isinstance(ch_type, str):
          ch_type = [ch_type]
          singleton = True
      for ci, this_ch_type in enumerate(ch_type):
          _check_option(
              "ch_type" + ("" if singleton else f"[{ci}]"),
              this_ch_type,
              list(_EEG_AVREF_PICK_DICT),
          )
  
      ch_type_name = "/".join(c.upper() for c in ch_type)
      logger.info(
          f"Adding average {ch_type_name} reference projection."
      )
  
      ch_dict = {c: True for c in ch_type}
      for c in ch_type:
          one_picks = pick_types(info, exclude="bads", **{c: True})
          if len(one_picks) == 0:
              raise ValueError(
                  f"Cannot create {ch_type_name} average reference "
                  f"projector (no {c.upper()} data found)"
              )
      del ch_type
      ch_sel = pick_types(info, **ch_dict, exclude="bads")
      ch_names = info["ch_names"]
      ch_names = [ch_names[k] for k in ch_sel]
      n_chs = len(ch_sel)
      vec = np.ones((1, n_chs))
      vec /= np.sqrt(n_chs)
      explained_var = None
      proj_data = dict(
          col_names=ch_names,
          row_names=None,
          data=vec,
          nrow=1,
          ncol=n_chs,
      )
      proj = Projection(
          active=activate,
          data=proj_data,
          explained_var=explained_var,
          desc=f"Average {ch_type_name} reference",
          kind=FIFF.FIFFV_PROJ_ITEM_EEG_AVREF,
      )
      return proj
  
imports: import re
  from copy import deepcopy
  from itertools import count
  import numpy
  from ..defaults import _BORDER_DEFAULT, _EXTRAPOLATE_DEFAULT, _INTERPOLATION_DEFAULT
  from ..fixes import _safe_svd
  from ..utils import _check_option, _validate_type, fill_doc, logger, object_diff, verbose, warn
  from .constants import FIFF
  from .pick import _ELECTRODE_CH_TYPES, _electrode_types, pick_info, pick_types
  from .tag import _rename_list, find_tag
  from .tree import dir_tree_find
  from .write import _safe_name_list, end_block, start_block, write_float, write_float_matrix, write_int, write_name_list_sanitized, write_string
label_desc: Use image node_id 11 for calling a global function with example usage: make_eeg_average_ref_proj(info, activate) and returns: proj