code: def testSampleScalarBatchUnivariate(self):
      num_components = 3
      batch_shape = []
      dist = make_univariate_mixture(
          batch_shape=batch_shape, num_components=num_components
      )
      n = 4
      seed = test_util.test_seed()
      with _test_capture_normal_sample_outputs() as component_samples:
          with _test_capture_categorical_sample_outputs() as cat_samples:
              samples = dist.sample(n, seed=seed)
      self.assertLen(cat_samples, 1)
      cat_samples = cat_samples[0]
      self.assertEqual(samples.dtype, tf.float32)
      self.assertEqual((4,), samples.shape)
      (
          sample_values,
          cat_sample_values,
          dist_sample_values,
      ) = self.evaluate([samples, cat_samples, component_samples])
      self.assertEqual((4,), sample_values.shape)
  
      for c in range(num_components):
          which_c = np.where(cat_sample_values == c)[0]
          # Scalar Batch univariate case: batch_size == 1, rank 1
          which_dist_samples = dist_sample_values[c][which_c]
          self.assertAllClose(
              which_dist_samples, sample_values[which_c]
          )
  
imports: import contextlib
  import warnings
  import numpy
  from scipy import stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import dirichlet
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import gamma
  from tensorflow_probability.python.distributions import half_normal
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import mixture
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import mvn_tril
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import hypothesis_testlib
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 15 for calling the MixtureTest obj's underlying member method code with example usage: obj.testSampleScalarBatchUnivariate() without return types