code: def testRewardFnCalled(self):
      def reward_fn(unused_step_type, action, unused_observation):
          return action
  
      action_spec = array_spec.BoundedArraySpec((1,), np.int32, -10, 10)
      observation_spec = array_spec.BoundedArraySpec(
          (1,), np.int32, -10, 10
      )
      env = random_py_environment.RandomPyEnvironment(
          observation_spec, action_spec, reward_fn=reward_fn
      )
  
      time_step = env.step(
          1
      )  # No reward in first time_step  # pytype: disable=wrong-arg-types
      self.assertEqual(0.0, time_step.reward)
      time_step = env.step(1)  # pytype: disable=wrong-arg-types
      self.assertEqual(1, time_step.reward)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  from tf_agents.environments import random_py_environment
  from tf_agents.specs import array_spec
  from tf_agents.utils import test_utils
label_desc: Use image node_id 5 for calling the RandomPyEnvironmentTest obj's underlying member method code with example usage: obj.testRewardFnCalled() and returns: action