docs: def _prune_node(self, node):
          """
          Prune the given node if context exits cleanly.
          """
          if self.is_pruning:
              # node is mutable, so capture the key for later pruning now
              prune_key, node_body = self._node_to_db_mapping(node)
              should_prune = (node_body is not None)
          else:
              should_prune = False
  
          yield
  
          # Prune only if no exception is raised
          if should_prune:
              del self.db[prune_key]