code: def is_aip_training_job_running(
      job_id: Text, project_id: Text
  ) -> bool:
      """Non-blocking call that checks if AIP Training job is running.
  
      Args:
          job_id: ID for AIP training job.
          project_id: Project under which the AIP Training job is running.
      Returns:
          True if the job is running, False if it has succeeded, failed, or it was
          cancelled.
      """
      job_name = "projects/{}/jobs/{}".format(project_id, job_id)
      # Disable cache_discovery to remove excessive info logs see:
      # https://github.com/googleapis/google-api-python-client/issues/299
      api_client = discovery.build("ml", "v1", cache_discovery=False)
  
      logging.info("Retrieving status for job %s.", job_name)
  
      request = api_client.projects().jobs().get(name=job_name)
      response = request.execute()
  
      return response["state"] not in (
          "SUCCEEDED",
          "FAILED",
          "CANCELLED",
      )
  
imports: import enum
  import json
  import os
  import sys
  import time
  from typing import Dict, Text, Union
  from ..None import version
  from absl import logging
  from googleapiclient import discovery
  from googleapiclient import errors
  from googleapiclient import http
label_desc: Use image node_id 7 for calling a global function with example usage: is_aip_training_job_running(job_id, project_id) and returns: unknown