class_docstr: Implements soft-termination (zero discount) on life loss.
code: def step(self, action: int) -> dm_env.TimeStep:
      if self._reset_next_step:
          return self.reset()
  
      timestep = self._environment.step(action)
      lives = timestep.observation[LIVES_INDEX]
  
      is_life_loss = True
      # We have a life loss when:
      # The wrapped environment is in a regular (MID) transition.
      is_life_loss &= timestep.mid()
      # Lives have decreased since last time `step` was called.
      is_life_loss &= lives < self._last_num_lives
  
      self._last_num_lives = lives
      if is_life_loss:
          return timestep._replace(discount=0.0)
      return timestep
  
imports: import abc
  from typing import Tuple, List, Optional, Sequence, Union
  from acme.wrappers import base
  from acme.wrappers import frame_stacking
  import dm_env
  from dm_env import specs
  import numpy
  from PIL import Image
label_desc: Use image node_id 3 for calling the _ZeroDiscountOnLifeLoss obj's underlying member method code with example usage: obj.step(action) and returns: timestep, self, timestep