code: def test_compute_optimal_action_and_reward(self):
      observation = np.array(
          [
              [0.1, 0.2],
              [0.3, -0.7],
              [-0.3, -0.7],
              [0.3, 0.7],
              [0.1, 0.3],
          ]
      )
      actual_actions = wheel_py_environment.compute_optimal_action(
          observation, 0.5
      )
      expected_actions = [0, 2, 4, 1, 0]
      self.assertAllEqual(actual_actions, expected_actions)
      actual_rewards = wheel_py_environment.compute_optimal_reward(
          observation, 0.5, 1.5, 3.0
      )
      expected_rewards = [1.5, 3.0, 3.0, 3.0, 1.5]
      self.assertAllEqual(actual_rewards, expected_rewards)
  
file_path: agents/tf_agents/bandits/environments/wheel_py_environment_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tf_agents.bandits.environments import wheel_py_environment
label_desc: Use image node_id 4 for calling the WheelBanditPyEnvironmentTest obj's underlying member method code with example usage: obj.test_compute_optimal_action_and_reward() without return types