code: def _preprocess_image(
      image_bytes: tf.Tensor,
      is_training: bool,
  ) -> tf.Tensor:
      """Returns processed and resized images."""
      if is_training:
          image = _decode_and_random_crop(image_bytes)
          image = tf.image.random_flip_left_right(image)
      else:
          image = _decode_and_center_crop(image_bytes)
      assert image.dtype == tf.uint8
      # NOTE: Bicubic resize (1) casts uint8 to float32 and (2) resizes without
      # clamping overshoots. This means values returned will be outside the range
      # [0.0, 255.0].
      image = tf.image.resize(
          image, [IMAGE_SIZE, IMAGE_SIZE], tf.image.ResizeMethod.BICUBIC
      )
      image = _normalize_image(image)
      return image
  
file_path: objax/examples/image_classification/imagenet_resnet50_data.py
imports: import enum
  from typing import Optional, Sequence, Tuple
  import jax
  import numpy
  import tensorflow.compat.v2
  import tensorflow_datasets
label_desc: Use image node_id 5 for calling a global function with example usage: _preprocess_image(image_bytes, is_training) and returns: image