code: def test_detect_chained_assignment(self, using_copy_on_write):
      with option_context("chained_assignment", "raise"):
          # work with the chain
          expected = DataFrame([[-5, 1], [-6, 3]], columns=list("AB"))
          df = DataFrame(
              np.arange(4).reshape(2, 2),
              columns=list("AB"),
              dtype="int64",
          )
          df_original = df.copy()
          assert df._is_copy is None
  
          with tm.raises_chained_assignment_error():
              df["A"][0] = -5
          with tm.raises_chained_assignment_error():
              df["A"][1] = -6
          if using_copy_on_write:
              tm.assert_frame_equal(df, df_original)
          else:
              tm.assert_frame_equal(df, expected)
  
imports: from string import ascii_letters
  import numpy
  import pytest
  from pandas.errors import SettingWithCopyError, SettingWithCopyWarning
  import pandas
  from pandas import DataFrame, Index, Series, Timestamp, date_range, option_context
  import pandas._testing
label_desc: Use image node_id 2 for calling the TestChaining obj's underlying member method code with example usage: obj.test_detect_chained_assignment(using_copy_on_write) without return types