code: def test_tolist(self):
      im = pyvips.Image.complexform(*pyvips.Image.xyz(3, 4))
  
      assert im.tolist()[-1][-1] == 2 + 3j
  
      im = im.cast("dpcomplex")
  
      assert im.tolist()[-1][-1] == 2 + 3j
  
      lst = [[1, 2, 3], [4, 5, 6]]
  
      im = pyvips.Image.new_from_array(lst)
  
      assert im.tolist() == lst
  
      assert im.cast("float").tolist() == lst
      assert im.cast("complex").tolist() == lst
  
file_path: pyvips/tests/test_image.py
imports: import pyvips
  import pytest
  from helpers import JPEG_FILE
label_desc: Use image node_id 10 for calling the TestImage obj's underlying member method code with example usage: obj.test_tolist() without return types