def METHOD_NAME(self, bug, data):
    bugid = str(bug["id"])
    duplicates = data[bugid]["duplicates"]
    downgrade_time = self._get_last_severity_downgrade_time(bug)
    if downgrade_time:
        duplicates = [
            dup_bug
            for dup_bug in duplicates
            # cf_last_resolved reflects when it was linked as a duplicate
            if dup_bug["cf_last_resolved"] > downgrade_time
        ]
    if duplicates and self.add_auto_ni(bugid, utils.get_mail_to_ni(bug)):
        data[bugid]["duplicates"] = duplicates
        data[bugid]["suggested_severity"] = max(
            dup_bug["severity"] for dup_bug in duplicates
        )
    else:
        del data[bugid]