def wait_until_final(self, poll_interval=<NUM_LIT:1>, timeout=<NUM_LIT>):
start_time = time.time()<EOL>elapsed = <NUM_LIT:0><EOL>while (self.status != "<STR_LIT>" and<EOL>(timeout <= <NUM_LIT:0> or elapsed < timeout)):<EOL><INDENT>time.sleep(poll_interval)<EOL>self.refresh()<EOL>elapsed = time.time() - start_time<EOL><DEDENT>
It will poll the URL to grab the latest status resource in a given
        timeout and time interval.

        Args:
            poll_interval (int): how often to poll the status service.
            timeout (int): how long to poll the URL until giving up. Use <= 0
                to wait forever