code: def get_completed_task(self, task, timeout=-1):
          
          self.__wait_task_completion(task, timeout)
  
          return self.get(task)
docs: Waits until the task is completed and returns the task resource.
  
          Args:
              task: TaskResource
              timeout: Timeout in seconds
  
          Returns:
              dict: TaskResource