code: def make_univariate_mixture(batch_shape, num_components):
      batch_shape = tf.convert_to_tensor(
          value=batch_shape, dtype=tf.int32
      )
      seed_stream = test_util.test_seed_stream("univariate_mixture")
      logits = -50.0 + tf.random.uniform(
          tf.concat((batch_shape, [num_components]), axis=0),
          -1,
          1,
          dtype=tf.float32,
          seed=seed_stream(),
      )
      components = [
          normal.Normal(  # pylint: disable=g-complex-comprehension
              loc=tf.random.normal(batch_shape, seed=seed_stream()),
              scale=10
              * tf.random.uniform(batch_shape, seed=seed_stream()),
          )
          for _ in range(num_components)
      ]
      cat = categorical.Categorical(logits, dtype=tf.int32)
      return mixture.Mixture(cat, components, validate_args=True)
  
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 6 for calling a global function with example usage: make_univariate_mixture(batch_shape, num_components) and returns: mixture