code: def test_t_contrast_errors():
      match = (
          "t contrasts should be of length P=.*, but it has length .*"
      )
      with pytest.warns(UserWarning, match=match):
          RESULTS.Tcontrast([1])
      with pytest.raises(ValueError, match=match):
          RESULTS.Tcontrast([1, 0, 0])
      # And shape
      with pytest.raises(
          ValueError, match="t contrasts should have only one row"
      ):
          RESULTS.Tcontrast(np.array([1, 0])[:, None])
  
file_path: nilearn/nilearn/glm/tests/test_model.py
imports: import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal
  from nilearn.glm import OLSModel
label_desc: Use image node_id 3 for calling a global function with example usage: test_t_contrast_errors() without return types