code: def test_base_conditional_vs_ref(
      full_cov: bool, features_inducing_points: bool
  ) -> None:
      """
      Test that conditionals agree with a slow-but-clear numpy implementation
      """
      Dy, N, M, Dx = 5, 4, 3, 2
      X = np.random.randn(N, Dx)
      Z = np.random.randn(M, Dx)
      kern = gpflow.kernels.Matern52(lengthscales=0.5)
      q_mu = np.random.randn(M, Dy)
      q_sqrt: AnyNDArray = np.tril(np.random.randn(Dy, M, M), -1)
  
      def numpy_conditional(
          X: tf.Tensor,
          Z: tf.Tensor,
          kern: Kernel,
          q_mu: tf.Tensor,
          q_sqrt: tf.Tensor,
      ) -> MeanAndVariance:
          Kmm = kern(Z, Z) + np.eye(M) * gpflow.config.default_jitter()
          Kmn = kern(Z, X)
          Knn = kern(X, X)
  
          Kmm, Kmn, Knn = [k.numpy() for k in [Kmm, Kmn, Knn]]
          Knm: AnyNDArray = Kmn.T
  
          Kmm, Kmn, Knm, Knn = [
              np.tile(k[None, :, :], [Dy, 1, 1])
              for k in [Kmm, Kmn, Knm, Knn]
          ]
  
          S = q_sqrt @ np.transpose(q_sqrt, [0, 2, 1])
  
          Kmm_inv = np.linalg.inv(Kmm)
          mean = np.einsum("dmn,dmM,Md->nd", Kmn, Kmm_inv, q_mu)
          cov = Knn + Knm @ Kmm_inv @ (S - Kmm) @ Kmm_inv @ Kmn
          return mean, cov
  
      mean_np, cov_np = numpy_conditional(X, Z, kern, q_mu, q_sqrt)
  
      if features_inducing_points:
          Z = gpflow.inducing_variables.InducingPoints(Z)
  
      mean_gpflow, cov_gpflow = [
          v.numpy()
          for v in gpflow.conditionals.conditional(
              X,
              Z,
              kern,
              q_mu,
              q_sqrt=tf.identity(q_sqrt),
              white=False,
              full_cov=full_cov,
          )
      ]
  
      if not full_cov:
          cov_np = np.diagonal(cov_np, axis1=-1, axis2=-2).T
  
      assert_allclose(mean_np, mean_gpflow)
      assert_allclose(cov_np, cov_gpflow)
  
imports: import numpy
  import pytest
  import tensorflow
  from numpy.testing import assert_allclose
  import gpflow
  from gpflow import Parameter
  from gpflow.base import AnyNDArray, MeanAndVariance
  from gpflow.conditionals import conditional
  from gpflow.config import default_float
  from gpflow.kernels import Kernel
  from gpflow.utilities.bijectors import triangular
label_desc: Use image node_id 11 for calling a global function with example usage: test_base_conditional_vs_ref(full_cov, features_inducing_points) and returns: mean,  cov