code: def test_t_contrast():
      # Test individual t against R
      assert_array_almost_equal(RESULTS.t(0), 3.25)
      assert_array_almost_equal(RESULTS.t(1), 7.181, 3)
      # And contrast
      assert_array_almost_equal(RESULTS.Tcontrast([1, 0]).t, 3.25)
      assert_array_almost_equal(RESULTS.Tcontrast([0, 1]).t, 7.181, 3)
      # Input matrix checked for size
      pytest.raises(ValueError, RESULTS.Tcontrast, [1])
      pytest.raises(ValueError, RESULTS.Tcontrast, [1, 0, 0])
      # And shape
      pytest.raises(
          ValueError, RESULTS.Tcontrast, np.array([1, 0])[:, None]
      )
  
file_path: nipy/nipy/algorithms/statistics/models/tests/test_model.py
imports: import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal
  from ..regression import OLSModel
label_desc: Use image node_id 2 for calling a global function with example usage: test_t_contrast() without return types