docs: def discard_unused_messages(self, ending_tier):
          """
          Delete messages from errors, warnings, and notices whose tier is
          greater than the ending tier.
          """
  
          stacks = [self.errors, self.warnings, self.notices]
          for stack in stacks:
              for message in stack:
                  if message['tier'] > ending_tier:
                      stack.remove(message)