code: def create_keras_inputs(
      context_feature_columns,
      example_feature_columns,
      size_feature_name,
      list_size=None,
  ):
      """Create Keras inputs from context and example feature columns.
  
      Args:
        context_feature_columns: (dict) context feature names to columns.
        example_feature_columns: (dict) example feature names to columns.
        size_feature_name: (str) Name of feature for example list sizes. If not
          None, this feature name corresponds to a `tf.int32` Tensor of size
          [batch_size] corresponding to sizes of example lists.
        list_size: (int) The list size for example features. If None, use dynamic
          list size. A fixed list size is required for TPU training.
  
      Returns:
        A dict mapping feature names to Keras Input tensors.
      """
      context_feature_spec = tf.feature_column.make_parse_example_spec(
          context_feature_columns.values()
      )
      example_feature_spec = tf.feature_column.make_parse_example_spec(
          example_feature_columns.values()
      )
  
      inputs_dict = {}
      # Create Keras inputs for context features.
      for name, spec in six.iteritems(context_feature_spec):
          is_sparse = isinstance(spec, tf.io.VarLenFeature)
          shape = spec.shape if not is_sparse else (1,)
          inputs_dict[name] = tf.keras.Input(
              name=name, shape=shape, dtype=spec.dtype, sparse=is_sparse
          )
  
      # Create Keras inputs for example features.
      for name, spec in six.iteritems(example_feature_spec):
          is_sparse = isinstance(spec, tf.io.VarLenFeature)
          shape = (
              [list_size] + list(spec.shape)
              if not is_sparse
              else (list_size, 1)
          )
          inputs_dict[name] = tf.keras.Input(
              name=name, shape=shape, dtype=spec.dtype, sparse=is_sparse
          )
  
      # Add size feature information.
      if size_feature_name is not None:
          inputs_dict[size_feature_name] = tf.keras.Input(
              name=size_feature_name, shape=(), dtype=tf.int32
          )
      return inputs_dict
  
imports: import six
  import tensorflow.compat.v2
  from tensorflow.python.feature_column import feature_column_lib
  from tensorflow_ranking.python import utils
label_desc: Use image node_id 3 for calling a global function with example usage: create_keras_inputs(context_feature_columns, example_feature_columns, size_feature_name, list_size) and returns: inputs_dict