code: def test_interpolate_chained_assignment(using_copy_on_write, func):
      df = DataFrame({"a": [1, np.nan, 2], "b": 1})
      df_orig = df.copy()
      if using_copy_on_write:
          with tm.raises_chained_assignment_error():
              getattr(df["a"], func)(inplace=True)
          tm.assert_frame_equal(df, df_orig)
  
          with tm.raises_chained_assignment_error():
              getattr(df[["a"]], func)(inplace=True)
          tm.assert_frame_equal(df, df_orig)
      else:
          with tm.assert_produces_warning(
              FutureWarning, match="inplace method"
          ):
              getattr(df["a"], func)(inplace=True)
  
          with tm.assert_produces_warning(None):
              with option_context("mode.chained_assignment", None):
                  getattr(df[["a"]], func)(inplace=True)
  
          with tm.assert_produces_warning(None):
              with option_context("mode.chained_assignment", None):
                  getattr(df[df["a"] > 1], func)(inplace=True)
  
imports: import numpy
  import pytest
  from pandas import NA, ArrowDtype, DataFrame, Interval, NaT, Series, Timestamp, interval_range, option_context
  import pandas._testing
  from pandas.tests.copy_view.util import get_array
label_desc: Use image node_id 22 for calling a global function with example usage: test_interpolate_chained_assignment(using_copy_on_write, func) without return types