code: def _make_one_hot(x, key):
      """Make a one-hot tensor to encode categorical features.
  
      Args:
        x: A dense tensor
        key: A string key for the feature in the input
  
      Returns:
        A dense one-hot tensor as a float list
      """
      integerized = tft.compute_and_apply_vocabulary(
          x,
          top_k=_VOCAB_SIZE,
          num_oov_buckets=_OOV_SIZE,
          vocab_filename=key,
          name=key,
      )
      depth = (
          tft.experimental.get_vocabulary_size_by_name(key) + _OOV_SIZE
      )
      one_hot_encoded = tf.one_hot(
          integerized,
          depth=tf.cast(depth, tf.int32),
          on_value=1.0,
          off_value=0.0,
      )
      return tf.reshape(one_hot_encoded, [-1, depth])
  
imports: from typing import List
  import absl
  from keras.callbacks import LambdaCallback
  import tensorflow
  import tensorflow_transform
  from tfx.components.trainer.executor import TrainerFnArgs
  from tfx.components.trainer.fn_args_utils import DataAccessor
  from tfx_bsl.tfxio import dataset_options
label_desc: Use image node_id 2 for calling a global function with example usage: _make_one_hot(x, key) and returns: tf