code: def test_names(self):
      labels = features.ClassLabel(names=["label3", "label1", "label2"])
      with self.assertRaisesWithPredicateMatch(
          ValueError, "overwrite already defined ClassLabel"
      ):
          labels.names = ["other", "labels"]
  
      labels = features.ClassLabel()
      labels.names = ["label3", "label1", "label2"]
      with self.assertRaisesWithPredicateMatch(
          ValueError, "overwrite already defined ClassLabel"
      ):
          labels.names = ["other", "labels"]
  
      labels = features.ClassLabel(num_classes=3)
      labels.names = ["label3", "label1", "label2"]
  
      labels = features.ClassLabel(num_classes=3)
      with self.assertRaisesWithPredicateMatch(
          ValueError,
          "number of names do not match the defined num_classes",
      ):
          labels.names = ["label3", "label1"]
  
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 7 for calling the ClassLabelFeatureTest obj's underlying member method code with example usage: obj.test_names() without return types