code: def sample_gaussian_spd(
      n_matrices,
      mean,
      sigma,
      random_state=None,
      n_jobs=1,
      sampling_method="auto",
  ):
      """Sample a Riemannian Gaussian distribution.
  
      Sample SPD matrices from a Riemannian Gaussian distribution centered at
      mean and with dispersion parametrized by sigma. This distribution has been
      defined in [1]_ and generalizes the notion of a Gaussian distribution to
      the space of SPD matrices. The sampling is based on a spectral
      factorization of SPD matrices in terms of their eigenvectors (U-parameters)
      and the log of the eigenvalues (r-parameters).
  
      Parameters
      ----------
      n_matrices : int
          How many matrices to generate.
      mean : ndarray, shape (n_dim, n_dim)
          Center of the Riemannian Gaussian distribution.
      sigma : float
          Dispersion of the Riemannian Gaussian distribution.
      random_state : int, RandomState instance or None, default=None
          Pass an int for reproducible output across multiple function calls.
      n_jobs : int, default=1
          The number of jobs to use for the computation. This works by computing
          each of the class centroid in parallel. If -1 all CPUs are used.
      sampling_method : str, default='auto'
          Sampling method to sample eigenvalues. It can be
          'auto', 'slice' or 'rejection'. If it is 'auto', the sampling_method
          will be equal to 'slice' for n_dim != 2 and equal to
          'rejection' for n_dim = 2.
  
          .. versionadded:: 0.4
  
      Returns
      -------
      samples : ndarray, shape (n_matrices, n_dim, n_dim)
          Samples of the Riemannian Gaussian distribution.
  
      Notes
      -----
      .. versionadded:: 0.3
  
      References
      ----------
      .. [1] `Riemannian Gaussian distributions on the space of symmetric
          positive definite matrices
          <https://hal.archives-ouvertes.fr/hal-01710191>`_
          S. Said, L. Bombrun, Y. Berthoumieu, and J. Manton. IEEE Trans Inf
          Theory, vol. 63, pp. 2153–2170, 2017.
      """
  
      n_dim = mean.shape[0]
      # dispersion is corrected w.r.t. dimension
      samples_centered = _sample_gaussian_spd_centered(
          n_matrices=n_matrices,
          n_dim=n_dim,
          sigma=sigma / np.sqrt(n_dim),
          random_state=random_state,
          n_jobs=n_jobs,
          sampling_method=sampling_method,
      )
  
      # apply the parallel transport to mean on each of the samples
      mean_sqrt = sqrtm(mean)
      samples = mean_sqrt @ samples_centered @ mean_sqrt
  
      if not is_spsd(samples):
          msg = "Some of the sampled matrices are very badly conditioned and \
                 may not behave numerically as a SPD matrix. Try sampling again \
                 or reducing the dimensionality of the matrix."
          warnings.warn(msg)
  
      return samples
  
file_path: pyRiemann/pyriemann/datasets/sampling.py
imports: from functools import partial
  import warnings
  import numpy
  from scipy.stats import multivariate_normal
  from sklearn.utils import check_random_state
  from joblib import Parallel, delayed
  from ..utils.base import sqrtm, expm
  from ..utils.test import is_sym_pos_semi_def
label_desc: Use image node_id 10 for calling a global function with example usage: sample_gaussian_spd(n_matrices, mean, sigma, random_state, n_jobs, sampling_method) and returns: samples