code: def test_with_ohe_labels():
      y_true = np.array([4, 4, 3, 4], dtype=np.int32)
      y_true = tf.keras.utils.to_categorical(y_true, num_classes=5)
      y_pred = np.array([4, 4, 1, 2], dtype=np.int32)
  
      obj = CohenKappa(num_classes=5, sparse_labels=False)
  
      obj.update_state(y_true, y_pred)
      np.testing.assert_allclose(0.19999999, obj.result().numpy())
  
imports: import pytest
  import numpy
  import tensorflow
  from tensorflow_addons.metrics import CohenKappa
  from tensorflow_addons.testing.serialization import check_metric_serialization
label_desc: Use image node_id 17 for calling a global function with example usage: test_with_ohe_labels() without return types