code: def _do_aiplatform_inference(model, version, serialized_examples):
      """Performs inference on the model:version in AI Platform."""
      working_dir = tempfile.mkdtemp()
      instances_file = os.path.join(working_dir, "test.json")
      json_examples = []
      for serialized_example in serialized_examples:
          # The encoding follows the example in:
          # https://github.com/GoogleCloudPlatform/training-data-analyst/blob/master/quests/tpu/invoke_model.py
          json_examples.append(
              '{ "inputs": { "b64": "%s" } }'
              % base64.b64encode(serialized_example).decode("utf-8")
          )
      file_io.write_string_to_file(
          instances_file, "\n".join(json_examples)
      )
      gcloud_command = [
          "gcloud",
          "ai-platform",
          "predict",
          "--model",
          model,
          "--version",
          version,
          "--json-instances",
          instances_file,
      ]
      print(subprocess.check_output(gcloud_command))
  
imports: import argparse
  import base64
  import csv
  import json
  import os
  import subprocess
  import tempfile
  from typing import List
  from absl import app
  from absl.flags import argparse_flags
  import requests
  import tensorflow_data_validation
  from tensorflow_transform import coders
  from tensorflow_transform.tf_metadata import schema_utils
  from google.protobuf import text_format
  from tensorflow.python.lib.io import file_io
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 5 for calling a global function with example usage: _do_aiplatform_inference(model, version, serialized_examples) without return types