code: def _categorical(
      logits, num_samples, dtype=None, seed=None, name=None
  ):  # pylint: disable=unused-argument
      rng = (
          np.random
          if seed is None
          else np.random.RandomState(seed & 0xFFFFFFFF)
      )
      dtype = utils.numpy_dtype(dtype or np.int64)
      if not hasattr(logits, "shape"):
          logits = np.array(logits, np.float32)
      probs = _softmax(logits)
      n = logits.shape[-1]
      return np.apply_along_axis(
          lambda p: rng.choice(n, p=p, size=num_samples), 1, probs
      )
  
imports: import numpy
  import numpy
  from tensorflow_probability.python.internal.backend.numpy import _utils
  from tensorflow_probability.python.internal.backend.numpy import ops
  from tensorflow_probability.python.internal.backend.numpy.numpy_math import softmax
label_desc: Use image node_id 4 for calling a global function with example usage: _categorical(logits, num_samples, dtype, seed, name) and returns: np