code: def preprocess_example_fishyscapes(
      example, train, dtype=tf.float32, resize=None, include_mask=True
  ):
      """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.
        include_mask: include batch_mask to ignore specific classes.
      Returns:
        An example dict as required by the model.
      """
      image = normalize(example["image_left"], dtype)
      mask = example["mask"]
  
      # 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)
  
      outputs = {"inputs": image, "label": mask}
      if include_mask:
          # Fishyscapes mask has values 0,1, 255, background pixels are set as 255.
          # create batch_mask array and set background pixels to 0 and
          # pixels that should be included during eval to 1
          batch_mask = tf.ones_like(mask, dtype)
          batch_mask = tf.cast(
              batch_mask * (1 - tf.cast(mask == 255, dtype)), dtype
          )
          # update the mask array to be 0 or  by setting cls 255 to cls 0.
          mask = tf.cast(
              mask * (1 - tf.cast(mask == 255, dtype)), dtype
          )
  
          outputs = {
              "inputs": image,
              "label": mask,
              "batch_mask": batch_mask,
          }
  
      return outputs
  
file_path: scenic/scenic/projects/robust_segvit/datasets/cityscapes_variants.py
imports: import functools
  from typing import Optional
  from absl import logging
  from flax import jax_utils
  import jax.numpy
  from scenic.dataset_lib import cityscapes_dataset
  from scenic.dataset_lib import dataset_utils
  from scenic.dataset_lib import datasets
  import tensorflow
  import tensorflow_datasets
label_desc: Use image node_id 2 for calling a global function with example usage: preprocess_example_fishyscapes(example, train, dtype, resize, include_mask) and returns: outputs