code: def test_categorical_setitem_invalid():
      ps = pd.Series([1, 2, 3], dtype="category")
      gs = cudf.Series([1, 2, 3], dtype="category")
  
      if PANDAS_GE_150:
          assert_exceptions_equal(
              lfunc=ps.__setitem__,
              rfunc=gs.__setitem__,
              lfunc_args_and_kwargs=([0, 5], {}),
              rfunc_args_and_kwargs=([0, 5], {}),
          )
      else:
          # Following workaround is needed because:
          # https://github.com/pandas-dev/pandas/issues/46646
          with pytest.raises(
              ValueError,
              match="Cannot setitem on a Categorical with a new category, set "
              "the categories first",
          ):
              gs[0] = 5
  
imports: import numpy
  import pandas
  import pytest
  import cudf
  from cudf.core._compat import PANDAS_GE_150
  from cudf.testing._utils import assert_eq, assert_exceptions_equal
label_desc: Use image node_id 12 for calling a global function with example usage: test_categorical_setitem_invalid() without return types