code: def preprocess(
      features, label_key, chrm_image_shape, class_names=None
  ):
      """Preprocessing code."""
      if isinstance(label_key, str):
          labels = features[label_key]
      else:
          labels = tuple(features[k] for k in label_key)
  
      class_names = tf.convert_to_tensor(class_names)
      chrm = tf.reshape(
          tf.io.decode_raw(features["chrm_img"], tf.float32),
          tuple(chrm_image_shape) + (1,),
      )
      labels = labels == class_names  # Creates one-hot label.
  
      return {
          "inputs": chrm,
          "label": labels,
          "key": tf.strings.unicode_decode(
              pad(features["chrm_path"]), "UTF-8"
          ),
      }
  
file_path: scenic/scenic/projects/tasseo/dataset_utils.py
imports: from absl import logging
  import jax
  import numpy
  import tensorflow
label_desc: Use image node_id 5 for calling a global function with example usage: preprocess(features, label_key, chrm_image_shape, class_names) and returns: dict