code: def _input_fn(
      file_pattern: List[str],
      data_accessor: DataAccessor,
      tf_transform_output: tft.TFTransformOutput,
      is_train: bool = False,
      batch_size: int = 200,
  ) -> tf.data.Dataset:
      """Generates features and label for tuning/training.
  
      Args:
        file_pattern: List of paths or patterns of input tfrecord files.
        data_accessor: DataAccessor for converting input to RecordBatch.
        tf_transform_output: A TFTransformOutput.
        is_train: Whether the input dataset is train split or not.
        batch_size: representing the number of consecutive elements of returned
          dataset to combine in a single batch
  
      Returns:
        A dataset that contains (features, indices) tuple where features is a
          dictionary of Tensors, and indices is a single Tensor of label indices.
      """
      dataset = data_accessor.tf_dataset_factory(
          file_pattern,
          dataset_options.TensorFlowDatasetOptions(
              batch_size=batch_size,
              label_key=_transformed_name(_LABEL_KEY),
          ),
          tf_transform_output.transformed_metadata.schema,
      )
      # Apply data augmentation. We have to do data augmentation here because
      # we need to apply data agumentation on-the-fly during training. If we put
      # it in Transform, it will only be applied once on the whole dataset, which
      # will lose the point of data augmentation.
      if is_train:
          dataset = dataset.map(lambda x, y: (_data_augmentation(x), y))
  
      return dataset
  
imports: import os
  from typing import List
  import absl
  import flatbuffers
  import tensorflow
  import tensorflow_transform
  from tfx.components.trainer.fn_args_utils import DataAccessor
  from tfx.components.trainer.fn_args_utils import FnArgs
  from tfx.components.trainer.rewriting import converters
  from tfx.components.trainer.rewriting import rewriter
  from tfx.components.trainer.rewriting import rewriter_factory
  from tfx.dsl.io import fileio
  from tfx_bsl.tfxio import dataset_options
  from tflite_support import metadata_schema_py_generated
  from tflite_support import metadata
label_desc: Use image node_id 5 for calling a global function with example usage: _input_fn(file_pattern, data_accessor, tf_transform_output, is_train, batch_size) and returns: dataset