code: def test_reward(self):
      t = trajectory.Trajectory()
      # first time-step doesn't have rewards, since they are on entering a state.
      t.add_time_step(
          observation=1,
          raw_reward=None,
          processed_reward=None,
          done=False,
      )
      t.add_time_step(
          observation=2, raw_reward=2, processed_reward=200, done=False
      )
      t.add_time_step(
          observation=3, raw_reward=3, processed_reward=300, done=True
      )
  
      raw_reward, processed_reward = t.reward
  
      self.assertEqual(5, raw_reward)
      self.assertEqual(500, processed_reward)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import numpy
  from tensor2tensor.envs import time_step
  from tensor2tensor.envs import trajectory
  import tensorflow.compat.v1
  from tensorflow.compat.v1.io import gfile
label_desc: Use image node_id 4 for calling the TrajectoryTest obj's underlying member method code with example usage: obj.test_reward() without return types