code: def input_fn(is_training, data_dir, batch_size):
      filenames = get_filenames(is_training, data_dir)
      dataset = tf.data.Dataset.from_tensor_slices(filenames)
  
      if is_training:
          # Shuffle the input files
          dataset = dataset.shuffle(buffer_size=_NUM_TRAIN_FILES)
  
      # Convert to individual records
      dataset = dataset.interleave(
          tf.data.TFRecordDataset,
          num_parallel_calls=tf.data.experimental.AUTOTUNE,
      )
  
      return process_record_dataset(
          dataset=dataset,
          is_training=is_training,
          batch_size=batch_size,
          shuffle_buffer=_SHUFFLE_BUFFER,
          parse_record_fn=parse_record,
      )
  
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 12 for calling a global function with example usage: input_fn(is_training, data_dir, batch_size) and returns: process_record_dataset