code: def testBuildRequests_PredictMethod(self):
      builder = request_builder._TFServingRpcRequestBuilder(
          model_name="foo",
          signatures={
              # Has only one argument with dtype=DT_STRING and shape=(None,).
              # This is the only valid form that InfraValidator accepts today.
              "serving_default": _make_signature_def(
                  {
                      "method_name": "tensorflow/serving/predict",
                      "inputs": {
                          "x": {
                              "name": "serving_default_examples:0",
                              "dtype": "DT_STRING",
                              "tensor_shape": {
                                  "dim": [
                                      {"size": -1},
                                  ]
                              },
                          }
                      },
                      "outputs": {
                          "y": {
                              "name": "StatefulPartitionedCall:0",
                              "dtype": "DT_FLOAT",
                              "tensor_shape": {
                                  "dim": [
                                      {"size": -1},
                                      {"size": 10},
                                  ]
                              },
                          }
                      },
                  }
              )
          },
      )
      builder.ReadExamplesArtifact(self._examples, num_examples=1)
  
      result = builder.BuildRequests()
  
      self.assertEqual(len(result), 1)
      self.assertIsInstance(result[0], predict_pb2.PredictRequest)
      self.assertEqual(
          result[0].inputs["x"].dtype, tf.dtypes.string.as_datatype_enum
      )
  
imports: import os
  from typing import Any, Dict
  from unittest import mock
  import tensorflow
  from tfx.components.infra_validator import request_builder
  from tfx.proto import infra_validator_pb2
  from tfx.types import artifact_utils
  from tfx.types import standard_artifacts
  from tfx.utils import path_utils
  from google.protobuf import json_format
  from tensorflow.core.protobuf import meta_graph_pb2
  from tensorflow.core.protobuf import saved_model_pb2
  from tensorflow_serving.apis import classification_pb2
  from tensorflow_serving.apis import predict_pb2
  from tensorflow_serving.apis import regression_pb2
label_desc: Use image node_id 9 for calling the TFServingRpcRequestBuilderTest obj's underlying member method code with example usage: obj.testBuildRequests_PredictMethod() without return types