code: def html_class_stat(
      classes,
      class_stat,
      digit=5,
      class_param=None,
      recommended_list=(),
      alt_link=False,
  ):
      """
      Return the class-based stats of HTML report file.
  
      :param classes: confusion matrix classes
      :type classes: list
      :param class_stat: class stat
      :type class_stat:dict
      :param digit: scale (number of fraction digits)(default value: 5)
      :type digit: int
      :param class_param: class parameters list for print, Example: ["TPR", "TNR", "AUC"]
      :type class_param: list
      :param recommended_list: recommended statistics list
      :type recommended_list: list or tuple
      :param alt_link: alternative link for document flag
      :type alt_link: bool
      :return: html_class_stat as str
      """
      document_link = DOCUMENT_ADR
      if alt_link:
          document_link = DOCUMENT_ADR_ALT
      result = ""
      result += "<h2>Class Statistics : </h2>\n"
      result += '<table style="border:1px solid black;border-collapse: collapse;">\n'
      result += '<tr style="text-align:center;">\n<td>Class</td>\n'
      for i in classes:
          result += (
              '<td style="border:1px solid black;padding:4px;border-collapse: collapse;">'
              + str(i)
              + "</td>\n"
          )
      result += "<td>Description</td>\n"
      result += "</tr>\n"
      class_stat_keys = sorted(class_stat.keys())
      if isinstance(class_param, list):
          if set(class_param) <= set(class_stat_keys):
              class_stat_keys = class_param
      if len(classes) < 1 or len(class_stat_keys) < 1:
          return ""
      for i in class_stat_keys:
          background_color = DEFAULT_BACKGROUND_COLOR
          if i in recommended_list:
              background_color = RECOMMEND_BACKGROUND_COLOR
          result += '<tr style="text-align:center;border:1px solid black;border-collapse: collapse;">\n'
          result += (
              '<td style="border:1px solid black;padding:4px;border-collapse: collapse;background-color:{};"><a href="'.format(
                  background_color
              )
              + document_link
              + PARAMS_LINK[i]
              + '" style="text-decoration:None;">'
              + str(i)
              + "</a></td>\n"
          )
          for j in classes:
              if i in BENCHMARK_LIST:
                  background_color = BENCHMARK_COLOR[i][
                      class_stat[i][j]
                  ]
                  result += '<td style="border:1px solid black;padding:4px;border-collapse: collapse;background-color:{};">'.format(
                      background_color
                  )
              else:
                  result += '<td style="border:1px solid black;padding:4px;border-collapse: collapse;">'
              result += rounder(class_stat[i][j], digit) + "</td>\n"
          params_text = PARAMS_DESCRIPTION[i]
          if i not in CAPITALIZE_FILTER:
              params_text = params_text.capitalize()
          result += (
              '<td style="border:1px solid black;padding:4px;border-collapse: collapse;text-align:left;">'
              + params_text
              + "</td>\n"
          )
          result += "</tr>\n"
      result += "</table>\n"
      return result
  
imports: from __future__ import division
  from functools import partial
  from .pycm_param import *
  from .pycm_util import rounder, sort_char_num
  import webbrowser
label_desc: Use image node_id 7 for calling a global function with example usage: html_class_stat(classes, class_stat, digit, class_param, recommended_list, alt_link) and returns: result, str