def METHOD_NAME(template_path: str, title: str, pr_num: int) -> str:
    """Fills out template TODO fields."""
    with open(template_path) as template_file:
        content = template_file.read()
    content = re.sub(r"^# TODO\n", "# %s\n" % title, content)
    content = re.sub(
        r"(https://github.com/[^/]+/[^/]+/pull/)####",
        r"\g<1>%d" % pr_num,
        content,
    )
    content = re.sub(r"\n## TODO(?:.|\n)*?(\n## )", r"\1", content)
    return content