code: def create_model_for_aip_prediction_if_not_exist(
      labels: Dict[str, str],
      ai_platform_serving_args: Dict[str, Any],
      api: Optional[discovery.Resource] = None,
      enable_vertex: Optional[bool] = False,
  ) -> bool:
      """Creates a new CAIP model or Vertex endpoint for serving with AI Platform if not exists.
  
      Args:
        labels: The dict of labels that will be attached to this CAIP job or Vertex
          endpoint.
        ai_platform_serving_args: Dictionary containing arguments for pushing to AI
          Platform.
        api: (CAIP only, required) Google API client resource.
        enable_vertex: Whether to enable Vertex or not.
  
      Returns:
        Whether a new CAIP model or Vertex endpoint is created.
  
      Raises:
        RuntimeError if creation failed.
      """
  
      client = prediction_clients.get_prediction_client(
          api=api, enable_vertex=enable_vertex
      )
      return client.create_model_for_aip_prediction_if_not_exist(
          labels=labels,
          ai_platform_serving_args=ai_platform_serving_args,
      )
  
file_path: tfx/tfx/extensions/google_cloud_ai_platform/runner.py
imports: import time
  from typing import Any, Dict, List, Optional
  from absl import logging
  from googleapiclient import discovery
  from tfx import types
  from tfx.extensions.google_cloud_ai_platform import prediction_clients
  from tfx.extensions.google_cloud_ai_platform import training_clients
  from tfx.utils import version_utils
label_desc: Use image node_id 5 for calling a global function with example usage: create_model_for_aip_prediction_if_not_exist(labels, ai_platform_serving_args, api, enable_vertex) and returns: client