class_docstr: Hook for Google Cloud Vertex AI Custom Job APIs.
docstr: Waits for long-lasting operation to complete.
docstr_tok: ["Waits","for","long-lasting","operation","to","complete","."]
code: def wait_for_operation(
      self, operation: Operation, timeout: float | None = None
  ):
      """Waits for long-lasting operation to complete."""
      try:
          return operation.result(timeout=timeout)
      except Exception:
          error = operation.exception(timeout=timeout)
          raise AirflowException(error)
  
imports: from __future__ import annotations
  import warnings
  from typing import TYPE_CHECKING, Sequence
  from google.api_core.client_options import ClientOptions
  from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
  from google.cloud.aiplatform import CustomContainerTrainingJob, CustomPythonPackageTrainingJob, CustomTrainingJob, datasets, models
  from google.cloud.aiplatform_v1 import JobServiceClient, PipelineServiceClient
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.providers.google.common.consts import CLIENT_INFO
  from airflow.providers.google.common.hooks.base_google import GoogleBaseHook
label_desc: Use image node_id 10 for calling the CustomJobHook obj's underlying member method code with example usage: obj.wait_for_operation(operation, timeout) and returns: operation