code: def draw_sample(
      num_samples, num_classes, logits, num_trials, dtype, seed
  ):
      """Sample a multinomial.
  
      The batch shape is given by broadcasting num_trials with
      remove_last_dimension(logits).
  
      Args:
        num_samples: Python int or singleton integer Tensor: number of multinomial
          samples to draw.
        num_classes: Python int or singleton integer Tensor: number of classes.
        logits: Floating Tensor with last dimension `num_classes`, of (unnormalized)
          logit probabilities per class.
        num_trials: Tensor of number of categorical trials each multinomial consists
          of.  num_trials[..., tf.newaxis] must broadcast with logits.
        dtype: dtype at which to emit samples.
        seed: PRNG seed; see `tfp.random.sanitize_seed` for details.
  
      Returns:
        samples: Tensor of given dtype and shape [num_samples] + batch_shape +
          [num_classes].
      """
      probs = tf.math.softmax(logits)
      return _sample_multinomial_as_iterated_binomial(
          num_samples, num_classes, probs, num_trials, dtype, seed
      )
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import softmax_centered
  from tensorflow_probability.python.distributions import binomial
  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 distribution_util
  from tensorflow_probability.python.internal import dtype_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 tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math import generic
label_desc: Use image node_id 1 for calling a global function with example usage: draw_sample(num_samples, num_classes, logits, num_trials, dtype, seed) and returns: _sample_multinomial_as_iterated_binomial