code: def test_config():
      kp_obj = CohenKappa(name="cohen_kappa", num_classes=5)
      assert kp_obj.name == "cohen_kappa"
      assert kp_obj.dtype == tf.float32
      assert kp_obj.num_classes == 5
  
      # Check save and restore config
      kb_obj2 = CohenKappa.from_config(kp_obj.get_config())
      assert kb_obj2.name == "cohen_kappa"
      assert kb_obj2.dtype == tf.float32
      assert kp_obj.num_classes == 5
  
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 1 for calling a global function with example usage: test_config() without return types