code: def test_models_with_mean_functions_changes(
      model_class: Type[Any],
  ) -> None:
      """
      Simply check that all models have a higher prediction with a constant mean
      function than with a zero mean function.
  
      For compositions of mean functions check that multiplication/ addition of
      a constant results in a higher prediction, whereas addition of zero/
      mutliplication with one does not.
      """
      data = rng.randn(Datum.N, Datum.input_dim), rng.randn(Datum.N, 1)
      Xnew = rng.randn(Datum.Ntest, Datum.input_dim)
      inducing_variable = InducingPoints(
          Z=rng.randn(Datum.M, Datum.input_dim)
      )
      kernel = gpflow.kernels.Matern32()
      likelihood = gpflow.likelihoods.Gaussian()
      zero_mean = Zero()
      non_zero_mean = Constant(c=np.ones(1) * 10)
  
      if model_class in [gpflow.models.GPR]:
          model_zero_mean = model_class(
              data, kernel=kernel, mean_function=zero_mean
          )
          model_non_zero_mean = model_class(
              data, kernel=kernel, mean_function=non_zero_mean
          )
      elif model_class in [gpflow.models.VGP]:
          model_zero_mean = model_class(
              data,
              likelihood=likelihood,
              kernel=kernel,
              mean_function=zero_mean,
          )
          model_non_zero_mean = model_class(
              data,
              likelihood=likelihood,
              kernel=kernel,
              mean_function=non_zero_mean,
          )
      elif model_class in [gpflow.models.SVGP]:
          model_zero_mean = model_class(
              kernel=kernel,
              likelihood=likelihood,
              inducing_variable=inducing_variable,
              mean_function=zero_mean,
          )
          model_non_zero_mean = model_class(
              kernel=kernel,
              likelihood=likelihood,
              inducing_variable=inducing_variable,
              mean_function=non_zero_mean,
          )
      elif model_class in [gpflow.models.SGPR, gpflow.models.GPRFITC]:
          model_zero_mean = model_class(
              data,
              kernel=kernel,
              inducing_variable=inducing_variable,
              mean_function=zero_mean,
          )
          model_non_zero_mean = model_class(
              data,
              kernel=kernel,
              inducing_variable=inducing_variable,
              mean_function=non_zero_mean,
          )
      elif model_class in [gpflow.models.SGPMC]:
          model_zero_mean = model_class(
              data,
              kernel=kernel,
              likelihood=likelihood,
              inducing_variable=inducing_variable,
              mean_function=zero_mean,
          )
          model_non_zero_mean = model_class(
              data,
              kernel=kernel,
              likelihood=likelihood,
              inducing_variable=inducing_variable,
              mean_function=non_zero_mean,
          )
      elif model_class in [gpflow.models.GPMC]:
          model_zero_mean = model_class(
              data,
              kernel=kernel,
              likelihood=likelihood,
              mean_function=zero_mean,
          )
          model_non_zero_mean = model_class(
              data,
              kernel=kernel,
              likelihood=likelihood,
              mean_function=non_zero_mean,
          )
      else:
          raise NotImplementedError
  
      mu_zero, var_zero = model_zero_mean.predict_f(Xnew)
      mu_non_zero, var_non_zero = model_non_zero_mean.predict_f(Xnew)
      # predictive variance remains unchanged after modifying mean function
      assert np.all(var_zero.numpy() == var_non_zero.numpy())
      # predictive mean changes after modifying mean function
      assert not np.all(mu_zero.numpy() == mu_non_zero.numpy())
  
imports: from typing import Any, Sequence, Tuple, Type
  import numpy
  import pytest
  import tensorflow_probability
  from check_shapes import check_shapes
  from numpy.testing import assert_allclose
  import gpflow
  from gpflow.base import AnyNDArray, TensorType
  from gpflow.config import default_int
  from gpflow.functions import Additive, Constant, Linear, MeanFunction, Polynomial, Product, SwitchedMeanFunction, Zero
  from gpflow.inducing_variables import InducingPoints
label_desc: Use image node_id 13 for calling a global function with example usage: test_models_with_mean_functions_changes(model_class) without return types