def wait_for_operation_status(self,<EOL>request_id, wait_for_status='<STR_LIT>', timeout=<NUM_LIT:30>, sleep_interval=<NUM_LIT:5>,<EOL>progress_callback=wait_for_operation_status_progress_default_callback,<EOL>success_callback=wait_for_operation_status_success_default_callback,<EOL>failure_callback=wait_for_operation_status_failure_default_callback):
loops = timeout // sleep_interval + <NUM_LIT:1><EOL>start_time = time.time()<EOL>for _ in range(int(loops)):<EOL><INDENT>result = self.get_operation_status(request_id)<EOL>elapsed = time.time() - start_time<EOL>if result.status == wait_for_status:<EOL><INDENT>if success_callback is not None:<EOL><INDENT>success_callback(elapsed)<EOL><DEDENT>return result<EOL><DEDENT>elif result.error:<EOL><INDENT>if failure_callback is not None:<EOL><INDENT>ex = AzureAsyncOperationHttpError(_ERROR_ASYNC_OP_FAILURE, result.status, result)<EOL>failure_callback(elapsed, ex)<EOL><DEDENT>return result<EOL><DEDENT>else:<EOL><INDENT>if progress_callback is not None:<EOL><INDENT>progress_callback(elapsed)<EOL><DEDENT>time.sleep(sleep_interval)<EOL><DEDENT><DEDENT>if failure_callback is not None:<EOL><INDENT>ex = AzureAsyncOperationHttpError(_ERROR_ASYNC_OP_TIMEOUT, result.status, result)<EOL>failure_callback(elapsed, ex)<EOL><DEDENT>return result<EOL>
Waits for an asynchronous operation to complete.

This calls get_operation_status in a loop and returns when the expected
status is reached. The result of get_operation_status is returned. By
default, an exception is raised on timeout or error status.

request_id:
    The request ID for the request you wish to track.
wait_for_status:
    Status to wait for. Default is 'Succeeded'.
timeout:
    Total timeout in seconds. Default is 30s.
sleep_interval:
    Sleep time in seconds for each iteration. Default is 5s.
progress_callback:
    Callback for each iteration.
    Default prints '.'.
    Set it to None for no progress notification.
success_callback:
    Callback on success. Default prints newline.
    Set it to None for no success notification.
failure_callback:
    Callback on failure. Default prints newline+error details then
    raises exception.
    Set it to None for no failure notification.