code: def test_illegal(self):
      x = zmatrix()
      with pytest.raises(TypeError):
          function([x], cast(x, "float64"))(
              np.ones((2, 3), dtype="complex128")
          )
  
file_path: pytensor/tests/tensor/test_casting.py
imports: import numpy
  import pytest
  import pytensor
  from pytensor import function
  from pytensor.compile.io import In
  from pytensor.misc.safe_asarray import _asarray
  from pytensor.tensor.basic import _convert_to_complex64, _convert_to_complex128, _convert_to_float32, _convert_to_float64, _convert_to_int8, _convert_to_int16, _convert_to_int32, _convert_to_int64, cast
  from pytensor.tensor.type import TensorType, bvector, dmatrix, dvector, fvector, ivector, zmatrix
label_desc: Use image node_id 2 for calling the TestCasting obj's underlying member method code with example usage: obj.test_illegal() without return types