code: def test_gaussian_log_density(
      Ntrain: int, Ntest: int, D: int
  ) -> None:
      data = rng.randn(Ntrain, D), rng.randn(Ntrain, 1)
      Xtest, Ytest = rng.randn(Ntest, D), rng.randn(Ntest, 1)
      kernel = Matern32() + gpflow.kernels.White()
      model_gp = gpflow.models.GPR(data, kernel=kernel)
  
      mu_y, var_y = model_gp.predict_y(Xtest)
      data = Xtest, Ytest
      log_density = model_gp.predict_log_density(data)
      log_density_hand = np.squeeze(
          -0.5 * np.log(2 * np.pi)
          - 0.5 * np.log(var_y)
          - 0.5 * np.square(mu_y - Ytest) / var_y,
          axis=-1,
      )
  
      assert np.allclose(log_density_hand, log_density)
  
file_path: GPflow/tests/gpflow/models/test_model_predict.py
imports: from typing import Any, Dict, Optional, Type
  import numpy
  import pytest
  import gpflow
  from gpflow.inducing_variables import InducingPoints
  from gpflow.kernels import Kernel, Matern32
  from gpflow.models.util import InducingPointsLike
label_desc: Use image node_id 2 for calling a global function with example usage: test_gaussian_log_density(Ntrain, Ntest, D) without return types