code: def _map_eigenvalues(function, symmetric):
      """Matrix function, for real symmetric matrices.
  
      The function is applied to the eigenvalues of symmetric.
  
      Parameters
      ----------
      function : function numpy.ndarray -> numpy.ndarray
          The transform to apply to the eigenvalues.
  
      symmetric : numpy.ndarray, shape (n_features, n_features)
          The input symmetric matrix.
  
      Returns
      -------
      output : numpy.ndarray, shape (n_features, n_features)
          The new symmetric matrix obtained after transforming the eigenvalues,
          while keeping the same eigenvectors.
  
      Notes
      -----
      If input matrix is not real symmetric, no error is reported but result will
      be wrong.
  
      """
      eigenvalues, eigenvectors = linalg.eigh(symmetric)
      return _form_symmetric(function, eigenvalues, eigenvectors)
  
imports: import warnings
  from math import floor, sqrt
  import numpy
  from scipy import linalg
  from sklearn.base import BaseEstimator, TransformerMixin, clone
  from sklearn.covariance import LedoitWolf
  from nilearn._utils.docs import fill_doc
  from ..None import signal
  from .._utils.extmath import is_spd
label_desc: Use image node_id 4 for calling a global function with example usage: _map_eigenvalues(function, symmetric) and returns: _form_symmetric