code: def test_series_replace_errors():
      gsr = cudf.Series([1, 2, None, 3, None])
      psr = gsr.to_pandas()
  
      with pytest.raises(
          TypeError,
          match=re.escape(
              "to_replace and value should be of same types,"
              "got to_replace dtype: int64 and "
              "value dtype: object"
          ),
      ):
          gsr.replace(1, "a")
  
      gsr = cudf.Series(["a", "b", "c"])
      with pytest.raises(
          TypeError,
          match=re.escape(
              "to_replace and value should be of same types,"
              "got to_replace dtype: int64 and "
              "value dtype: object"
          ),
      ):
          gsr.replace([1, 2], ["a", "b"])
  
      assert_exceptions_equal(
          psr.replace,
          gsr.replace,
          ([{"a": 1}, 1],),
          ([{"a": 1}, 1],),
      )
  
      assert_exceptions_equal(
          lfunc=psr.replace,
          rfunc=gsr.replace,
          lfunc_args_and_kwargs=([[1, 2], [1]],),
          rfunc_args_and_kwargs=([[1, 2], [1]],),
      )
  
      assert_exceptions_equal(
          lfunc=psr.replace,
          rfunc=gsr.replace,
          lfunc_args_and_kwargs=([object(), [1]],),
          rfunc_args_and_kwargs=([object(), [1]],),
      )
  
      assert_exceptions_equal(
          lfunc=psr.replace,
          rfunc=gsr.replace,
          lfunc_args_and_kwargs=([{"a": 1}, object()],),
          rfunc_args_and_kwargs=([{"a": 1}, object()],),
      )
  
imports: import re
  from decimal import Decimal
  import numpy
  import pandas
  import pytest
  import cudf
  from cudf.core._compat import PANDAS_GE_134, PANDAS_GE_150
  from cudf.core.dtypes import Decimal32Dtype, Decimal64Dtype, Decimal128Dtype
  from cudf.testing._utils import INTEGER_TYPES, NUMERIC_TYPES, assert_eq, assert_exceptions_equal
label_desc: Use image node_id 31 for calling a global function with example usage: test_series_replace_errors() without return types