code: def clear(self):
          
          for key in list(self.queue.keys()):
              if self.queue[key]['status'] in ['done', 'failed']:
                  del self.queue[key]
          self.write()
docs: Remove all completed tasks from the queue.