code: def untangent_space(T, Cref, *, metric="riemann"):
      """Transform tangent vectors back to matrices.
  
      Transform tangent vectors back to matrices, according to a reference
      matrix Cref and to a specific exponential map.
  
      Parameters
      ----------
      T : ndarray, shape (..., n * (n + 1) / 2)
          Tangent vectors.
      Cref : ndarray, shape (n, n)
          The reference matrix.
      metric : string, default='riemann'
          The metric used for exponential map, can be: 'euclid', 'logeuclid',
          'riemann'.
  
      Returns
      -------
      X : ndarray, shape (..., n, n)
          Matrices in manidold.
  
      See Also
      --------
      unupper
      exp_map_euclid
      exp_map_logeuclid
      exp_map_riemann
      """
      X_ = unupper(T)
      exp_map_functions = {
          "euclid": exp_map_euclid,
          "logeuclid": exp_map_logeuclid,
          "riemann": exp_map_riemann,
      }
      X = exp_map_functions[metric](X_, Cref)
  
      return X
  
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 11 for calling a global function with example usage: untangent_space(T, Cref) and returns: X