code: def test_posterior_update_cache_fails_without_argument(
      q_sqrt_factory: QSqrtFactory, whiten: bool
  ) -> None:
      # setup posterior
      kernel = gpflow.kernels.SquaredExponential()
      inducing_variable = inducingpoint_wrapper(
          np.random.randn(NUM_INDUCING_POINTS, INPUT_DIMS)
      )
  
      q_mu = tf.Variable(np.random.randn(NUM_INDUCING_POINTS, 1))
  
      initial_q_sqrt = q_sqrt_factory(NUM_INDUCING_POINTS, 1)
      if initial_q_sqrt is not None:
          q_sqrt = tf.Variable(initial_q_sqrt)
      else:
          q_sqrt = initial_q_sqrt
  
      posterior = IndependentPosteriorSingleOutput(
          kernel=kernel,
          inducing_variable=inducing_variable,
          q_mu=q_mu,
          q_sqrt=q_sqrt,
          whiten=whiten,
          precompute_cache=None,
      )
      assert posterior.cache is None
  
      with pytest.raises(ValueError):
          posterior.update_cache()
  
      posterior.update_cache(PrecomputeCacheType.TENSOR)
      assert posterior.cache
      assert all(isinstance(c, tf.Tensor) for c in posterior.cache)
  
      posterior.update_cache(PrecomputeCacheType.NOCACHE)
      assert posterior._precompute_cache == PrecomputeCacheType.NOCACHE
      assert posterior.cache is None
  
      posterior.update_cache(
          PrecomputeCacheType.TENSOR
      )  # set posterior._precompute_cache
      assert posterior._precompute_cache == PrecomputeCacheType.TENSOR
  
      posterior.cache = None  # clear again
      posterior.update_cache()  # does not raise an exception
      assert posterior.cache
      assert all(isinstance(c, tf.Tensor) for c in posterior.cache)
  
imports: from typing import Any, Callable, DefaultDict, Optional, Set, Type, cast
  import numpy
  import pytest
  import tensorflow
  from _pytest.fixtures import SubRequest
  from check_shapes import check_shapes
  import gpflow
  import gpflow.ci_utils
  from gpflow.base import TensorType
  from gpflow.conditionals import conditional
  from gpflow.inducing_variables import InducingPoints, InducingVariables
  from gpflow.kernels import Kernel
  from gpflow.likelihoods import Gaussian
  from gpflow.mean_functions import Zero
  from gpflow.models.util import inducingpoint_wrapper
  from gpflow.posteriors import AbstractPosterior, FallbackIndependentLatentPosterior, FullyCorrelatedPosterior, GPRPosterior, IndependentPosteriorMultiOutput, IndependentPosteriorSingleOutput, LinearCoregionalizationPosterior, PrecomputeCacheType, SGPRPosterior, VGPPosterior, create_posterior
label_desc: Use image node_id 23 for calling a global function with example usage: test_posterior_update_cache_fails_without_argument(q_sqrt_factory, whiten) without return types