code: def _build_keras_model(
      hidden_units: List[int] = None,
  ) -> tf.keras.Model:
      """Creates a DNN Keras model for classifying taxi data.
  
      Args:
        hidden_units: [int], the layer sizes of the DNN (input layer first).
  
      Returns:
        A keras Model.
      """
      real_valued_columns = [
          tf.feature_column.numeric_column(key, shape=())
          for key in _transformed_names(_DENSE_FLOAT_FEATURE_KEYS)
      ]
      categorical_columns = [
          tf.feature_column.categorical_column_with_identity(
              key, num_buckets=_VOCAB_SIZE + _OOV_SIZE, default_value=0
          )
          for key in _transformed_names(_VOCAB_FEATURE_KEYS)
      ]
      categorical_columns += [
          tf.feature_column.categorical_column_with_identity(
              key, num_buckets=_FEATURE_BUCKET_COUNT, default_value=0
          )
          for key in _transformed_names(_BUCKET_FEATURE_KEYS)
      ]
      categorical_columns += [
          tf.feature_column.categorical_column_with_identity(  # pylint: disable=g-complex-comprehension
              key, num_buckets=num_buckets, default_value=0
          )
          for key, num_buckets in zip(
              _transformed_names(_CATEGORICAL_FEATURE_KEYS),
              _MAX_CATEGORICAL_FEATURE_VALUES,
          )
      ]
      indicator_column = [
          tf.feature_column.indicator_column(categorical_column)
          for categorical_column in categorical_columns
      ]
  
      model = _wide_and_deep_classifier(
          # TODO(b/139668410) replace with premade wide_and_deep keras model
          wide_columns=indicator_column,
          deep_columns=real_valued_columns,
          dnn_hidden_units=hidden_units or [100, 70, 50, 25],
      )
      return model
  
file_path: tfx/tfx/examples/chicago_taxi_pipeline/taxi_utils_native_keras.py
imports: from typing import List
  from absl import logging
  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_bsl.tfxio import dataset_options
label_desc: Use image node_id 7 for calling a global function with example usage: _build_keras_model(hidden_units) and returns: model