code: def nms_comparator(a, b):
      if "sort_class" in b and b["sort_class"] >= 0:
          diff = a["prob"][b["sort_class"]] - b["prob"][b["sort_class"]]
      else:
          diff = a["objectness"] - b["objectness"]
      return diff
  
imports: from __future__ import division
  import math
  from collections import namedtuple
  from functools import cmp_to_key
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: nms_comparator(a, b) and returns: diff