code: def distance_mahalanobis(X, cov, mean=None, squared=False):
      r"""Mahalanobis distance between vectors and a Gaussian distribution.
  
      The Mahalanobis distance between a vector :math:`x \in \mathbb{C}^n` and a
      multivariate Gaussian distribution :math:`\mathcal{N}(\mu, C)`, with mean
      vector :math:`\mu \in \mathbb{C}^n` and covariance matrix
      :math:`C \in \mathbb{C}^{n \times n}` , is:
  
      .. math::
          d(x, \mathcal{N}(\mu, C)) = \sqrt{ (x - \mu)^H C^{-1} (x - \mu) }
  
      Parameters
      ----------
      X : ndarray, shape (n, n_vectors)
          Vectors.
      cov : ndarray, shape (n, n)
          Covariance matrix of the multivariate Gaussian distribution.
      mean : None | ndarray, shape (n, 1), default=None
          Mean vector of the multivariate Gaussian distribution.
          If None, distribution is considered as centered.
      squared : bool, default False
          Return squared distance.
  
          .. versionadded:: 0.5
  
      Returns
      -------
      d : ndarray, shape (n_vectors,)
          Mahalanobis distances.
  
      Notes
      -----
      .. versionadded:: 0.4
  
      References
      ----------
      .. [1] https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.mahalanobis.html
      """  # noqa
      if mean is not None:
          X -= mean
  
      Xw = invsqrtm(cov) @ X
      d2 = np.einsum("ij,ji->i", Xw.conj().T, Xw).real
      return d2 if squared else np.sqrt(d2)
  
imports: import numpy
  from scipy.linalg import eigvalsh, solve
  from sklearn.metrics import euclidean_distances
  from .base import logm, sqrtm, invsqrtm
label_desc: Use image node_id 19 for calling a global function with example usage: distance_mahalanobis(X, cov, mean, squared) and returns: unknown