code: def create_keras_inputs(
      context_features, example_features, size_feature_name=None
  ):
      """Create Keras input layers."""
      context_keras_inputs, example_keras_inputs = {}, {}
      # Create Keras inputs for context features.
      for feature in context_features:
          context_keras_inputs[feature.name] = tf.keras.Input(
              name=feature.name,
              shape=(None,),
              dtype=feature.dtype,
              ragged=True,
          )
  
      for feature in example_features:
          example_keras_inputs[feature.name] = tf.keras.Input(
              name=feature.name,
              shape=(None, None),
              dtype=feature.dtype,
              ragged=True,
          )
  
      if size_feature_name is not None:
          context_keras_inputs[size_feature_name] = tf.keras.Input(
              name=size_feature_name,
              shape=(None,),
              dtype=tf.int64,
              ragged=True,
          )
  
      return context_keras_inputs, example_keras_inputs
  
file_path: tfx/tfx/examples/ranking/struct2tensor_parsing_utils.py
imports: import itertools
  from typing import Dict, List, Optional, Union
  from struct2tensor import calculate
  from struct2tensor import calculate_options
  from struct2tensor import path
  from struct2tensor import prensor_util
  from struct2tensor.expression_impl import proto
  import tensorflow
  from tfx_bsl.public import tfxio
  from tensorflow_serving.apis import input_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: create_keras_inputs(context_features, example_features, size_feature_name) and returns: context_keras_inputs,  example_keras_inputs