code: def test_cohen_kappa_single_batch():
      # Test for issue #1962
      obj = CohenKappa(5, regression=True, sparse_labels=True)
  
      # Test single batch update
      obj.update_state(tf.ones(1), tf.zeros(1))
  
      np.testing.assert_allclose(0, 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 19 for calling a global function with example usage: test_cohen_kappa_single_batch() without return types