code: def process_one_label_dataset(label_ds, config, output_index=None):
      """process one-label data set."""
  
      logging.info("Loading one label dataset...")
      num_parallel_calls = config["data"]["task"]["num_parallel_calls"]
      classes = config["data"]["task"]["classes"]
      if isinstance(classes, list):
          if output_index is None or output_index not in range(
              len(classes)
          ):
              raise IndexError(
                  "output_index:{} not in the range of classes length: "
                  "{}!".format(output_index, len(classes))
              )
          num_classes = classes[output_index]["num_classes"]
          label_vocab_file_path = config["data"]["task"]["label_vocab"][
              output_index
          ]
      else:
          num_classes = classes["num_classes"]
          label_vocab_file_path = config["data"]["task"]["label_vocab"]
  
      label_ds = label_ds.map(
          lambda x: tokenize_label(
              x,
              maxlen=1,
              label_vocab_file_path=label_vocab_file_path,
              pad_id=0,
          ),
          num_parallel_calls=num_parallel_calls,
      )
  
      label_ds = label_ds.map(
          lambda l: tf.one_hot(l, num_classes, dtype=tf.int32),
          num_parallel_calls=num_parallel_calls,
      )
  
      label_ds = label_ds.map(
          tf.squeeze, num_parallel_calls=num_parallel_calls
      )
  
      return label_ds
  
file_path: delta/delta/data/preprocess/text_ops.py
imports: import delta.compat
  from absl import logging
  from delta import utils
  from core.ops import py_x_ops
  from delta.data.utils import read_lines_from_text_file
label_desc: Use image node_id 7 for calling a global function with example usage: process_one_label_dataset(label_ds, config, output_index) and returns: label_ds