code: def test_invalid_model_raises_error(self):
      observed_time_series = tf.convert_to_tensor([1.0, 0.0, -1.0, 2.0])
      bad_model = sum_lib.Sum(
          [
              regression.LinearRegression(
                  design_matrix=tf.ones([4, 2])
              ),
              local_level.LocalLevel(
                  observed_time_series=observed_time_series
              ),
          ],
          observed_time_series=observed_time_series,
      )
  
      with self.assertRaisesRegex(
          ValueError, "does not support Gibbs sampling"
      ):
          gibbs_sampler.fit_with_gibbs_sampling(
              bad_model,
              observed_time_series,
              seed=test_util.test_seed(),
          )
  
      bad_model.supports_gibbs_sampling = True
      bad_model_with_correct_params = sum_lib.Sum(
          [
              # An unsupported model component.
              semilocal_linear_trend.SemiLocalLinearTrend(
                  observed_time_series=observed_time_series
              ),
              local_level.LocalLevel(
                  observed_time_series=observed_time_series
              ),
              regression.LinearRegression(
                  design_matrix=tf.ones([5, 2])
              ),
          ]
      )
      bad_model_with_correct_params.supports_gibbs_sampling = True
  
      with self.assertRaisesRegex(
          NotImplementedError,
          "Found unsupported model component for Gibbs Sampling",
      ):
          gibbs_sampler.fit_with_gibbs_sampling(
              bad_model_with_correct_params,
              observed_time_series,
              seed=test_util.test_seed(),
          )
  
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 8 for calling the GibbsSamplerTests obj's underlying member method code with example usage: obj.test_invalid_model_raises_error() without return types