code: def test_save_load(self):
      labels1 = features.ClassLabel(
          names=["label3", "label1", "label2"]
      )
      labels2 = features.ClassLabel(num_classes=None)
      labels3 = features.ClassLabel(num_classes=1)
  
      with testing.tmp_dir(self.get_temp_dir()) as tmp_dir:
          labels1.save_metadata(tmp_dir, "test-labels")
          labels2.load_metadata(tmp_dir, "test-labels")
          with self.assertRaisesWithPredicateMatch(
              ValueError,
              "number of names do not match the defined num_classes",
          ):
              labels3.load_metadata(tmp_dir, "test-labels")
  
      # labels2 should have been copied from label1
      self.assertEqual(3, labels2.num_classes)
      self.assertEqual(
          labels2.names,
          [
              "label3",
              "label1",
              "label2",
          ],
      )
  
file_path: datasets/tensorflow_datasets/core/features/class_label_feature_test.py
imports: import textwrap
  import tensorflow
  from tensorflow_datasets import testing
  from tensorflow_datasets.core import features
label_desc: Use image node_id 6 for calling the ClassLabelFeatureTest obj's underlying member method code with example usage: obj.test_save_load() without return types