async def _run_retry_async(self, func: Callable[[_M], Awaitable[_R]], request: _M) -> _R:
        """Runs an asyncio callable and retries with exponential backoff."""
        # Start with a 100ms retry delay with exponential backoff to
        # max_retry_delay_seconds
        current_delay = 0.1

        while True:
            try:
                return await self._executor.submit(func, request)
            except GoogleAPICallError as err:
                message = err.message
                # Raise RuntimeError for exceptions that are not retryable.
                # Otherwise, pass through to retry.
                if err.code not in RETRYABLE_ERROR_CODES:
                    raise EngineException(message) from err

            if current_delay > self.max_retry_delay_seconds:
                raise TimeoutError(f'Reached max retry attempts for error: {message}')
            if self.verbose:
                print(message, file=sys.stderr)
                print(f'Waiting {current_delay} seconds before retrying.', file=sys.stderr)
            await duet.sleep(current_delay)
            current_delay *= 2
Runs an asyncio callable and retries with exponential backoff.
cirq-google/cirq_google/engine/engine_client.py