code: def test_swapped_regressors():
      gamma = np.zeros(n_features)
      # X[:, 21] should be selected first, then X[:, 0] selected second,
      # which will take X[:, 21]'s place in case the algorithm does
      # column swapping for optimization (which is the case at the moment)
      gamma[21] = 1.0
      gamma[0] = 0.5
      new_y = np.dot(X, gamma)
      new_Xy = np.dot(X.T, new_y)
      gamma_hat = orthogonal_mp(X, new_y, n_nonzero_coefs=2)
      gamma_hat_gram = orthogonal_mp_gram(G, new_Xy, n_nonzero_coefs=2)
      assert_array_equal(np.flatnonzero(gamma_hat), [0, 21])
      assert_array_equal(np.flatnonzero(gamma_hat_gram), [0, 21])
  
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 13 for calling a global function with example usage: test_swapped_regressors() without return types