code: def test_kappa_worse_than_random():
      actuals = [4, 4, 3, 3, 2, 2, 1, 1]
      preds = [1, 2, 4, 1, 3, 3, 4, 4]
      actuals = tf.constant(actuals, dtype=tf.int32)
      preds = tf.constant(preds, dtype=tf.int32)
  
      # Initialize
      kp_obj1, kp_obj2, kp_obj3 = initialize_vars()
  
      # Update
      update_obj_states(kp_obj1, kp_obj2, kp_obj3, actuals, preds, None)
  
      # check results
      check_results(
          [kp_obj1, kp_obj2, kp_obj3],
          [-0.3333333, -0.52380952, -0.72727272],
      )
  
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 8 for calling a global function with example usage: test_kappa_worse_than_random() without return types