code: def test_replace_cascade(self, inplace):
      # Test that replaced values are not replaced again
      # GH #50778
      ser = pd.Series([1, 2, 3])
      expected = pd.Series([2, 3, 4])
  
      res = ser.replace([1, 2, 3], [2, 3, 4], inplace=inplace)
      if inplace:
          tm.assert_series_equal(ser, expected)
      else:
          tm.assert_series_equal(res, expected)
  
imports: import re
  import numpy
  import pytest
  from pandas._config import using_pyarrow_string_dtype
  import pandas
  import pandas._testing
  from pandas.core.arrays import IntervalArray
label_desc: Use image node_id 18 for calling the TestSeriesReplace obj's underlying member method code with example usage: obj.test_replace_cascade(inplace) without return types