code: def test_end_to_end_prediction_works_and_is_deterministic(
      self, dtype, use_xla, use_spike_and_slab
  ):
      if not tf.executing_eagerly():
          return
      seed = test_util.test_seed(sampler_type="stateless")
      model, observed_time_series, is_missing = self._build_test_model(
          num_timesteps=5,
          batch_shape=[3],
          prior_class=gibbs_sampler.XLACompilableInverseGamma,
          sparse_weights_nonzero_prob=0.5
          if use_spike_and_slab
          else None,
          dtype=dtype,
          seasonal_components=[
              seasonal.Seasonal(
                  num_seasons=6,
                  drift_scale_prior=transformed_distribution.TransformedDistribution(
                      bijector=invert.Invert(square.Square()),
                      distribution=inverse_gamma.InverseGamma(
                          tf.constant(16.0, dtype=dtype),
                          tf.constant(4.0, dtype=dtype),
                      ),
                  ),
                  initial_effect_prior=normal.Normal(
                      tf.constant(0.0, dtype=dtype),
                      tf.constant(1.0, dtype=dtype),
                  ),
              )
          ],
      )
  
      @tf.function(jit_compile=use_xla)
      def do_sampling(observed_time_series, is_missing):
          return gibbs_sampler.fit_with_gibbs_sampling(
              model,
              missing_values_util.MaskedTimeSeries(
                  observed_time_series, is_missing
              ),
              num_results=4,
              num_warmup_steps=1,
              seed=seed,
          )
  
      samples = do_sampling(
          observed_time_series[..., tf.newaxis], is_missing
      )
      predictive_dist = gibbs_sampler.one_step_predictive(
          model, samples, thin_every=1
      )
  
      # Test that the seeded calculation gives the same result on multiple runs.
      samples2 = do_sampling(
          observed_time_series[..., tf.newaxis], is_missing
      )
      predictive_dist2 = gibbs_sampler.one_step_predictive(
          model, samples2, thin_every=1
      )
  
      (
          predictive_mean_,
          predictive_stddev_,
          predictive_mean2_,
          predictive_stddev2_,
      ) = self.evaluate(
          (
              predictive_dist.mean(),
              predictive_dist.stddev(),
              predictive_dist2.mean(),
              predictive_dist2.stddev(),
          )
      )
      self.assertAllEqual(predictive_mean_, predictive_mean2_)
      self.assertAllEqual(predictive_stddev_, predictive_stddev2_)
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import identity
  from tensorflow_probability.python.bijectors import invert
  from tensorflow_probability.python.bijectors import square
  from tensorflow_probability.python.distributions import inverse_gamma
  from tensorflow_probability.python.distributions import lognormal
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import student_t
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.distributions.linear_gaussian_ssm import linear_gaussian_update
  from tensorflow_probability.python.experimental.distributions import mvn_precision_factor_linop
  from tensorflow_probability.python.experimental.sts_gibbs import gibbs_sampler
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.stats import sample_stats
  from tensorflow_probability.python.sts.components import local_level
  from tensorflow_probability.python.sts.components import local_linear_trend
  from tensorflow_probability.python.sts.components import regression
  from tensorflow_probability.python.sts.components import seasonal
  from tensorflow_probability.python.sts.components import semilocal_linear_trend
  from tensorflow_probability.python.sts.components import sum
  from tensorflow_probability.python.sts.forecast import forecast
  from tensorflow_probability.python.sts.internal import missing_values_util
  from tensorflow_probability.python.sts.internal import util
label_desc: Use image node_id 3 for calling the GibbsSamplerTests obj's underlying member method code with example usage: obj.test_end_to_end_prediction_works_and_is_deterministic(dtype, use_xla, use_spike_and_slab) and returns: gibbs_sampler