code: def preprocess_example(example, train, dtype=tf.float32, resize=None):
      """Preprocesses the given image.
  
      Args:
        example: dict; Example coming from TFDS.
        train: bool; Whether to apply training-specific preprocessing or not.
        dtype: Tensorflow data type; Data type of the image.
        resize: sequence; [H, W] to which image and labels should be resized.
  
      Returns:
        An example dict as required by the model.
      """
      image = dataset_utils.normalize(example["image_left"], dtype)
      mask = example["segmentation_label"]
  
      # Resize test images (train images are cropped/resized during augmentation):
      if not train:
          if resize is not None:
              image = tf.image.resize(image, resize, "bilinear")
              mask = tf.image.resize(mask, resize, "nearest")
  
      image = tf.cast(image, dtype)
      mask = tf.cast(mask, dtype)
      mask = tf.squeeze(mask, axis=2)
      return {"inputs": image, "label": mask}
  
file_path: scenic/scenic/dataset_lib/cityscapes_dataset.py
imports: import collections
  import functools
  from typing import Optional
  from absl import logging
  import jax.numpy
  import numpy
  from scenic.dataset_lib import dataset_utils
  from scenic.dataset_lib import datasets
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: preprocess_example(example, train, dtype, resize) and returns: dict