code: def test_categorical_typecast(data, cat_type):
      pd_data = data.copy()
      gd_data = cudf.from_pandas(data)
  
      assert_eq(pd_data.astype(cat_type), gd_data.astype(cat_type))
  
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 25 for calling a global function with example usage: test_categorical_typecast(data, cat_type) without return types