def METHOD_NAME(anthology, srcdir, commit=False):
    mismatched_braces, fixable_braces = set(), set()
    for volume_id, volume in anthology.volumes.items():
        new_abstracts = {}
        if not volume.has_abstracts:
            continue
        for paper in volume:
            if not paper.has_abstract:
                continue
            abstract = paper.get_abstract("xml")
            brace_l = abstract.count("{")
            brace_r = abstract.count("}")
            if brace_l == brace_r:
                continue
            mismatched_braces.add(paper.full_id)
            # Fixing strategy
            if brace_r > brace_l:
                log.warning(
                    f"Can't fix {paper.full_id}: more right braces than left braces"
                )
            else:
                new_abstract = re.sub(r"{\w+\b", fix_texmath, abstract)
                new_abstract = re.sub("{%", "\\%", new_abstract)
                new_abstract = re.sub("{&amp;", "\\&amp;", new_abstract)
                new_abstract = re.sub("{ ", " ", new_abstract)
                brace_l = new_abstract.count("{")
                if brace_r != brace_l:
                    log.warning(
                        f"Can't fix {paper.full_id}: still unbalanced after substitution"
                    )
                else:
                    fixable_braces.add(paper.full_id)
                    new_abstracts[paper.full_id] = new_abstract
        if not (new_abstracts and commit):
            continue
        # Attempt to fix in XML file
        xml_file = os.path.join(srcdir, "xml", f"{volume.collection_id}.xml")
        tree = ET.parse(xml_file)
        root = tree.getroot()
        for full_id, new_abstract in new_abstracts.items():
            paper = anthology.papers[full_id]
            if paper.paper_id == "0":
                node = root.find(f"./volume[@id='{paper.volume_id}']/frontmatter")
                if node is None:  # dummy frontmatter
                    continue
            else:
                node = root.find(
                    f"./volume[@id='{paper.volume_id}']/paper[@id='{paper.paper_id}']"
                )
            if node is None:
                log.error(f"Paper {paper.full_id} not found in {xml_file}")
                continue
            child = node.find("abstract")
            node.remove(child)
            make_simple_element("abstract", new_abstract, parent=node)
        indent(root)
        tree.write(xml_file, encoding="UTF-8", xml_declaration=True)
    if mismatched_braces:
        unfixable_braces = mismatched_braces - fixable_braces
        log.info(
            f"Found {len(mismatched_braces):3d} abstracts with mismatched braces, can auto-fix {len(fixable_braces):3d} of those."
        )
        log.info(f"    Fixable abstracts: {', '.join(sorted(list(fixable_braces)))}")
        log.info(f"  Unfixable abstracts: {', '.join(sorted(list(unfixable_braces)))}")