code: def batch_data():
      # spaces
      obs_space = gym.spaces.Box(
          low=1, high=np.inf, shape=(4, 3, 2), dtype=np.float32
      )
      act_space = gym.spaces.MultiDiscrete([2, 5])
      env_spec = EnvSpec(obs_space, act_space)
  
      # generate data
      batch_size = 2
      obs = np.stack([obs_space.low] * batch_size)
      next_obs = np.stack([obs_space.low] * batch_size)
      act = np.stack([[1, 3]] * batch_size)
      rew = np.arange(batch_size)
      step_types = np.array(
          [StepType.FIRST, StepType.TERMINAL], dtype=StepType
      )
  
      # env_infos
      env_infos = dict()
      env_infos["goal"] = np.stack([[1, 1]] * batch_size)
      env_infos["foo"] = np.arange(batch_size)
  
      # agent_infos
      agent_infos = dict()
      agent_infos["prev_action"] = act
      agent_infos["hidden"] = np.arange(batch_size)
  
      # episode_infos
      episode_infos = dict()
      episode_infos["prev_action"] = act
  
      return {
          "env_spec": env_spec,
          "episode_infos": episode_infos,
          "observations": obs,
          "next_observations": next_obs,
          "actions": act,
          "rewards": rew,
          "env_infos": env_infos,
          "agent_infos": agent_infos,
          "step_types": step_types,
      }
  
imports: import akro
  import gym.spaces
  import numpy
  import pytest
  from garage import EnvSpec, EnvStep, EpisodeBatch, StepType, TimeStep, TimeStepBatch
label_desc: Use image node_id 29 for calling a global function with example usage: batch_data() and returns: dict