code: def test_categorical(self, seed, num_samples, batch_size):
      np.random.seed(seed)
      # Create logits that definitely favors the batch index after a softmax
      # is applied. Without a softmax, this would be close to random.
      logits = np.eye(batch_size) * 1e5 + 1e6
      res = random.categorical(logits, num_samples, seed=seed)
      # Outputs should have shape `(batch_size, num_samples)`, where each
      # output index matches the batch index.
      self.assertEqual(res.shape, (batch_size, num_samples))
      expected = np.tile(
          np.arange(batch_size)[:, None], (1, num_samples)
      )
      self.assertAllClose(res, expected)
  
imports: import numpy
  import pytest
  from absl.testing import parameterized
  import keras
  from keras import backend
  from keras import ops
  from keras import testing
  from keras.random import random
  from keras.random import seed_generator
  from keras.utils.rng_utils import set_random_seed
label_desc: Use image node_id 3 for calling the RandomTest obj's underlying member method code with example usage: obj.test_categorical(seed, num_samples, batch_size) without return types