code: def _input_fn(
      file_pattern: str,
      data_accessor: DataAccessor,
      schema: schema_pb2.Schema,
      batch_size: int = 20,
  ) -> Tuple[np.ndarray, np.ndarray]:
      """Generates features and label for tuning/training.
  
      Args:
        file_pattern: input tfrecord file pattern.
        data_accessor: DataAccessor for converting input to RecordBatch.
        schema: schema of the input data.
        batch_size: An int representing the number of records to combine in a single
          batch.
  
      Returns:
        A (features, indices) tuple where features is a matrix of features, and
          indices is a single vector of label indices.
      """
      record_batch_iterator = data_accessor.record_batch_factory(
          file_pattern,
          dataset_options.RecordBatchesOptions(
              batch_size=batch_size, num_epochs=1
          ),
          schema,
      )
  
      feature_list = []
      label_list = []
      for record_batch in record_batch_iterator:
          record_dict = {}
          for column, field in zip(record_batch, record_batch.schema):
              record_dict[field.name] = column.flatten()
  
          label_list.append(record_dict[_LABEL_KEY])
          features = [record_dict[key] for key in _FEATURE_KEYS]
          feature_list.append(np.stack(features, axis=-1))
  
      return np.concatenate(feature_list), np.concatenate(label_list)
  
file_path: tfx/tfx/examples/penguin/experimental/penguin_utils_sklearn.py
imports: import os
  import pickle
  from typing import Tuple
  import absl
  import numpy
  from sklearn.neural_network import MLPClassifier
  from sklearn.pipeline import Pipeline
  from sklearn.preprocessing import StandardScaler
  from tfx.components.trainer.fn_args_utils import DataAccessor
  from tfx.components.trainer.fn_args_utils import FnArgs
  from tfx.dsl.io import fileio
  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: np,  np