class_docstr: Mixture distribution.
  
  The `Mixture` object implements batched mixture distributions.
  The mixture model is defined by a `Categorical` distribution (the mixture)
  and a python list of `Distribution` objects.
  
  In the common case that the component distributions are all the same
  `Distribution` class (potentially with different parameters), it's probably
  better to use `tfp.distributions.MixtureSameFamily` instead.
  
  Methods supported include `log_prob`, `prob`, `mean`, `sample`, and
  `entropy_lower_bound`.
  
  
  #### Examples
  
  ```python
  # Create a mixture of two Gaussians:
  tfd = tfp.distributions
  mix = 0.3
  bimix_gauss = tfd.Mixture(
    cat=tfd.Categorical(probs=[mix, 1.-mix]),
    components=[
      tfd.Normal(loc=-1., scale=0.1),
      tfd.Normal(loc=+1., scale=0.5),
  ])
  
  # Plot the PDF.
  import matplotlib.pyplot as plt
  x = tf.linspace(-2., 3., int(1e4))
  plt.plot(x, bimix_gauss.prob(x))
  ```
code: def _sample_n(self, n, seed=None):
      seeds = samplers.split_seed(
          seed, n=self.num_components + 1, salt="Mixture"
      )
      try:
          seed_stream = SeedStream(seed, salt="Mixture")
      except TypeError as e:  # Can happen for Tensor seed.
          seed_stream = None
          seed_stream_err = e
  
      # This sampling approach is almost the same as the approach used by
      # `MixtureSameFamily`. The differences are due to having a list of
      # `Distribution` objects rather than a single object.
      samples = []
      cat_samples = self.cat.sample(n, seed=seeds[0])
  
      for c in range(self.num_components):
          try:
              samples.append(
                  self.components[c].sample(n, seed=seeds[c + 1])
              )
              if seed_stream is not None:
                  seed_stream()
          except TypeError as e:
              if "Expected int for argument" not in str(
                  e
              ) and TENSOR_SEED_MSG_PREFIX not in str(e):
                  raise
              if seed_stream is None:
                  raise seed_stream_err
              msg = (
                  "Falling back to stateful sampling for `components[{}]` {} of "
                  "type `{}`. Please update to use `tf.random.stateless_*` RNGs. "
                  "This fallback may be removed after 20-Aug-2020. ({})"
              )
              warnings.warn(
                  msg.format(
                      c,
                      self.components[c].name,
                      type(self.components[c]),
                      str(e),
                  )
              )
              samples.append(
                  self.components[c].sample(n, seed=seed_stream())
              )
      stack_axis = -1 - tensorshape_util.rank(self._static_event_shape)
      x = tf.stack(samples, axis=stack_axis)  # [n, B, k, E]
      return tf.gather(
          x,
          cat_samples,
          axis=stack_axis,
          batch_dims=1
          + tensorshape_util.rank(self._static_batch_shape),
      )
  
imports: import warnings
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import auto_composite_tensor
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.util.seed_stream import SeedStream
  from tensorflow_probability.python.util.seed_stream import TENSOR_SEED_MSG_PREFIX
label_desc: Use image node_id 14 for calling the _Mixture obj's underlying member method code with example usage: obj._sample_n(n, seed) and returns: tf