code: def test_categorical_integer():
      cat = pd.Categorical(
          ["a", "_", "_", "c", "a"], categories=["a", "b", "c"]
      )
      pdsr = pd.Series(cat)
      sr = cudf.Series(cat)
      np.testing.assert_array_equal(
          cat.codes,
          sr.cat.codes.astype(cat.codes.dtype).fillna(-1).to_numpy(),
      )
      assert sr.null_count == 2
  
      np.testing.assert_array_equal(
          pdsr.cat.codes.values,
          sr.cat.codes.astype(pdsr.cat.codes.dtype)
          .fillna(-1)
          .to_numpy(),
      )
  
      expect_str = dedent(
          """\
          0       a
          1    <NA>
          2    <NA>
          3       c
          4       a
          dtype: category
          Categories (3, object): ['a', 'b', 'c']"""
      )
      assert str(sr) == expect_str
  
imports: import operator
  import string
  import warnings
  from contextlib import contextmanager
  from textwrap import dedent
  import numpy
  import pandas
  import pytest
  import cudf
  from cudf.core._compat import PANDAS_GE_134
  from cudf.testing._utils import NUMERIC_TYPES, assert_eq, assert_exceptions_equal, expect_warning_if
label_desc: Use image node_id 5 for calling a global function with example usage: test_categorical_integer() without return types