code: def __compare_sort_handler__(compare):
      """
      Handle sorting of scores.
  
      :param compare: Compare
      :type compare: pycm.Compare object
      :return: (max_overall_name,max_class_name) as tuple
      """
      sorted_by_class = sorted(
          compare.scores,
          key=lambda x: (
              compare.scores[x]["class"],
              compare.scores[x]["overall"],
          ),
      )
      sorted_by_overall = sorted(
          compare.scores,
          key=lambda x: (
              compare.scores[x]["overall"],
              compare.scores[x]["class"],
          ),
      )
      sorted_by_class.reverse()
      sorted_by_overall.reverse()
      compare.sorted = sorted_by_class
      max_overall_name = sorted_by_overall[0]
      max_class_name = sorted_by_class[0]
      return (max_overall_name, max_class_name)
  
imports: from __future__ import division
  from .pycm_error import pycmCompareError
  from .pycm_output import *
  from .pycm_util import *
  from .pycm_param import *
  from .pycm_obj import ConfusionMatrix
  import os
  import numpy
  from warnings import warn
label_desc: Use image node_id 4 for calling a global function with example usage: __compare_sort_handler__(compare) and returns: max_overall_name,  max_class_name