code: def sqrtm_sym(A, rcond=1e-7, inv=False):
      """Compute the sqrt of a positive, semi-definite matrix (or its inverse).
  
      Parameters
      ----------
      A : ndarray, shape (..., n, n)
          The array to take the square root of.
      rcond : float
          The relative condition number used during reconstruction.
      inv : bool
          If True, compute the inverse of the square root rather than the
          square root itself.
  
      Returns
      -------
      A_sqrt : ndarray, shape (..., n, n)
          The (possibly inverted) square root of A.
      s : ndarray, shape (..., n)
          The original square root singular values (not inverted).
      """
      # Same as linalg.sqrtm(C) but faster, also yields the eigenvalues
      return _sym_mat_pow(A, -0.5 if inv else 0.5, rcond, return_s=True)
  
file_path: mne-python/mne/utils/linalg.py
imports: import functools
  import numpy
  from scipy import linalg
  from scipy._lib._util import _asarray_validated
label_desc: Use image node_id 7 for calling a global function with example usage: sqrtm_sym(A, rcond, inv) and returns: _sym_mat_pow