code: def test_orthogonal_mp_gram_readonly():
      # Non-regression test for:
      # https://github.com/scikit-learn/scikit-learn/issues/5956
      (idx,) = gamma[:, 0].nonzero()
      G_readonly = G.copy()
      G_readonly.setflags(write=False)
      Xy_readonly = Xy.copy()
      Xy_readonly.setflags(write=False)
      gamma_gram = orthogonal_mp_gram(
          G_readonly,
          Xy_readonly[:, 0],
          n_nonzero_coefs=5,
          copy_Gram=False,
          copy_Xy=False,
      )
      assert_array_equal(idx, np.flatnonzero(gamma_gram))
      assert_array_almost_equal(gamma[:, 0], gamma_gram, decimal=2)
  
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 10 for calling a global function with example usage: test_orthogonal_mp_gram_readonly() without return types