code: def process_record_dataset(
      dataset, is_training, shuffle_buffer, parse_record_fn, dtype=None
  ):
      if dtype is None:
          dtype = tf.float32
  
      if is_training:
          dataset = dataset.shuffle(buffer_size=shuffle_buffer)
  
      dataset = dataset.map(
          lambda value: parse_record_fn(value, is_training, dtype)
      )
  
      dataset = dataset.prefetch(
          buffer_size=tf.data.experimental.AUTOTUNE
      )
  
      return dataset
  
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 4 for calling a global function with example usage: process_record_dataset(dataset, is_training, shuffle_buffer, parse_record_fn, dtype) and returns: dataset