def _wait_until_complete(operation, max_attempts=5):
 def _operation_complete(result):
  return result
 retry = RetryResult(_operation_complete, max_tries=max_attempts)
 return retry(operation.poll)()

def _wait_until_complete ( operation , max_attempts = 5 ) : def _operation_complete ( result ) : return result retry = RetryResult ( _operation_complete , max_tries = max_attempts ) return retry ( operation . poll ) ( )
wait until an operation has completed .