code: def random_categorical(logits, num_samples, seed):
      """Returns a sample from a categorical distribution. `logits` must be 2D."""
      if _is_stateful_seed(seed):
          return tf.random.categorical(
              logits=logits, num_samples=num_samples, seed=seed
          )
      else:
          return tf.random.stateless_categorical(
              logits=logits, num_samples=num_samples, seed=seed
          )
  
imports: import functools
  import numpy
  import six
  import tensorflow.compat.v2
  from tensorflow.python.util import nest
label_desc: Use image node_id 14 for calling a global function with example usage: random_categorical(logits, num_samples, seed) and returns: tf, tf