code: def test_wrapped_cartpole_final(self):
      env = suite_dm_control.load("ball_in_cup", "catch")
      time_step = env.reset()
  
      while not time_step.is_last():
          time_step = env.step(np.array([1, 1]))
  
      self.assertTrue(time_step.is_last())
      self.assertNotEqual(None, time_step.reward)
      # Discount is 1.0 as it's an infinite horizon task that DM is terminating
      # early.
      self.assertEqual(1.0, time_step.discount)
  
file_path: agents/tf_agents/environments/dm_control_wrapper_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from tf_agents.environments import suite_dm_control
  from tf_agents.utils import test_utils
label_desc: Use image node_id 5 for calling the DmControlWrapperTest obj's underlying member method code with example usage: obj.test_wrapped_cartpole_final() without return types