code: def __compare_assign_handler__(
      compare,
      cm_dict,
      class_weight,
      class_benchmark_weight,
      overall_benchmark_weight,
      digit,
  ):
      """
      Assign basic parameters to Compare.
  
      :param compare: Compare
      :type compare: pycm.Compare object
      :param cm_dict: dictionary of confusion matrices
      :type cm_dict: dict
      :param class_weight: class weights
      :type class_weight: dict
      :param class_benchmark_weight: class benchmark weights
      :type class_benchmark_weight: dict
      :param overall_benchmark_weight: overall benchmark weights
      :type overall_benchmark_weight: dict
      :param digit: scale (number of fraction digits)(default value: 5)
      :type digit: int
      :return: None
      """
      if not isinstance(cm_dict, dict):
          raise pycmCompareError(COMPARE_FORMAT_ERROR)
      if not all(
          isinstance(item, ConfusionMatrix) for item in cm_dict.values()
      ):
          raise pycmCompareError(COMPARE_TYPE_ERROR)
      if any(item.metrics_off for item in cm_dict.values()):
          raise pycmCompareError(COMPARE_METRICS_OFF_ERROR)
      if not list_check_equal(
          [getattr(item, "POP") for item in cm_dict.values()]
      ):
          raise pycmCompareError(COMPARE_DOMAIN_ERROR)
      if len(cm_dict) < 2:
          raise pycmCompareError(COMPARE_NUMBER_ERROR)
      compare.classes = list(cm_dict.values())[0].classes
      compare.class_weight = {k: 1 for k in compare.classes}
      compare.class_benchmark_weight = {
          k: 1 for k in CLASS_BENCHMARK_LIST
      }
      compare.overall_benchmark_weight = {
          k: 0 if k in KAPPA_BENCHMARK_LIST[1:] else 1
          for k in OVERALL_BENCHMARK_LIST
      }
      compare.digit = digit
      compare.best = None
      compare.best_name = None
      compare.sorted = None
      compare.scores = {
          k: {"overall": 0, "class": 0}.copy() for k in cm_dict.keys()
      }
      __compare_weight_handler__(compare, class_weight, "class_weight")
      __compare_weight_handler__(
          compare, class_benchmark_weight, "class_benchmark_weight"
      )
      __compare_weight_handler__(
          compare, overall_benchmark_weight, "overall_benchmark_weight"
      )
  
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 6 for calling a global function with example usage: __compare_assign_handler__(compare, cm_dict, class_weight, class_benchmark_weight, overall_benchmark_weight, digit) without return types