def speech_bubble(msg_lines):
    """Wraps the lines of a message in an ASCII speech bubble."""
    msg_width = max([len(x) for x in msg_lines])
    lines = []
    lines.append("   " + (msg_width + 2) * "_" + " ")
    lines.append("  /" + (msg_width + 2) * " " + "\\")
    for line in msg_lines:
        lines.append("  | " + line.center(msg_width) + " |")
    lines.append("  \\" + (msg_width + 2) * "_" + "/")
    return lines