original_docstring: Waits for pipeline completion and relays to VertexAIWaiter if it takes too long.
docstring: Waits for pipeline completion and relays to VertexAIWaiter if it takes too long.
docstring_tokens: Waits for pipeline completion and relays to VertexAIWaiter if it takes too long .
code: def _wait_for_job(self, job):
      """Waits for pipeline completion and relays to VertexAIWaiter if it takes too long."""
      delay = 5
      waiting_time = 5
      time.sleep(delay)
      while job.state != js.JobState.JOB_STATE_SUCCEEDED:
        if waiting_time > 300:  # Once 5 minutes have passed, spawn VertexAIWaiter.
          self._enqueue(
            'VertexAIWaiter', {
              'id': job.name, 
              'worker_class': 'VertexAIToBQPredictor'},
            60)
          return
        if delay < 30:
          delay = [5, 10, 15, 20, 30][int(waiting_time / 60)]
        time.sleep(delay)
        waiting_time += delay
      if job.state == js.JobState.JOB_STATE_FAILED:
        raise WorkerException(f'Job {job.name} failed.')
code_tokens: def _wait_for_job ( self , job ) : delay = 5 waiting_time = 5 time . sleep ( delay ) while job . state != js . JobState . JOB_STATE_SUCCEEDED : if waiting_time > 300 : self . _enqueue ( 'VertexAIWaiter' , { 'id' : job . name , 'worker_class' : 'VertexAIToBQPredictor' } , 60 ) return if delay < 30 : delay = [ 5 , 10 , 15 , 20 , 30 ] [ int ( waiting_time / 60 ) ] time . sleep ( delay ) waiting_time += delay if job . state == js . JobState . JOB_STATE_FAILED : raise WorkerException ( f'Job {job.name} failed.' )
short_docstring: Waits for pipeline completion and relays to VertexAIWaiter if it takes too long.
short_docstring_tokens: Waits for pipeline completion and relays to VertexAIWaiter if it takes too long .
comment: """Waits for pipeline completion and relays to VertexAIWaiter if it takes too long."""$SEP$# Once 5 minutes have passed, spawn VertexAIWaiter.