class_docstr: Class for interacting with CAIP Prediction service.
class_docstr_tok: ["Class","for","interacting","with","CAIP","Prediction","service","."]
docstr: Wait for a long running operation.
  
  Args:
    operation: The operation to wait for.
    method_name: Operation method name for logging.
  
  Returns:
    Operation completion status.
  
  Raises:
    RuntimeError: If the operation completed with an error.
docstr_tok: ["Wait","for","a","long","running","operation",".","Args",":","operation",":","The","operation","to","wait","for",".","method_name",":","Operation","method","name","for","logging",".","Returns",":","Operation","completion","status",".","Raises",":","RuntimeError",":","If","the","operation","completed","with","an","error","."]
code: def _wait_for_operation(
      self, operation: Dict[str, Any], method_name: str
  ) -> Dict[str, Any]:
      """Wait for a long running operation.
  
      Args:
        operation: The operation to wait for.
        method_name: Operation method name for logging.
  
      Returns:
        Operation completion status.
  
      Raises:
        RuntimeError: If the operation completed with an error.
      """
      status_resc = (
          self._client.projects()
          .operations()
          .get(name=operation["name"])
      )
      while not status_resc.execute().get("done"):
          time.sleep(_POLLING_INTERVAL_IN_SECONDS)
          logging.info("Method %s still being executed...", method_name)
      result = status_resc.execute()
      if result.get("error"):
          # The operation completed with an error.
          raise RuntimeError(
              "Failed to execute {}: {}".format(
                  method_name, result["error"]
              )
          )
      return result
  
imports: import abc
  import sys
  import time
  from typing import Any, Dict, Optional, Union
  from absl import logging
  from google.cloud import aiplatform
  from googleapiclient import discovery
  from googleapiclient import errors
  import tensorflow
label_desc: Use image node_id 4 for calling the CAIPTfxPredictionClient obj's underlying member method code with example usage: obj._wait_for_operation(operation, method_name) and returns: result