code: def test_to_epsbatch_list(eps_data):
      t = EpisodeBatch(**eps_data)
      t_list = t.to_list()
      assert len(t_list) == len(eps_data["lengths"])
      start = 0
      for length, last_obs, s in zip(
          eps_data["lengths"], eps_data["last_observations"], t_list
      ):
          stop = start + length
          assert (
              s["observations"] == eps_data["observations"][start:stop]
          ).all()
          assert (
              s["next_observations"]
              == np.concatenate(
                  (
                      eps_data["observations"][start + 1 : stop],
                      [last_obs],
                  )
              )
          ).all()
          assert (s["actions"] == eps_data["actions"][start:stop]).all()
          assert (s["rewards"] == eps_data["rewards"][start:stop]).all()
          assert (
              s["step_types"] == eps_data["step_types"][start:stop]
          ).all()
          start = stop
      assert start == len(eps_data["rewards"])
  
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 21 for calling a global function with example usage: test_to_epsbatch_list(eps_data) without return types