code: def preprocess_image(
      image_buffer,
      output_height,
      output_width,
      num_channels,
      is_training=False,
  ):
      if is_training:
          # For training, we want to randomize some of the distortions.
          image = _decode_crop_and_flip(image_buffer, num_channels)
  
          image = _resize_image(image, output_height, output_width)
      else:
          # For validation, we want to decode, resize, then just crop the middle.
          image = tf.image.decode_jpeg(
              image_buffer, channels=num_channels
          )
          image = _aspect_preserving_resize(image, _RESIZE_MIN)
          image = _central_crop(image, output_height, output_width)
  
      image.set_shape([output_height, output_width, num_channels])
  
      return _mean_image_subtraction(
          image, _CHANNEL_MEANS, num_channels
      )
  
imports: import os
  import argparse
  import tensorflow
  from bigdl.dllib.utils.log4Error import invalidInputError
  from bigdl.orca import init_orca_context, stop_orca_context
label_desc: Use image node_id 7 for calling a global function with example usage: preprocess_image(image_buffer, output_height, output_width, num_channels, is_training) and returns: _mean_image_subtraction