code: def test_multivariate_normal(
      x: AnyNDArray, mu: AnyNDArray, cov_sqrt: AnyNDArray
  ) -> None:
      cov = np.dot(cov_sqrt, cov_sqrt.T)
      L = np.linalg.cholesky(cov)
  
      gp_result = logdensities.multivariate_normal(x, mu, L)
  
      if mu.shape[1] > 1:
          if x.shape[1] > 1:
              sp_result = [
                  mvn.logpdf(x[:, i], mu[:, i], cov)
                  for i in range(mu.shape[1])
              ]
          else:
              sp_result = [
                  mvn.logpdf(x.ravel(), mu[:, i], cov)
                  for i in range(mu.shape[1])
              ]
      else:
          sp_result = mvn.logpdf(x.T, mu.ravel(), cov)
      assert_allclose(gp_result, sp_result)
  
file_path: GPflow/tests/gpflow/test_logdensities.py
imports: import numpy
  import pytest
  import scipy.stats
  from numpy.random import randn
  from numpy.testing import assert_allclose
  from scipy.stats import multivariate_normal
  from gpflow import logdensities
  from gpflow.base import AnyNDArray
  from gpflow.utilities import to_default_float
label_desc: Use image node_id 10 for calling a global function with example usage: test_multivariate_normal(x, mu, cov_sqrt) without return types