code: def test_analytic_mean_and_var() -> None:
      """
      Test that quadrature computation used in HeteroskedasticTFPConditional
      of the predictive mean and variance is close to the analytical version,
      which can be computed for the special case of N(y | mean=f1, scale=exp(f2)),
      where f1, f2 ~ GP.
      """
      analytic_mean = Data.f_mean[:, [0]]
      analytic_variance = (
          np.exp(Data.f_mean[:, [1]] + Data.f_var[:, [1]]) ** 2
          + Data.f_var[:, [0]]
      )
  
      likelihood = HeteroskedasticTFPConditional()
      y_mean, y_var = likelihood.predict_mean_and_var(
          Data.X, Data.f_mean, Data.f_var
      )
  
      np.testing.assert_allclose(y_mean, analytic_mean)
      np.testing.assert_allclose(y_var, analytic_variance, rtol=1.5e-6)
  
imports: import numpy
  import tensorflow
  from gpflow.base import AnyNDArray
  from gpflow.likelihoods import HeteroskedasticTFPConditional
label_desc: Use image node_id 1 for calling a global function with example usage: test_analytic_mean_and_var() without return types