code: def __compare_overall_handler__(compare, cm_dict):
      """
      Handle overall score of Compare class.
  
      :param compare: Compare
      :type compare: pycm.Compare object
      :param cm_dict: dictionary of confusion matrices
      :type cm_dict: dict
      :return: None
      """
      overall_benchmark_weight_sum = sum(
          compare.overall_benchmark_weight.values()
      )
      for item in OVERALL_BENCHMARK_SCORE_DICT.keys():
          max_item_score = len(OVERALL_BENCHMARK_SCORE_DICT[item]) - 1
          all_overall_score = [
              OVERALL_BENCHMARK_SCORE_DICT[item][
                  cm.overall_stat[OVERALL_BENCHMARK_MAP[item]]
              ]
              for cm in cm_dict.values()
          ]
          if all([isinstance(x, int) for x in all_overall_score]):
              for cm_name in cm_dict.keys():
                  score = (
                      OVERALL_BENCHMARK_SCORE_DICT[item][
                          cm_dict[cm_name].overall_stat[
                              OVERALL_BENCHMARK_MAP[item]
                          ]
                      ]
                      / max_item_score
                  )
                  score = score * (
                      compare.overall_benchmark_weight[item]
                      / overall_benchmark_weight_sum
                  )
                  compare.scores[cm_name]["overall"] += score
  
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 2 for calling a global function with example usage: __compare_overall_handler__(compare, cm_dict) without return types