code: def csv_matrix_print(classes, table, header=False):
      """
      Return matrix as csv data.
  
      :param classes: confusion matrix classes
      :type classes: list
      :param table: input confusion matrix
      :type table: dict
      :param header: add headers to csv file
      :type header: bool
      :return:
      """
      result = ""
      header_section = ""
      for i in classes:
          if header is True:
              header_section += '"' + str(i) + '"' + ","
          for j in classes:
              result += str(table[i][j]) + ","
          result = result[:-1] + "\n"
      if len(header_section) > 0:
          header_section = header_section[:-1] + "\n"
      result = header_section + result
      return result[:-1]
  
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 12 for calling a global function with example usage: csv_matrix_print(classes, table, header) and returns: result