code: def is_successful(self, retry=False):
          
  
          if not self.is_terminated(retry=retry):
              return False
          retry_num = options.retry_times
          while retry_num > 0:
              try:
                  statuses = self.get_task_statuses()
                  return all(task.status == Instance.Task.TaskStatus.SUCCESS
                             for task in statuses.values())
              except (errors.InternalServerError, errors.RequestTimeTooSkewed):
                  retry_num -= 1
                  if not retry or retry_num <= 0:
                      raise
docs: If the instance runs successfully.
  
          :return: True if successful else False
          :rtype: bool