class_docstr: Google Cloud Dataproc APIs.
  
  All the methods in the hook where project_id is used must be called with
  keyword arguments rather than positional.
class_docstr_tok: ["Google","Cloud","Dataproc","APIs",".","All","the","methods","in","the","hook","where","project_id","is","used","must","be","called","with","keyword","arguments","rather","than","positional","."]
docstr: Wait for a long-lasting operation to complete.
code: def wait_for_operation(
      self,
      operation: Operation,
      timeout: float | None = None,
      result_retry: AsyncRetry | _MethodDefault = DEFAULT,
  ) -> Any:
      """Wait for a long-lasting operation to complete."""
      try:
          return operation.result(timeout=timeout, retry=result_retry)
      except Exception:
          error = operation.exception(timeout=timeout)
          raise AirflowException(error)
  
imports: from __future__ import annotations
  import time
  import uuid
  from typing import TYPE_CHECKING, Any, Sequence
  from google.api_core.client_options import ClientOptions
  from google.api_core.exceptions import ServerError
  from google.api_core.gapic_v1.method import DEFAULT, _MethodDefault
  from google.cloud.dataproc_v1 import Batch, BatchControllerAsyncClient, BatchControllerClient, Cluster, ClusterControllerAsyncClient, ClusterControllerClient, Job, JobControllerAsyncClient, JobControllerClient, JobStatus, WorkflowTemplate, WorkflowTemplateServiceAsyncClient, WorkflowTemplateServiceClient
  from airflow.exceptions import AirflowException
  from airflow.providers.google.common.consts import CLIENT_INFO
  from airflow.providers.google.common.hooks.base_google import GoogleBaseHook
  from airflow.version import version
label_desc: Use image node_id 7 for calling the DataprocHook obj's underlying member method code with example usage: obj.wait_for_operation(operation, timeout, result_retry) and returns: operation