class_docstr: `FeatureConnector` for integer class labels.
docstr: Conversion class name string => integer.
docstr_tok: ["Conversion","class","name","string","=",">","integer","."]
code: def str2int(self, str_value: str) -> int:
      """Conversion class name string => integer."""
      if self._str2int:
          return self._str2int[str_value]
  
      # No names provided, try to integerize
      failed_parse = False
      try:
          int_value = int(str_value)
      except ValueError:
          failed_parse = True
      if failed_parse or not 0 <= int_value < self._num_classes:
          raise ValueError("Invalid string class label %s" % str_value)
      return int_value
  
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 5 for calling the ClassLabel obj's underlying member method code with example usage: obj.str2int(str_value) and returns: int_value, self