code: def test_replace(self):
      ts = time_step.TimeStep.create_time_step(observation=1, action=1)
      self.assertFalse(ts.done)
  
      tsr = ts.replace(action=2, done=True, info={1: 1, 2: 4})
  
      # Asert that ts didn't change.
      self.assertFalse(ts.done)
      self.assertEqual(1, ts.observation)
      self.assertEqual(1, ts.action)
  
      # But tsr is as expected.
      self.assertTrue(tsr.done)
      self.assertEqual(1, tsr.observation)  # unchanged
      self.assertEqual(2, tsr.action)  # changed
      self.assertEqual({1: 1, 2: 4}, tsr.info)
  
file_path: tensor2tensor/tensor2tensor/envs/time_step_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensor2tensor.envs import time_step
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the TimeStepTest obj's underlying member method code with example usage: obj.test_replace() without return types