code: def _input_fn(
      file_pattern: List[str],
      data_accessor: DataAccessor,
      schema: schema_pb2.Schema,
      batch_size: int = 20,
  ) -> 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.
        schema: Schema of the input data.
        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.
      """
      return data_accessor.tf_dataset_factory(
          file_pattern,
          dataset_options.TensorFlowDatasetOptions(
              batch_size=batch_size, label_key=_LABEL_KEY
          ),
          schema,
      ).repeat()
  
file_path: tfx/tfx/components/testdata/module_file/tuner_module.py
imports: from typing import List
  import absl
  import keras_tuner
  import tensorflow
  from tensorflow import keras
  from tfx.components.trainer.fn_args_utils import DataAccessor
  from tfx.components.trainer.fn_args_utils import FnArgs
  from tfx.components.tuner.component import TunerFnResult
  from tfx.utils import io_utils
  from tfx_bsl.tfxio import dataset_options
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: _input_fn(file_pattern, data_accessor, schema, batch_size) and returns: data_accessor