code: def parse_record(raw_record, is_training, dtype):
      """Parses a record containing a training example of an image.
  
      The input record is parsed into a label and image, and the image is passed
      through preprocessing steps (cropping, flipping, and so on).
  
      Args:
        raw_record: scalar Tensor tf.string containing a serialized
          Example protocol buffer.
        is_training: A boolean denoting whether the input is for training.
        dtype: data type to use for images/features.
  
      Returns:
        Tuple with processed image tensor and one-hot-encoded label tensor.
      """
      image_buffer, label, bbox = _parse_example_proto(raw_record)
  
      image = preprocess_image(
          image_buffer=image_buffer,
          bbox=bbox,
          output_height=DEFAULT_IMAGE_SIZE,
          output_width=DEFAULT_IMAGE_SIZE,
          num_channels=NUM_CHANNELS,
          is_training=is_training,
      )
      image = tf.cast(image, dtype)
  
      # Subtract one so that labels are in [0, 1000), and cast to float32 for
      # Keras model.
      label = tf.cast(
          tf.cast(tf.reshape(label, shape=[1]), dtype=tf.int32) - 1,
          dtype=tf.float32,
      )
      return image, label
  
file_path: autodist/examples/benchmark/utils/imagenet_preprocessing.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from absl import logging
  import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: parse_record(raw_record, is_training, dtype) and returns: image,  label