code: def CEN_calc(classes, table, TOP, P, class_name, modified=False):
      """
      Calculate Confusion Entropy (CEN) (or Modified Confusion Entropy (MCEN)).
  
      :param classes: confusion matrix classes
      :type classes: list
      :param table: input confusion matrix
      :type table: dict
      :param TOP: number of positives in predict vector
      :type TOP: int
      :param P: number of actual positives
      :type P: int
      :param class_name: reviewed class name
      :type class_name: any valid type
      :param modified: modified mode flag
      :type modified: bool
      :return: CEN (or MCEN) as float
      """
      try:
          result = 0
          class_number = len(classes)
          for k in classes:
              if k != class_name:
                  P_j_k = CEN_misclassification_calc(
                      table, TOP, P, class_name, k, class_name, modified
                  )
                  P_k_j = CEN_misclassification_calc(
                      table, TOP, P, k, class_name, class_name, modified
                  )
                  if P_j_k != 0:
                      result += P_j_k * math.log(
                          P_j_k, 2 * (class_number - 1)
                      )
                  if P_k_j != 0:
                      result += P_k_j * math.log(
                          P_k_j, 2 * (class_number - 1)
                      )
          if result != 0:
              result = result * (-1)
          return result
      except (ZeroDivisionError, TypeError, ValueError):
          return "None"
  
imports: from __future__ import division
  import math
  from .pycm_util import normal_quantile
  from .pycm_interpret import *
  from .pycm_param import CLASS_PARAMS
label_desc: Use image node_id 25 for calling a global function with example usage: CEN_calc(classes, table, TOP, P, class_name, modified) and returns: result, str