code: def test_predicted_r_square(X, Y):
      Xshort = X.copy()[:10, :]
      Yshort = Y.copy()[:10]
  
      # Signal of 10 elements should be completely
      # predicted by 10 predictors (short of some numerical
      # rounding errors)
      model = OLSModel(design=Xshort)
      results = model.fit(Yshort)
      assert_almost_equal(results.residuals.sum(), 0)
      assert_array_almost_equal(results.predicted, Yshort)
      assert_almost_equal(results.r_square, 1.0)
  
file_path: nilearn/nilearn/glm/tests/test_regression.py
imports: import pytest
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_array_equal
  from nilearn.glm import ARModel, OLSModel, SimpleRegressionResults
label_desc: Use image node_id 6 for calling a global function with example usage: test_predicted_r_square(X, Y) without return types