code: def testSample(self):
      policy = categorical_q_policy.CategoricalQPolicy(
          self._time_step_spec,
          self._action_spec,
          self._q_network,
          self._min_q_value,
          self._max_q_value,
      )
  
      observations = tf.constant([[1, 2], [3, 4]], dtype=tf.float32)
      time_step = ts.restart(observations)
      actions = policy.action(time_step).action
      self.assertEqual(actions.shape.as_list(), [2])
      self.assertEqual(actions.dtype, tf.int32)
      self.evaluate(tf.compat.v1.global_variables_initializer())
      actions = self.evaluate(actions)
  
      # actions should be a list of two elements; e.g., [0, 1]
      self.assertLen(actions, 2)
  
      for action in actions:
          self.assertGreaterEqual(action, self._action_spec.minimum)
          self.assertLessEqual(action, self._action_spec.maximum)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from absl import flags
  import numpy
  import tensorflow
  from tf_agents.networks import categorical_q_network
  from tf_agents.networks import network
  from tf_agents.policies import categorical_q_policy
  from tf_agents.policies import policy_saver
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import time_step
  from tf_agents.utils import test_utils
label_desc: Use image node_id 5 for calling the CategoricalQPolicyTest obj's underlying member method code with example usage: obj.testSample() without return types