code: def geodesic(A, B, alpha, metric="riemann"):
      """Geodesic between matrices according to a metric.
  
      Return the matrix at the position alpha on the geodesic between matrices
      A and B according to a metric.
  
      Parameters
      ----------
      A : ndarray, shape (..., n, n)
          First matrices.
      B : ndarray, shape (..., n, n)
          Second matrices.
      alpha : float
          The position on the geodesic.
      metric : string, default='riemann'
          The metric used for geodesic, can be: 'euclid', 'logeuclid', 'riemann'.
  
      Returns
      -------
      C : ndarray, shape (..., n, n)
          Matrices on the geodesic.
      """
      geodesic_functions = {
          "euclid": geodesic_euclid,
          "logeuclid": geodesic_logeuclid,
          "riemann": geodesic_riemann,
      }
      C = geodesic_functions[metric](A, B, alpha)
      return C
  
imports: from .base import sqrtm, invsqrtm, powm, logm, expm
label_desc: Use image node_id 4 for calling a global function with example usage: geodesic(A, B, alpha, metric) and returns: C