code: def final_step_like(
      step: base.Step, next_observation: types.NestedArray
  ) -> base.Step:
      """Return a list of steps with the final step zero-filled."""
      # Make zero-filled components so we can fill out the last step.
      (
          zero_action,
          zero_reward,
          zero_discount,
          zero_extras,
      ) = tree.map_structure(
          zeros_like,
          (step.action, step.reward, step.discount, step.extras),
      )
  
      # Return a final step that only has next_observation.
      return base.Step(
          observation=next_observation,
          action=zero_action,
          reward=zero_reward,
          discount=zero_discount,
          start_of_episode=False,
          extras=zero_extras,
      )
  
file_path: acme/acme/adders/reverb/utils.py
imports: from typing import Dict, Union
  from acme import types
  from acme.adders.reverb import base
  import jax
  import jax.numpy
  import numpy
  import tree
label_desc: Use image node_id 2 for calling a global function with example usage: final_step_like(step, next_observation) and returns: base