def fix_overline_underscores(text: str) -> str:
    """Puts underscores that are outside \overline within overline."""
    pattern = r"\\overline\{([^}]*)\}_([^{}\\ ]*)"
    return re.sub(pattern, r"\\overline{\1_\2}", text)
Puts underscores that are outside \overline within overline.
vlmeval/dataset/utils/megabench/scoring/common/transformations.py