code: def preprocess_image(
      image_buffer,
      output_height,
      output_width,
      num_channels=_NUM_CHANNELS,
      is_training=False,
  ):
      if is_training:
          return preprocess_for_train(
              image_buffer, output_height, output_width, num_channels
          )
      else:
          return preprocess_for_eval(
              image_buffer, output_height, output_width, num_channels
          )
  
imports: import os
  import argparse
  from optparse import OptionParser
  from bigdl.dllib.nncontext import *
  from bigdl.dllib.feature.image import *
  from bigdl.dllib.keras.metrics import *
  from bigdl.dllib.nnframes import *
  from bigdl.dllib.utils.log4Error import invalidInputError
  from bigdl.orca import init_orca_context, stop_orca_context
  from bigdl.orca.learn.tf.estimator import Estimator
  from bigdl.orca.learn.trigger import EveryEpoch, SeveralIteration
  from bigdl.orca.data.image import write_tfrecord, read_tfrecord
  from inception_preprocessing import preprocess_for_train, preprocess_for_eval
  from tensorflow.contrib.slim.python.slim.nets import inception_v1
  import tensorflow
  from math import ceil
label_desc: Use image node_id 1 for calling a global function with example usage: preprocess_image(image_buffer, output_height, output_width, num_channels, is_training) and returns: preprocess_for_train, preprocess_for_eval