code: def test_quadrature(white: bool, mean: Optional[str]) -> None:
      kernel = gpflow.kernels.SquaredExponential()
      inducing_variable = gpflow.inducing_variables.InducingPoints(
          DataQuad.Z
      )
      mean_function = mean_function_factory(
          mean, DataQuad.D_in, DataQuad.D_out
      )
  
      effective_mean = mean_function or (lambda X: 0.0)
  
      def conditional_fn(X: tf.Tensor) -> tf.Tensor:
          return conditional(
              X,
              inducing_variable,
              kernel,
              DataQuad.q_mu,
              q_sqrt=DataQuad.q_sqrt,
              white=white,
          )
  
      def mean_fn(X: tf.Tensor) -> tf.Tensor:
          return conditional_fn(X)[0] + effective_mean(X)
  
      def var_fn(X: tf.Tensor) -> tf.Tensor:
          return conditional_fn(X)[1]
  
      quad_args = (
          DataQuad.Xmu,
          DataQuad.Xvar,
          DataQuad.H,
          DataQuad.D_in,
          (DataQuad.D_out,),
      )
      mean_quad = mvnquad(mean_fn, *quad_args)
      var_quad = mvnquad(var_fn, *quad_args)
  
      def mean_sq_fn(X: tf.Tensor) -> tf.Tensor:
          return mean_fn(X) ** 2
  
      mean_sq_quad = mvnquad(mean_sq_fn, *quad_args)
      var_quad = var_quad + (mean_sq_quad - mean_quad**2)
  
      mean_analytic, var_analytic = uncertain_conditional(
          DataQuad.Xmu,
          DataQuad.Xvar,
          inducing_variable,
          kernel,
          DataQuad.q_mu,
          DataQuad.q_sqrt,
          mean_function=mean_function,
          full_output_cov=False,
          white=white,
      )
  
      assert_allclose(mean_quad, mean_analytic, rtol=1e-6)
      assert_allclose(var_quad, var_analytic, rtol=1e-6)
  
imports: from typing import Collection, Optional
  import numpy
  import pytest
  import tensorflow
  from check_shapes import ShapeChecker, check_shapes
  from numpy.testing import assert_allclose
  import gpflow
  from gpflow.base import AnyNDArray, MeanAndVariance
  from gpflow.conditionals import conditional, uncertain_conditional
  from gpflow.config import default_float
  from gpflow.mean_functions import Constant, Linear, MeanFunction, Zero
  from gpflow.quadrature import mvnquad
  from gpflow.utilities import training_loop
label_desc: Use image node_id 7 for calling a global function with example usage: test_quadrature(white, mean) and returns: conditional, unknown, conditional_fn, unknown