code: def test_config(self):
      sp_top_k_cat_acc_obj = (
          accuracy_metrics.SparseTopKCategoricalAccuracy(
              k=1,
              name="sparse_top_k_categorical_accuracy",
              dtype="float32",
          )
      )
      self.assertEqual(
          sp_top_k_cat_acc_obj.name, "sparse_top_k_categorical_accuracy"
      )
      self.assertEqual(len(sp_top_k_cat_acc_obj.variables), 2)
      self.assertEqual(sp_top_k_cat_acc_obj._dtype, "float32")
  
      # Test get_config
      sp_top_k_cat_acc_obj_config = sp_top_k_cat_acc_obj.get_config()
      self.assertEqual(
          sp_top_k_cat_acc_obj_config["name"],
          "sparse_top_k_categorical_accuracy",
      )
      self.assertEqual(sp_top_k_cat_acc_obj_config["dtype"], "float32")
      self.assertEqual(sp_top_k_cat_acc_obj_config["k"], 1)
  
      # Check save and restore config
      sp_top_k_cat_acc_obj2 = (
          accuracy_metrics.SparseTopKCategoricalAccuracy.from_config(
              sp_top_k_cat_acc_obj_config
          )
      )
      self.assertEqual(
          sp_top_k_cat_acc_obj2.name,
          "sparse_top_k_categorical_accuracy",
      )
      self.assertEqual(len(sp_top_k_cat_acc_obj2.variables), 2)
      self.assertEqual(sp_top_k_cat_acc_obj2._dtype, "float32")
      self.assertEqual(sp_top_k_cat_acc_obj2.k, 1)
  
imports: import re
  import numpy
  from keras import testing
  from keras.metrics import accuracy_metrics
label_desc: Use image node_id 1 for calling the SparseTopKCategoricalAccuracyTest obj's underlying member method code with example usage: obj.test_config() without return types