code: def testRandomPyPolicyGeneratesActionTensors(self):
      array_action_spec = array_spec.BoundedArraySpec(
          (7,), np.int32, -10, 10
      )
      observation = tf.ones([3], tf.float32)
      time_step = ts.restart(observation)
  
      observation_spec = tensor_spec.TensorSpec.from_tensor(observation)
      time_step_spec = ts.time_step_spec(observation_spec)
  
      tf_py_random_policy = tf_py_policy.TFPyPolicy(
          random_py_policy.RandomPyPolicy(
              time_step_spec=time_step_spec,
              action_spec=array_action_spec,
          )
      )
  
      batched_time_step = nest_utils.batch_nested_tensors(time_step)
      action_step = tf_py_random_policy.action(
          time_step=batched_time_step
      )
      action, new_policy_state = self.evaluate(
          [action_step.action, action_step.state]
      )
  
      self.assertEqual((1,) + array_action_spec.shape, action.shape)
      self.assertTrue(np.all(action >= array_action_spec.minimum))
      self.assertTrue(np.all(action <= array_action_spec.maximum))
      self.assertEqual(new_policy_state, ())
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing.absltest import mock
  import numpy
  import tensorflow
  from tf_agents.policies import py_policy
  from tf_agents.policies import random_py_policy
  from tf_agents.policies import tf_py_policy
  from tf_agents.specs import array_spec
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import policy_step
  from tf_agents.trajectories import time_step
  from tf_agents.utils import nest_utils
  from tf_agents.utils import test_utils
label_desc: Use image node_id 1 for calling the TFPyPolicyTest obj's underlying member method code with example usage: obj.testRandomPyPolicyGeneratesActionTensors() without return types