code: def _input_fn(
      file_pattern: List[Text],
      tf_transform_output: tft.TFTransformOutput,
      label_key: str,
      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.
          tf_transform_output: A TFTransformOutput.
          label_key: label key.
          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.
      """
      transformed_feature_spec = (
          tf_transform_output.transformed_feature_spec().copy()
      )
  
      dataset = tf.data.experimental.make_batched_features_dataset(
          file_pattern=file_pattern,
          batch_size=batch_size,
          features=transformed_feature_spec,
          reader=_gzip_reader_fn,
          label_key=_transformed_name(label_key),
      )
  
      # If the input dataset is file-based but the number of files is less than
      # the number of workers, an error will be raised. Turning off auto shard
      # policy here so that Dataset will sharded by data instead of by file.
      options = tf.data.Options()
      options.experimental_distribute.auto_shard_policy = (
          tf.data.experimental.AutoShardPolicy.DATA
      )
      dataset = dataset.with_options(options)
  
      return dataset
  
file_path: cloud/src/python/tensorflow_cloud/tuner/cloud_fit_remote.py
imports: import os
  import pickle
  from typing import List, Text
  from absl import app
  from absl import flags
  from absl import logging
  import tensorflow
  import tensorflow_datasets
  import tensorflow_transform
  from tensorflow_cloud.tuner import cloud_fit_utils
label_desc: Use image node_id 3 for calling a global function with example usage: _input_fn(file_pattern, tf_transform_output, label_key, batch_size) and returns: dataset