code: def test_decode_errors_kwarg():
      ser = Series([b"a", b"b", b"a\x9d"])
  
      msg = (
          "'charmap' codec can't decode byte 0x9d in position 1: "
          "character maps to <undefined>"
      )
      with pytest.raises(UnicodeDecodeError, match=msg):
          ser.str.decode("cp1252")
  
      result = ser.str.decode("cp1252", "ignore")
      expected = ser.map(lambda x: x.decode("cp1252", "ignore")).astype(
          object
      )
      tm.assert_series_equal(result, expected)
  
imports: from datetime import datetime, timedelta
  import numpy
  import pytest
  from pandas import DataFrame, Index, MultiIndex, Series
  import pandas._testing
  from pandas.core.strings.accessor import StringMethods
  from pandas.tests.strings import object_pyarrow_numpy
label_desc: Use image node_id 34 for calling a global function with example usage: test_decode_errors_kwarg() without return types