code: def test_complex_structs(self):
      buffer = BufferWithInfiniteLookback(
          data=[self.space.sample() for _ in range(4)]
      )
      self.assertTrue(len(buffer), 4)
      buffer.append(self.space.sample())
      self.assertTrue(len(buffer), 5)
      buffer.append(self.space.sample())
      self.assertTrue(len(buffer), 6)
  
      buffer.finalize()
  
      self.assertTrue(isinstance(buffer.data, dict))
      self.assertTrue(isinstance(buffer.data["a"], np.ndarray))
      self.assertTrue(isinstance(buffer.data["b"], np.ndarray))
      self.assertTrue(isinstance(buffer.data["c"], tuple))
      self.assertTrue(isinstance(buffer.data["c"][0], np.ndarray))
      self.assertTrue(isinstance(buffer.data["c"][1], np.ndarray))
  
file_path: ray/rllib/env/tests/test_lookback_buffer.py
imports: import unittest
  import gymnasium
  import numpy
  from ray.rllib.env.utils import BufferWithInfiniteLookback
  from ray.rllib.utils.spaces.space_utils import batch, get_dummy_batch_for_space
  from ray.rllib.utils.test_utils import check
label_desc: Use image node_id 2 for calling the TestBufferWithInfiniteLookback obj's underlying member method code with example usage: obj.test_complex_structs() without return types