code: def class_statistics(TP, TN, FP, FN, classes, table):
      """
      Return All statistics of classes.
  
      :param TP: true positive
      :type TP: dict
      :param TN: true negative
      :type TN: dict
      :param FP: false positive
      :type FP: dict
      :param FN: false negative
      :type FN: dict
      :param classes: confusion matrix classes
      :type classes: list
      :param table: input confusion matrix
      :type table: dict
      :return: classes' statistics as dict
      """
      result = basic_statistics(TP, TN, FP, FN)
      for i in TP.keys():
          result["POP"][i] = TP[i] + TN[i] + FP[i] + FN[i]
          result["P"][i] = TP[i] + FN[i]
          result["N"][i] = TN[i] + FP[i]
          result["TOP"][i] = TP[i] + FP[i]
          result["TON"][i] = TN[i] + FN[i]
          result["HD"][i] = FP[i] + FN[i]
          result["TPR"][i] = TTPN_calc(TP[i], FN[i])
          result["TNR"][i] = TTPN_calc(TN[i], FP[i])
          result["PPV"][i] = TTPN_calc(TP[i], FP[i])
          result["NPV"][i] = TTPN_calc(TN[i], FN[i])
          result["FNR"][i] = FXR_calc(result["TPR"][i])
          result["FPR"][i] = FXR_calc(result["TNR"][i])
          result["FDR"][i] = FXR_calc(result["PPV"][i])
          result["FOR"][i] = FXR_calc(result["NPV"][i])
          result["ACC"][i] = ACC_calc(TP[i], TN[i], FP[i], FN[i])
          result["F1"][i] = F_calc(TP[i], FP[i], FN[i], 1)
          result["F0.5"][i] = F_calc(TP[i], FP[i], FN[i], 0.5)
          result["F2"][i] = F_calc(TP[i], FP[i], FN[i], 2)
          result["MCC"][i] = MCC_calc(TP[i], TN[i], FP[i], FN[i])
          result["BM"][i] = MK_BM_calc(
              result["TPR"][i], result["TNR"][i]
          )
          result["MK"][i] = MK_BM_calc(
              result["PPV"][i], result["NPV"][i]
          )
          result["PLR"][i] = LR_calc(result["TPR"][i], result["FPR"][i])
          result["NLR"][i] = LR_calc(result["FNR"][i], result["TNR"][i])
          result["DOR"][i] = LR_calc(result["PLR"][i], result["NLR"][i])
          result["PRE"][i] = PRE_calc(result["P"][i], result["POP"][i])
          result["G"][i] = G_calc(result["PPV"][i], result["TPR"][i])
          result["RACC"][i] = RACC_calc(
              result["TOP"][i], result["P"][i], result["POP"][i]
          )
          result["ERR"][i] = ERR_calc(result["ACC"][i])
          result["RACCU"][i] = RACCU_calc(
              result["TOP"][i], result["P"][i], result["POP"][i]
          )
          result["J"][i] = jaccard_index_calc(
              TP[i], result["TOP"][i], result["P"][i]
          )
          result["IS"][i] = IS_calc(
              TP[i], FP[i], FN[i], result["POP"][i]
          )
          result["CEN"][i] = CEN_calc(
              classes, table, result["TOP"][i], result["P"][i], i
          )
          result["MCEN"][i] = CEN_calc(
              classes, table, result["TOP"][i], result["P"][i], i, True
          )
          result["AUC"][i] = AUC_calc(
              result["TNR"][i], result["TPR"][i]
          )
          result["dInd"][i] = dInd_calc(
              result["TNR"][i], result["TPR"][i]
          )
          result["sInd"][i] = sInd_calc(result["dInd"][i])
          result["DP"][i] = DP_calc(result["TPR"][i], result["TNR"][i])
          result["Y"][i] = result["BM"][i]
          result["PLRI"][i] = PLR_analysis(result["PLR"][i])
          result["NLRI"][i] = NLR_analysis(result["NLR"][i])
          result["DPI"][i] = DP_analysis(result["DP"][i])
          result["AUCI"][i] = AUC_analysis(result["AUC"][i])
          result["GI"][i] = GI_calc(result["AUC"][i])
          result["LS"][i] = lift_calc(
              result["PPV"][i], result["PRE"][i]
          )
          result["AM"][i] = AM_calc(result["TOP"][i], result["P"][i])
          result["OP"][i] = OP_calc(
              result["ACC"][i], result["TPR"][i], result["TNR"][i]
          )
          result["IBA"][i] = IBA_calc(
              result["TPR"][i], result["TNR"][i]
          )
          result["GM"][i] = G_calc(result["TNR"][i], result["TPR"][i])
          result["Q"][i] = Q_calc(TP[i], TN[i], FP[i], FN[i])
          result["QI"][i] = Q_analysis(result["Q"][i])
          result["AGM"][i] = AGM_calc(
              result["TPR"][i],
              result["TNR"][i],
              result["GM"][i],
              result["N"][i],
              result["POP"][i],
          )
          result["MCCI"][i] = MCC_analysis(result["MCC"][i])
          result["AGF"][i] = AGF_calc(TP[i], FP[i], FN[i], TN[i])
          result["OC"][i] = OC_calc(
              TP[i], result["TOP"][i], result["P"][i]
          )
          result["BB"][i] = BB_calc(
              TP[i], result["TOP"][i], result["P"][i]
          )
          result["OOC"][i] = OOC_calc(
              TP[i], result["TOP"][i], result["P"][i]
          )
          result["AUPR"][i] = AUC_calc(
              result["PPV"][i], result["TPR"][i]
          )
          result["ICSI"][i] = MK_BM_calc(
              result["PPV"][i], result["TPR"][i]
          )
          result["BCD"][i] = BCD_calc(result["AM"][i], result["POP"][i])
      return result
  
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 37 for calling a global function with example usage: class_statistics(TP, TN, FP, FN, classes, table) and returns: result