code: def _build_empty_step(
      step: Any, step_fn: Callable[[Dict[str, Any]], Dict[str, Any]]
  ) -> Dict[str, Any]:
      """Builds a step with the same shape and dtype of an RLDS step."""
      rlds_step = tree_utils.map_structure(
          np.zeros_like, _get_step_metadata(step)
      )
      rlds_step["observation"] = tree_utils.map_structure(
          np.zeros_like, step.timestep.observation
      )
      rlds_step["action"] = tree_utils.map_structure(
          np.zeros_like, step.action
      )
      rlds_step["reward"] = np.zeros_like(step.timestep.reward)
      rlds_step["discount"] = np.zeros_like(step.timestep.discount)
      rlds_step["is_terminal"] = False
      rlds_step["is_first"] = False
      rlds_step["is_last"] = False
  
      return step_fn(rlds_step)
  
file_path: datasets/tensorflow_datasets/rlds/envlogger_reader.py
imports: from typing import Any, Callable, Dict, Generator, List, Optional, Sequence, Tuple, Union
  import numpy
  from tensorflow_datasets.core.utils import tree_utils
label_desc: Use image node_id 5 for calling a global function with example usage: _build_empty_step(step, step_fn) and returns: step_fn