def METHOD_NAME(text):
    "Add borders above/below text block"
    maxwidth = max(len(line) for line in text.split("\n"))
    sep = "|w" + "~" * maxwidth + "|n"
    text = f"{sep}\n{text}\n{sep}"
    return text