@staticmethod
    def format_change(change, bots, usecolor, currentpatch, patchnum):
        print (format_color("Change %s (%s)" % (change.url, change.id),
                            usecolor,
                            fg="red",
                            styles=["bold"]))
        print ("")
        print ("  %s" % change.subject)
        print ("")
        print ("")

        patches = change.patches
        if currentpatch:
            patches = patches[-1:]
        elif patchnum:
            patches = patches[patchnum-1:patchnum]

        for patch in patches:
            print (format_color("Patch %d (%s)" % (patch.number, patch.revision),
                                usecolor,
                                fg="blue",
                                styles=["bold"]))
            print ("")
            comments = []
            comments.extend(patch.comments)

            prefix = "Patch Set %d:" % patch.number
            abandoned = 0
            for comment in change.comments:
                if comment.message.startswith(prefix):
                    comments.append(comment)
                    if comment.message.startswith(prefix + ": Abandoned"):
                        abandoned = patch.number
                elif comment.message.startswith("Restored") and abandoned == patch.number:
                    comments.append(comment)

            CommandComments.format_comments(comments, bots, usecolor)
dataset/ETHPy150Open berrange/gerrymander/gerrymander/commands.py/CommandComments.format_change/original