code: def test_te_errors():
      import pytest
  
      x = np.arange(27)
      # Invalid input shape
      pytest.raises(ValueError, te, x.reshape((3, 3, 3)))
      pytest.raises(
          ValueError, te, x.reshape((3, 3, 3)), constraints="center"
      )
      # Invalid constraints shape
      pytest.raises(
          ValueError, te, x, constraints=np.arange(8).reshape((2, 2, 2))
      )
  
imports: import numpy
  from patsy.util import have_pandas, atleast_2d_column_default, no_pickling, assert_no_pickling, safe_string_eq
  from patsy.state import stateful_transform
label_desc: Use image node_id 21 for calling a global function with example usage: test_te_errors() without return types