code: def test_dataframe_values(using_copy_on_write, method):
      df = DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
      df_orig = df.copy()
  
      arr = method(df)
  
      if using_copy_on_write:
          # .values still gives a view but is read-only
          assert np.shares_memory(arr, get_array(df, "a"))
          assert arr.flags.writeable is False
  
          # mutating series through arr therefore doesn't work
          with pytest.raises(ValueError, match="read-only"):
              arr[0, 0] = 0
          tm.assert_frame_equal(df, df_orig)
  
          # mutating the series itself still works
          df.iloc[0, 0] = 0
          assert df.values[0, 0] == 0
      else:
          assert arr.flags.writeable is True
          arr[0, 0] = 0
          assert df.iloc[0, 0] == 0
  
file_path: pandas/pandas/tests/copy_view/test_array.py
imports: import numpy
  import pytest
  from pandas import DataFrame, Series, date_range
  import pandas._testing
  from pandas.tests.copy_view.util import get_array
label_desc: Use image node_id 2 for calling a global function with example usage: test_dataframe_values(using_copy_on_write, method) without return types