code: def unupper(T):
      """Inverse upper function.
  
      This function is the inverse of upper function: it reconstructs symmetric/
      Hermitian matrices from their weighted upper triangular parts.
  
      Parameters
      ----------
      T : ndarray, shape (..., n * (n + 1) / 2)
          Weighted upper triangular parts of symmetric/Hermitian matrices.
  
      Returns
      -------
      X : ndarray, shape (..., n, n)
          Symmetric/Hermitian matrices.
  
      See Also
      --------
      upper
  
      Notes
      -----
      .. versionadded:: 0.4
      """
      dims = T.shape
      n = int((np.sqrt(1 + 8 * dims[-1]) - 1) / 2)
      X = np.empty((*dims[:-1], n, n), dtype=T.dtype)
      idx = np.triu_indices_from(np.empty((n, n)))
      X[..., idx[0], idx[1]] = T
      idx = np.triu_indices_from(np.empty((n, n)), k=1)
      X[..., idx[0], idx[1]] /= np.sqrt(2)
      X[..., idx[1], idx[0]] = X[..., idx[0], idx[1]].conj()
      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 9 for calling a global function with example usage: unupper(T) and returns: X