def prepareLogMessage(self, template, message, jobs):
        result = ""

        inDescriptionSection = False

        for line in template.split("\n"):
            if line.startswith("#"):
                result += line + "\n"
                continue

            if inDescriptionSection:
                if line.startswith("Files:") or line.startswith("Jobs:"):
                    inDescriptionSection = False
                    # insert Jobs section
                    if jobs:
                        result += jobs + "\n"
                else:
                    continue
            else:
                if line.startswith("Description:"):
                    inDescriptionSection = True
                    line += "\n"
                    for messageLine in message.split("\n"):
                        line += "\t" + messageLine + "\n"

            result += line + "\n"

        return result
Reverse the object or return an iterator the iterates over it the other
dataset/ETHPy150Open zulip/zulip/api/integrations/perforce/git_p4.py/P4Submit.prepareLogMessage--crossover with--dataset/ETHPy150Open IanLewis/kay/kay/lib/jinja2/filters.py/do_reverse