def METHOD_NAME(record):
    out = []
    for script in record.get("scripts", []):
        if "output" in script:
            scriptout = [
                line
                for line in (line.strip() for line in script["output"].splitlines())
                if line
            ]
            if not scriptout:
                scriptout = ""
            elif len(scriptout) == 1:
                scriptout = " " + scriptout[0]
            else:
                scriptout = "\n\t\t\t%s" % "\n\t\t\t".join(scriptout)
        else:
            scriptout = ""
        out.append("\t\t%s:%s\n" % (script["id"], scriptout))
    return out