docs: def delete_messages(self, only_processed=True):
          """Delete the messages previously leased.
  
          Unless otherwise directed, only the messages iterated over will be
          deleted.
          """
          messages = self._processed_messages
          if not only_processed:
              messages += self._messages
  
          if messages:
              try:
                  self.queue.delete_tasks(messages)
              except Exception:
                  logging.exception("Error deleting messages")
                  raise