code: def preprocess_parsed_example(
      image_buffer,
      label,
      is_training,
      dtype,
      num_classes,
      one_hot=False,
  ):
      """Applies preprocessing steps to the input parsed example."""
      image = preprocess_image(
          image_buffer=image_buffer,
          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.reshape(label, shape=[1])
      label = tf.cast(label, tf.int32)
      label -= 1
  
      if one_hot:
          label = tf.one_hot(label, num_classes)
          label = tf.reshape(label, [num_classes])
      else:
          label = tf.cast(label, tf.float32)
  
      return image, label
  
file_path: ray/release/air_tests/air_benchmarks/mlperf-train/tf_utils.py
imports: import tensorflow
  import functools
  import logging
label_desc: Use image node_id 4 for calling a global function with example usage: preprocess_parsed_example(image_buffer, label, is_training, dtype, num_classes, one_hot) and returns: image,  label