def METHOD_NAME(self, tree):
    gold_tree = tree.bundle.get_tree(self.gold_zone)
    if tree == gold_tree:
        return
    if not self.add:
        for node in tree.descendants + gold_tree.descendants:
            del node.misc['Mark']
            del node.misc['ToDo']
            del node.misc['Bug']
    pred_nodes, gold_nodes = tree.descendants, gold_tree.descendants
    # Make sure both pred and gold trees are marked, even if one has just deleted nodes.
    if len(pred_nodes) != len(gold_nodes):
        tree.add_comment('Mark = %s' % self.mark)
        gold_tree.add_comment('Mark = %s' % self.mark)
    pred_tokens = ['_'.join(n.get_attrs(self.attrs)) for n in pred_nodes]
    gold_tokens = ['_'.join(n.get_attrs(self.attrs)) for n in gold_nodes]
    matcher = difflib.SequenceMatcher(None, pred_tokens, gold_tokens, autojunk=False)
    diffs = list(matcher.get_opcodes())
    alignment = {-1: -1}
    for diff in diffs:
        edit, pred_lo, pred_hi, gold_lo, gold_hi = diff
        if edit in {'equal', 'replace'}:
            for i in range(pred_lo, pred_hi):
                alignment[i] = i - pred_lo + gold_lo
    for diff in diffs:
        edit, pred_lo, pred_hi, gold_lo, gold_hi = diff
        if edit == 'equal':
            for p_node, g_node in zip(pred_nodes[pred_lo:pred_hi], gold_nodes[gold_lo:gold_hi]):
                if not self.ignore_parent and alignment.get(p_node.parent.ord - 1) != g_node.parent.ord - 1:
                    p_node.misc['Mark'] = self.mark
                    g_node.misc['Mark'] = self.mark
                    self.stats['ONLY-PARENT-CHANGED'] += 1
        else:
            for node in pred_nodes[pred_lo:pred_hi] + gold_nodes[gold_lo:gold_hi]:
                node.misc['Mark'] = self.mark
            if self.print_stats:
                if edit == 'replace':
                    # first n nodes are treated as aligned, the rest is treated as ADDED/DELETED
                    n = min(pred_hi - pred_lo, gold_hi - gold_lo)
                    for p_node, g_node in zip(pred_nodes[pred_lo:pred_lo + n], gold_nodes[gold_lo:gold_lo + n]):
                        for attr in self.attrs:
                            p_value, g_value = p_node._get_attr(attr), g_node._get_attr(attr)
                            if p_value != g_value:
                                self.stats[f'{attr.upper()}: {p_value} -> {g_value}'] += 1
                        if not self.ignore_parent and alignment.get(p_node.parent.ord - 1) != g_node.parent.ord - 1:
                            self.stats['PARENT-CHANGED'] += 1
                    pred_lo, gold_lo = pred_lo + n, gold_lo + n
                for node in gold_nodes[gold_lo:gold_hi]:
                    self.stats['ADD-WORD'] += 1
                    self.stats['ADD-LEMMA: ' + node.lemma] += 1
                for node in pred_nodes[pred_lo:pred_hi]:
                    self.stats['DELETE-WORD'] += 1
                    self.stats['DELETE-LEMMA: ' + node.lemma] += 1