code: def __compare_class_handler__(compare, cm_dict):
      """
      Handle class 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
      """
      class_weight_sum = sum(compare.class_weight.values())
      class_benchmark_weight_sum = sum(
          compare.class_benchmark_weight.values()
      )
      for c in compare.classes:
          for item in CLASS_BENCHMARK_SCORE_DICT.keys():
              max_item_score = len(CLASS_BENCHMARK_SCORE_DICT[item]) - 1
              all_class_score = [
                  CLASS_BENCHMARK_SCORE_DICT[item][
                      cm.class_stat[item][c]
                  ]
                  for cm in cm_dict.values()
              ]
              if all([isinstance(x, int) for x in all_class_score]):
                  for cm_name in cm_dict.keys():
                      score = (
                          compare.class_weight[c] / class_weight_sum
                      ) * (
                          CLASS_BENCHMARK_SCORE_DICT[item][
                              cm_dict[cm_name].class_stat[item][c]
                          ]
                          / max_item_score
                      )
                      score = score * (
                          compare.class_benchmark_weight[item]
                          / class_benchmark_weight_sum
                      )
                      compare.scores[cm_name]["class"] += 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 1 for calling a global function with example usage: __compare_class_handler__(compare, cm_dict) without return types