@staticmethod
    def format_event(event, bots, projects, usecolor):
        if event.user is None or event.change is None:
            return

        if event.is_user_in_list(bots):
            return
        if len(projects) > 0 and event.change.project not in projects:
            return

        change = event.change
        print (format_color("Change %s (%s)" % (change.url, change.id),
                            usecolor,
                            fg="red",
                            styles=["bold"]))
        print ("")
        print ("  Project: %s" % change.project)
        print ("  Subject: %s" % change.subject)
        if type(event) == ModelEventChangeRestore:
            print ("   Action: %s" % format_color("change restored", styles=["bold"]))
        elif type(event) == ModelEventChangeAbandon:
            print ("   Action: %s" % format_color("change abandoned", styles=["bold"]))
        elif type(event) == ModelEventChangeMerge:
            print ("   Action: %s" % format_color("change merged", styles=["bold"]))
        elif type(event) == ModelEventCommentAdd:
            print ("   Action: %s" % format_color("comment added", styles=["bold"]))
            if len(event.approvals) > 0:
                print ("    Votes: %s" %
                       format_color(CommandWatch.format_approvals(event.approvals),
                                    usecolor,
                                    fg="blue",
                                    styles=["bold"]))

        elif type(event) == ModelEventPatchCreate:
            print ("   Action: %s" % format_color("change restored", styles=["bold"]))

        if type(event) == ModelEventCommentAdd:
            print ("")
            CommandWatch.format_comment(event.comment, event.user, usecolor)
        print ("")
        print ("")
dataset/ETHPy150Open berrange/gerrymander/gerrymander/commands.py/CommandWatch.format_event/original