code: def test_residuals(X, Y):
      # If design matrix contains an intercept, the
      # mean of the residuals should be 0 (short of
      # some numerical rounding errors)
      X[:, 0] = 1
      model = OLSModel(design=X)
      results = model.fit(Y)
      assert_almost_equal(results.residuals.mean(), 0)
      assert len(results.whitened_residuals) == 40
  
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 5 for calling a global function with example usage: test_residuals(X, Y) without return types