code: def test_preprocessor_with_spec(self):
      def context_embedding(x):
          return tf.reduce_mean(
              tf.keras.layers.Embedding(input_dim=10, output_dim=4)(x),
              axis=-2,
          )
  
      preprocess_spec = {
          "context_1": context_embedding,
      }
      default_value_spec = {
          "feature_1": -1.0,
      }
      preprocessor = model_lib.PreprocessorWithSpec(
          preprocess_spec, default_value_spec
      )
      context_features, example_features = preprocessor(
          {
              "context_1": tf.ragged.constant([[3, 1, 4, 1]]),
          },
          example_inputs={
              "feature_1": tf.ragged.constant([[1.0, 2.0]]),
          },
          mask=[[True, True, True]],
      )
      self.assertAllClose(
          example_features["feature_1"].numpy(), [[1.0, 2.0, -1.0]]
      )
      self.assertAllClose(
          context_features["context_1"].get_shape().as_list(), [1, 4]
      )
  
imports: from absl.testing import parameterized
  import tensorflow
  from google.protobuf import text_format
  from tensorflow_ranking.python import data
  from tensorflow_ranking.python.keras import feature
  from tensorflow_ranking.python.keras import losses
  from tensorflow_ranking.python.keras import metrics
  from tensorflow_ranking.python.keras import model
  from tensorflow_ranking.python.keras import network
  from tensorflow_serving.apis import input_pb2
label_desc: Use image node_id 1 for calling the PreprocessorTest obj's underlying member method code with example usage: obj.test_preprocessor_with_spec() and returns: tf