code: def test_tol():
      tol = 0.5
      gamma = orthogonal_mp(X, y[:, 0], tol=tol)
      gamma_gram = orthogonal_mp(X, y[:, 0], tol=tol, precompute=True)
      assert np.sum((y[:, 0] - np.dot(X, gamma)) ** 2) <= tol
      assert np.sum((y[:, 0] - np.dot(X, gamma_gram)) ** 2) <= tol
  
imports: import numpy
  import pytest
  from sklearn.datasets import make_sparse_coded_signal
  from sklearn.linear_model import LinearRegression, OrthogonalMatchingPursuit, OrthogonalMatchingPursuitCV, orthogonal_mp, orthogonal_mp_gram
  from sklearn.utils import check_random_state
  from sklearn.utils._testing import assert_allclose, assert_array_almost_equal, assert_array_equal, ignore_warnings
label_desc: Use image node_id 4 for calling a global function with example usage: test_tol() without return types