code: def trap_music(
      evoked,
      forward,
      noise_cov,
      n_dipoles=5,
      return_residual=False,
      *,
      verbose=None,
  ):
      """TRAP-MUSIC source localization method.
  
      Compute Truncated Recursively Applied and Projected MUltiple SIgnal Classification
      (TRAP-MUSIC) :footcite:`Makela2018` on evoked data.
  
      .. note:: The goodness of fit (GOF) of all the returned dipoles is the
                same and corresponds to the GOF of the full set of dipoles.
  
      Parameters
      ----------
      evoked : instance of Evoked
          Evoked data to localize.
      forward : instance of Forward
          Forward operator.
      noise_cov : instance of Covariance
          The noise covariance.
      n_dipoles : int
          The number of dipoles to look for. The default value is 5.
      return_residual : bool
          If True, the residual is returned as an Evoked instance.
      %(verbose)s
  
      Returns
      -------
      dipoles : list of instance of Dipole
          The dipole fits.
      residual : instance of Evoked
          The residual a.k.a. data not explained by the dipoles.
          Only returned if return_residual is True.
  
      See Also
      --------
      mne.fit_dipole
      mne.beamformer.rap_music
  
      Notes
      -----
      .. versionadded:: 1.4
  
      References
      ----------
      .. footbibliography::
      """
      return _rap_music(
          evoked, forward, noise_cov, n_dipoles, return_residual, True
      )
  
file_path: mne-python/mne/beamformer/_rap_music.py
imports: import numpy
  from scipy import linalg
  from .._fiff.pick import pick_channels_forward, pick_info
  from ..fixes import _safe_svd
  from ..forward import convert_forward_solution, is_fixed_orient
  from ..inverse_sparse.mxne_inverse import _make_dipoles_sparse
  from ..minimum_norm.inverse import _log_exp_var
  from ..utils import _check_info_inv, fill_doc, logger, verbose
  from ._compute_beamformer import _prepare_beamformer_input
label_desc: Use image node_id 6 for calling a global function with example usage: trap_music(evoked, forward, noise_cov, n_dipoles, return_residual) and returns: _rap_music