code: def _sample_parameter_r(
      n_samples,
      n_dim,
      sigma,
      random_state=None,
      n_jobs=1,
      sampling_method="auto",
  ):
      """Sample the r parameters of a Riemannian Gaussian distribution.
  
      Sample the logarithm of the eigenvalues of a SPD matrix following a
      Riemannian Gaussian distribution.
  
      See [1]_ for the mathematical details.
  
      Parameters
      ----------
      n_samples : int
          How many samples to generate.
      n_dim : int
          Dimensionality of the SPD matrices to be sampled.
      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'
          Name of the sampling method used to sample samples_r. 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
      -------
      r_samples : ndarray, shape (n_samples, n_dim)
          Samples of the r parameters of the Riemannian Gaussian distribution.
  
      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.
      """
      if sampling_method not in ["slice", "rejection", "auto"]:
          raise ValueError(
              f"Unknown sampling method {sampling_method},"
              "try slice or rejection"
          )
      if n_dim == 2 and sampling_method != "slice":
          return _rejection_sampling_2D(
              n_samples, sigma, random_state=random_state
          )
      if n_dim != 2 and sampling_method == "rejection":
          raise ValueError(
              f"n_dim={n_dim} is not yet supported with rejection sampling"
          )
      rs = check_random_state(random_state)
      x0 = rs.randn(n_dim)
      ptarget = partial(_pdf_r, sigma=sigma)
      r_samples = _slice_sampling(
          ptarget,
          n_samples=n_samples,
          x0=x0,
          random_state=random_state,
          n_jobs=n_jobs,
      )
  
      return r_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 7 for calling a global function with example usage: _sample_parameter_r(n_samples, n_dim, sigma, random_state, n_jobs, sampling_method) and returns: r_samples, _rejection_sampling_2D