code: def test_color_validator_categorical(
      color_validator, color_categorical_pandas
  ):
      res = color_validator.validate_coerce(color_categorical_pandas)
  
      # Check type
      assert color_categorical_pandas.dtype == "category"
      assert isinstance(res, np.ndarray)
  
      # Check dtype
      assert res.dtype == "object"
  
      # Check values
      np.testing.assert_array_equal(
          res, np.array(color_categorical_pandas)
      )
  
imports: import pytest
  import numpy
  import pandas
  from datetime import datetime
  from _plotly_utils.basevalidators import NumberValidator, IntegerValidator, DataArrayValidator, ColorValidator
label_desc: Use image node_id 17 for calling a global function with example usage: test_color_validator_categorical(color_validator, color_categorical_pandas) without return types