class_docstr: `FeatureConnector` for integer class labels.
code: def names(self, new_names: list[str]):
      int2str = new_names
      # Names can only be defined once
      if self._int2str is not None and self._int2str != int2str:
          raise ValueError(
              "Trying to overwrite already defined ClassLabel names. Previous: {} "
              ", new: {}".format(self._int2str, int2str)
          )
  
      # Set-up [new] names
      self._int2str = int2str
      self._str2int = {name: i for i, name in enumerate(self._int2str)}
      if len(self._int2str) != len(self._str2int):
          raise ValueError(
              "Some label names are duplicated. Each label name should be unique."
          )
  
      # If num_classes has been defined, ensure that num_classes and names match
      num_classes = len(self._str2int)
      if self._num_classes is None:
          self._num_classes = num_classes
      elif self._num_classes != num_classes:
          raise ValueError(
              "ClassLabel number of names do not match the defined num_classes. "
              "Got {} names VS {} num_classes".format(
                  num_classes, self._num_classes
              )
          )
  
imports: from typing import Optional, Union
  from etils import epath
  import numpy
  from tensorflow_datasets.core.features import feature
  from tensorflow_datasets.core.features import tensor_feature
  from tensorflow_datasets.core.proto import feature_pb2
  from tensorflow_datasets.core.utils import type_utils
label_desc: Use image node_id 4 for calling the ClassLabel obj's underlying member method code with example usage: obj.names(new_names) without return types