code: def purge(self):
      
      try:
        return self._api.purge()
      except AttributeError:
        while True:
          lst = self.list()
          if len(lst) == 0:
            break
  
          for task in lst:
            self.delete(task)
          self.wait()
        return self
docs: Deletes all tasks in the queue.