def METHOD_NAME(desc):
    # First, remove page header/footer
    desc = header_footer_regex.sub("", desc)
    # Next, combine lines that are separated by a singular newline
    desc = re.sub(r"(?<!\n)\n(?!\n)", " ", desc, flags=re.MULTILINE)
    # Remove leftovers from diagrams
    p = r"^(?:(?:\b\w+?\b\s*?){1,2}|.)$\n{2}"
    desc = re.sub(p, "", desc, flags=re.MULTILINE)
    return desc