code: def csv_print(classes, class_stat, digit=5, class_param=None):
      """
      Return csv file data.
  
      :param classes: confusion matrix classes
      :type classes: list
      :param class_stat: statistic result for each class
      :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
      :return: csv file data as str
      """
      result = "Class"
      for item in classes:
          result += ',"' + str(item) + '"'
      result += "\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(class_stat_keys) < 1 or len(classes) < 1:
          return ""
      for key in class_stat_keys:
          row = [rounder(class_stat[key][i], digit) for i in classes]
          result += key + "," + ",".join(row)
          result += "\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 13 for calling a global function with example usage: csv_print(classes, class_stat, digit, class_param) and returns: result, str