code: def tangent_space(X, Cref, *, metric="riemann"):
      """Transform matrices into tangent vectors.
  
      Transform matrices into tangent vectors, according to a reference
      matrix Cref and to a specific logarithmic map.
  
      Parameters
      ----------
      X : ndarray, shape (..., n, n)
          Matrices in manidold.
      Cref : ndarray, shape (n, n)
          The reference matrix.
      metric : string, default='riemann'
          The metric used for logarithmic map, can be: 'euclid', 'logeuclid',
          'riemann'.
  
      Returns
      -------
      T : ndarray, shape (..., n * (n + 1) / 2)
          Tangent vectors.
  
      See Also
      --------
      log_map_euclid
      log_map_logeuclid
      log_map_riemann
      upper
      """
      log_map_functions = {
          "euclid": log_map_euclid,
          "logeuclid": log_map_logeuclid,
          "riemann": log_map_riemann,
      }
      X_ = log_map_functions[metric](X, Cref)
      T = upper(X_)
  
      return T
  
file_path: pyRiemann/pyriemann/utils/tangentspace.py
imports: import numpy
  from .base import sqrtm, invsqrtm, logm, expm
  from .mean import mean_covariance
label_desc: Use image node_id 10 for calling a global function with example usage: tangent_space(X, Cref) and returns: T