code: def make_matrices(
      n_matrices,
      n_dim,
      kind,
      rs=None,
      return_params=False,
      evals_low=0.5,
      evals_high=2.0,
      eigvecs_same=False,
  ):
      """Generate a set of matrices, with specific properties.
  
      Parameters
      ----------
      n_matrices : int
          Number of matrices to generate.
      n_dim : int
          Dimension of square matrices to generate.
      kind : {'real', 'comp', 'spd', 'spsd', 'hpd', 'hpsd'}
          Kind of matrices to generate:
  
          - 'real' for real-valued matrices;
          - 'comp' for complex-valued matrices;
          - 'spd' for symmetric positive-definite matrices;
          - 'spsd' for symmetric positive semi-definite matrices;
          - 'hpd' for Hermitian positive-definite matrices;
          - 'hpsd' for Hermitian positive semi-definite matrices.
      rs : RandomState instance, default=None
          Random state for reproducible output across multiple function calls.
      return_params : bool, default=False
          If True, then returns evals and evecs for 'spd', 'spsd', 'hpd' and
          'hpsd'.
      evals_low : float, default=0.5
          Lowest value of the uniform distribution to draw eigen values.
      evals_high : float, default=2.0
          Highest value of the uniform distribution to draw eigen values.
      eigvecs_same : bool, default False
          If True, then uses the same eigen vectors for all matrices.
  
      Returns
      -------
      mats : ndarray, shape (n_matrices, n_dim, n_dim)
          Generated matrices.
      evals : ndarray, shape (n_matrices, n_dim)
          Eigen values used for 'spd', 'spsd', 'hpd' and 'hpsd'.
          Only returned if ``return_params=True``.
      evecs : ndarray, shape (n_matrices, n_dim, n_dim) or (n_dim, n_dim)
          Eigen vectors used for 'spd', 'spsd', 'hpd' and 'hpsd'.
          Only returned if ``return_params=True``.
  
      Notes
      -----
      .. versionadded:: 0.5
      """
      if kind not in ("real", "comp", "spd", "spsd", "hpd", "hpsd"):
          raise ValueError(f"Unsupported matrix kind: {kind}")
  
      rs = check_random_state(rs)
      X = rs.randn(n_matrices, n_dim, n_dim)
      if kind == "real":
          return X
  
      if kind in ("comp", "hpd", "hpsd"):
          X = X + 1j * rs.randn(n_matrices, n_dim, n_dim)
          if kind == "comp":
              return X
  
      # eigen values
      if evals_low <= 0.0:
          raise ValueError(
              f"Lowest value must be strictly positive (Got {evals_low})."
          )
      if evals_high <= evals_low:
          raise ValueError(
              "Highest value must be superior to lowest value "
              f"(Got {evals_high} and {evals_low})."
          )
      evals = rs.uniform(
          evals_low, evals_high, size=(n_matrices, n_dim)
      )
      if kind in ("spsd", "hpsd"):
          evals[..., -1] = 1e-10  # last eigen value set to almost zero
  
      # eigen vectors
      if eigvecs_same:
          X = X[0]
      if np.__version__ < "1.22.0" and X.ndim > 2:
          evecs = np.array([np.linalg.qr(x)[0] for x in X])
      else:
          evecs = np.linalg.qr(X)[0]
  
      # conjugation
      if eigvecs_same:
          mats = np.empty((n_matrices, n_dim, n_dim), dtype=X.dtype)
          for i in range(n_matrices):
              mats[i] = (evecs * evals[i]) @ evecs.conj().T
      else:
          mats = (evecs * evals[:, np.newaxis, :]) @ np.swapaxes(
              evecs.conj(), -2, -1
          )
  
      if return_params:
          return mats, evals, evecs
      else:
          return mats
  
file_path: pyRiemann/pyriemann/datasets/simulated.py
imports: import numpy
  from sklearn.utils.validation import check_random_state
  from ..utils.mean import mean_riemann
  from ..utils.distance import distance_riemann
  from ..utils.base import invsqrtm, powm, sqrtm, expm
  from .sampling import generate_random_spd_matrix, sample_gaussian_spd
  from ..transfer import encode_domains
  from ..utils import deprecated
label_desc: Use image node_id 2 for calling a global function with example usage: make_matrices(n_matrices, n_dim, kind, rs, return_params, evals_low, evals_high, eigvecs_same) and returns: X, mats,  evals,  evecs, mats, X