code: def apply_inverse(
      evoked,
      inverse_operator,
      lambda2=1.0 / 9.0,
      method="dSPM",
      pick_ori=None,
      prepared=False,
      label=None,
      method_params=None,
      return_residual=False,
      use_cps=True,
      verbose=None,
  ):
      """Apply inverse operator to evoked data.
  
      Parameters
      ----------
      evoked : Evoked object
          Evoked data.
      inverse_operator : instance of InverseOperator
          Inverse operator.
      lambda2 : float
          The regularization parameter.
      method : "MNE" | "dSPM" | "sLORETA" | "eLORETA"
          Use minimum norm :footcite:`HamalainenIlmoniemi1994`,
          dSPM (default) :footcite:`DaleEtAl2000`,
          sLORETA :footcite:`Pascual-Marqui2002`, or
          eLORETA :footcite:`Pascual-Marqui2011`.
      %(pick_ori)s
      prepared : bool
          If True, do not call :func:`prepare_inverse_operator`.
      label : Label | None
          Restricts the source estimates to a given label. If None,
          source estimates will be computed for the entire source space.
      method_params : dict | None
          Additional options for eLORETA. See Notes for details.
  
          .. versionadded:: 0.16
      return_residual : bool
          If True (default False), return the residual evoked data.
          Cannot be used with ``method=='eLORETA'``.
  
          .. versionadded:: 0.17
      %(use_cps_restricted)s
  
          .. versionadded:: 0.20
      %(verbose)s
  
      Returns
      -------
      stc : SourceEstimate | VectorSourceEstimate | VolSourceEstimate
          The source estimates.
      residual : instance of Evoked
          The residual evoked data, only returned if return_residual is True.
  
      See Also
      --------
      apply_inverse_raw : Apply inverse operator to raw object.
      apply_inverse_epochs : Apply inverse operator to epochs object.
      apply_inverse_tfr_epochs : Apply inverse operator to epochs tfr object.
      apply_inverse_cov : Apply inverse operator to covariance object.
  
      Notes
      -----
      Currently only the ``method='eLORETA'`` has additional options.
      It performs an iterative fit with a convergence criterion, so you can
      pass a ``method_params`` :class:`dict` with string keys mapping to values
      for:
  
          'eps' : float
              The convergence epsilon (default 1e-6).
          'max_iter' : int
              The maximum number of iterations (default 20).
              If less regularization is applied, more iterations may be
              necessary.
          'force_equal' : bool
              Force all eLORETA weights for each direction for a given
              location equal. The default is None, which means ``True`` for
              loose-orientation inverses and ``False`` for free- and
              fixed-orientation inverses. See below.
  
      The eLORETA paper :footcite:`Pascual-Marqui2011` defines how to compute
      inverses for fixed- and
      free-orientation inverses. In the free orientation case, the X/Y/Z
      orientation triplet for each location is effectively multiplied by a
      3x3 weight matrix. This is the behavior obtained with
      ``force_equal=False`` parameter.
  
      However, other noise normalization methods (dSPM, sLORETA) multiply all
      orientations for a given location by a single value.
      Using ``force_equal=True`` mimics this behavior by modifying the iterative
      algorithm to choose uniform weights (equivalent to a 3x3 diagonal matrix
      with equal entries).
  
      It is necessary to use ``force_equal=True``
      with loose orientation inverses (e.g., ``loose=0.2``), otherwise the
      solution resembles a free-orientation inverse (``loose=1.0``).
      It is thus recommended to use ``force_equal=True`` for loose orientation
      and ``force_equal=False`` for free orientation inverses. This is the
      behavior used when the parameter ``force_equal=None`` (default behavior).
  
      References
      ----------
      .. footbibliography::
      """
      out = _apply_inverse(
          evoked,
          inverse_operator,
          lambda2,
          method,
          pick_ori,
          prepared,
          label,
          method_params,
          return_residual,
          use_cps,
      )
      logger.info("[done]")
      return out
  
imports: from copy import deepcopy
  from math import sqrt
  import numpy
  from scipy import linalg
  from scipy.stats import chi2
  from .._fiff.constants import FIFF
  from .._fiff.matrix import _read_named_matrix, _transpose_named_matrix, write_named_matrix
  from .._fiff.open import fiff_open
  from .._fiff.pick import channel_type, pick_channels, pick_info, pick_types
  from .._fiff.proj import _electrode_types, _needs_eeg_average_ref_proj, _read_proj, _write_proj, make_projector
  from .._fiff.tag import find_tag
  from .._fiff.tree import dir_tree_find
  from .._fiff.write import end_block, start_and_end_file, start_block, write_coord_trans, write_float, write_float_matrix, write_int, write_string
  from ..cov import Covariance, _read_cov, _write_cov, compute_whitener, prepare_noise_cov
  from ..epochs import BaseEpochs, EpochsArray
  from ..evoked import Evoked, EvokedArray
  from ..fixes import _safe_svd
  from ..forward import _read_forward_meas_info, _select_orient_forward, compute_depth_prior, compute_orient_prior, convert_forward_solution, is_fixed_orient
  from ..forward.forward import _triage_loose, write_forward_meas_info
  from ..html_templates import _get_html_template
  from ..io import BaseRaw
  from ..source_estimate import _get_src_type, _make_stc
  from ..source_space._source_space import _get_src_nn, _get_vertno, _read_source_spaces_from_tree, _write_source_spaces_to_fid, find_source_space_hemi, label_src_vertno_sel
  from ..surface import _normal_orth
  from ..time_frequency.tfr import _check_tfr_complex
  from ..transforms import _ensure_trans, transform_surface_to
  from ..utils import _check_compensation_grade, _check_depth, _check_fname, _check_option, _check_src_normal, _validate_type, _verbose_safe_false, check_fname, logger, repr_html, verbose, warn
  from ._eloreta import _compute_eloreta
label_desc: Use image node_id 13 for calling a global function with example usage: apply_inverse(evoked, inverse_operator, lambda2, method, pick_ori, prepared, label, method_params, return_residual, use_cps, verbose) and returns: out