code: def testDecomposeByComponentSupportsMissingData(self):
      num_timesteps = 8
      (
          model,
          observed_time_series,
          param_samples,
      ) = self._build_model_and_params(
          num_timesteps=num_timesteps, param_batch_shape=[]
      )
  
      # Check that missing values are properly handled by setting them to NaN,
      # and asserting (below) that the NaNs don't propagate.
      is_missing = [True, True, False, False, True, False, False, True]
      nans = np.zeros([num_timesteps], dtype=self.dtype)
      nans[is_missing] = np.nan
      masked_time_series = missing_values_util.MaskedTimeSeries(
          time_series=observed_time_series + nans, is_missing=is_missing
      )
  
      component_dists = decomposition.decompose_by_component(
          model,
          observed_time_series=masked_time_series,
          parameter_samples=param_samples,
      )
  
      component_means_, component_stddevs_ = self.evaluate(
          (
              [d.mean() for d in component_dists.values()],
              [d.stddev() for d in component_dists.values()],
          )
      )
      self.assertTrue(np.all(np.isfinite(component_means_)))
      self.assertTrue(np.all(np.isfinite(component_stddevs_)))
  
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.sts import decomposition
  from tensorflow_probability.python.sts.components import local_linear_trend
  from tensorflow_probability.python.sts.components import seasonal
  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
label_desc: Use image node_id 3 for calling the _DecompositionTest obj's underlying member method code with example usage: obj.testDecomposeByComponentSupportsMissingData() without return types