docstr: Waits for the given file to be processed, default timeout is 30 mins.
docstr_tok: ["Waits","for","the","given","file","to","be","processed",",","default","timeout","is","30","mins","."]
code: def wait_for_processing(
      self,
      id: str,
      *,
      poll_interval: float = 5.0,
      max_wait_seconds: float = 30 * 60,
  ) -> FileObject:
      """Waits for the given file to be processed, default timeout is 30 mins."""
      TERMINAL_STATES = {"processed", "error", "deleted"}
  
      start = time.time()
      file = self.retrieve(id)
      while file.status not in TERMINAL_STATES:
          self._sleep(poll_interval)
  
          file = self.retrieve(id)
          if time.time() - start > max_wait_seconds:
              raise RuntimeError(
                  f"Giving up on waiting for file {id} to finish processing after {max_wait_seconds} seconds."
              )
  
      return file
  
imports: from __future__ import annotations
  import time
  import typing_extensions
  from typing import Mapping, cast
  from typing_extensions import Literal
  import httpx
  from ..None import _legacy_response
  from ..types import FileObject, FileDeleted, file_list_params, file_create_params
  from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
  from .._utils import extract_files, maybe_transform, deepcopy_minimal
  from .._compat import cached_property
  from .._resource import SyncAPIResource, AsyncAPIResource
  from .._response import StreamedBinaryAPIResponse, AsyncStreamedBinaryAPIResponse, to_streamed_response_wrapper, async_to_streamed_response_wrapper, to_custom_streamed_response_wrapper, async_to_custom_streamed_response_wrapper
  from ..pagination import SyncPage, AsyncPage
  from .._base_client import AsyncPaginator, make_request_options
label_desc: Use image node_id 9 for calling the Files obj's underlying member method code with example usage: obj.wait_for_processing(id) and returns: file