class_docstr: Mixin class for Raw, Evoked, Epochs.
class_docstr_tok: ["Mixin","class","for","Raw",",","Evoked",",","Epochs","."]
docstr: Specify which reference to use for EEG data.
  
  Use this function to explicitly specify the desired reference for EEG.
  This can be either an existing electrode or a new virtual channel.
  This function will re-reference the data according to the desired
  reference.
  
  Parameters
  ----------
  %(ref_channels_set_eeg_reference)s
  %(projection_set_eeg_reference)s
  %(ch_type_set_eeg_reference)s
  %(forward_set_eeg_reference)s
  %(joint_set_eeg_reference)s
  %(verbose)s
  
  Returns
  -------
  inst : instance of Raw | Epochs | Evoked
      Data with EEG channels re-referenced. If ``ref_channels='average'``
      and ``projection=True`` a projection will be added instead of
      directly re-referencing the data.
  %(set_eeg_reference_see_also_notes)s
docstr_tok: ["Specify","which","reference","to","use","for","EEG","data",".","Use","this","function","to","explicitly","specify","the","desired","reference","for","EEG",".","This","can","be","either","an","existing","electrode","or","a","new","virtual","channel",".","This","function","will","re-reference","the","data","according","to","the","desired","reference",".","Parameters","--","--","--","--","--","%","(","ref_channels_set_eeg_reference",")","s","%","(","projection_set_eeg_reference",")","s","%","(","ch_type_set_eeg_reference",")","s","%","(","forward_set_eeg_reference",")","s","%","(","joint_set_eeg_reference",")","s","%","(","verbose",")","s","Returns","--","--","--","-","inst",":","instance","of","Raw","|","Epochs","|","Evoked","Data","with","EEG","channels","re-referenced",".","If","``","ref_channels='average","'","``","and","``","projection=True","``","a","projection","will","be","added","instead","of","directly","re-referencing","the","data",".","%","(","set_eeg_reference_see_also_notes",")","s"]
code: def set_eeg_reference(
      self,
      ref_channels="average",
      projection=False,
      ch_type="auto",
      forward=None,
      *,
      joint=False,
      verbose=None,
  ):
      """Specify which reference to use for EEG data.
  
      Use this function to explicitly specify the desired reference for EEG.
      This can be either an existing electrode or a new virtual channel.
      This function will re-reference the data according to the desired
      reference.
  
      Parameters
      ----------
      %(ref_channels_set_eeg_reference)s
      %(projection_set_eeg_reference)s
      %(ch_type_set_eeg_reference)s
      %(forward_set_eeg_reference)s
      %(joint_set_eeg_reference)s
      %(verbose)s
  
      Returns
      -------
      inst : instance of Raw | Epochs | Evoked
          Data with EEG channels re-referenced. If ``ref_channels='average'``
          and ``projection=True`` a projection will be added instead of
          directly re-referencing the data.
      %(set_eeg_reference_see_also_notes)s
      """
      return set_eeg_reference(
          self,
          ref_channels=ref_channels,
          copy=False,
          projection=projection,
          ch_type=ch_type,
          forward=forward,
          joint=joint,
      )[0]
  
imports: import os.path
  import string
  import sys
  from collections import OrderedDict
  from copy import deepcopy
  from dataclasses import dataclass
  from functools import partial
  from pathlib import Path
  from typing import Union
  import numpy
  from scipy.io import loadmat
  from scipy.sparse import csr_matrix, lil_matrix
  from scipy.spatial import Delaunay
  from scipy.stats import zscore
  from .._fiff.constants import FIFF
  from .._fiff.meas_info import Info, MontageMixin, _merge_info, _rename_comps, _unit2human, create_info
  from .._fiff.pick import _check_excludes_includes, _pick_data_channels, _picks_by_type, _picks_to_idx, _second_rules, channel_indices_by_type, channel_type, pick_channels, pick_info, pick_types
  from .._fiff.proj import setup_proj
  from .._fiff.reference import add_reference_channels, set_eeg_reference
  from .._fiff.tag import _rename_list
  from ..bem import _check_origin
  from ..defaults import HEAD_SIZE_DEFAULT, _handle_default
  from ..utils import _check_dict_keys, _check_fname, _check_option, _check_preload, _get_stim_channel, _on_missing, _validate_type, fill_doc, legacy, logger, verbose, warn
label_desc: Use image node_id 1 for calling the ReferenceMixin obj's underlying member method code with example usage: obj.set_eeg_reference(ref_channels, projection, ch_type, forward) and returns: set_eeg_reference