code: def heatmap(
      AUC,
      title,
      xlabel,
      ylabel,
      xticklabels,
      yticklabels,
      figure_width=40,
      figure_height=20,
      correct_orientation=False,
      cmap="RdBu",
      fmt="%.2f",
      graph_filepath="",
      normalize=False,
      remove_diagonal=False,
  ):
      """
      Inspired by:
      - http://stackoverflow.com/a/16124677/395857
      - http://stackoverflow.com/a/25074150/395857
      """
      if normalize:
          AUC = sklearn.preprocessing.normalize(AUC, norm="l1", axis=1)
  
      if remove_diagonal:
          matrix = np.copy(AUC)
          np.fill_diagonal(matrix, 0)
          if len(xticklabels) > 2:
              matrix[:, -1] = 0
              matrix[-1, :] = 0
          values = matrix.flatten()
      else:
          values = AUC.flatten()
      vmin = values.min()
      vmax = values.max()
  
      # Plot it out
      fig, ax = plt.subplots()
      # c = ax.pcolor(AUC, edgecolors='k', linestyle= 'dashed', linewidths=0.2, cmap='RdBu', vmin=0.0, vmax=1.0)
      c = ax.pcolor(
          AUC,
          edgecolors="k",
          linestyle="dashed",
          linewidths=0.2,
          cmap=get_cmap(),
          vmin=vmin,
          vmax=vmax,
      )
  
      # put the major ticks at the middle of each cell
      ax.set_yticks(np.arange(AUC.shape[0]) + 0.5, minor=False)
      ax.set_xticks(np.arange(AUC.shape[1]) + 0.5, minor=False)
  
      # set tick labels
      ax.set_xticklabels(xticklabels, minor=False)
      ax.set_yticklabels(yticklabels, minor=False)
  
      # set title and x/y labels
      plt.title(title)
      plt.xlabel(xlabel)
      plt.ylabel(ylabel)
  
      # Remove last blank column
      plt.xlim((0, AUC.shape[1]))
  
      # Turn off all the ticks
      ax = plt.gca()
      for t in ax.xaxis.get_major_ticks():
          t.tick1On = False
          t.tick2On = False
      for t in ax.yaxis.get_major_ticks():
          t.tick1On = False
          t.tick2On = False
  
      # Add color bar
      plt.colorbar(c)
  
      # Add text in each cell
      show_values(c, fmt=fmt)
  
      # Proper orientation (origin at the top left instead of bottom left)
      if correct_orientation:
          ax.invert_yaxis()
          ax.xaxis.tick_top()
  
      # resize
      fig = plt.gcf()
      fig.set_size_inches(cm2inch(figure_width, figure_height))
  
      if graph_filepath != "":
          plt.savefig(
              graph_filepath, dpi=300, format="png", bbox_inches="tight"
          )
          plt.close()
  
file_path: NeuroNER/neuroner/utils_plots.py
imports: from __future__ import print_function
  from __future__ import division
  import matplotlib
  from matplotlib import cm
  import matplotlib.pyplot
  import numpy
  import sklearn.preprocessing
label_desc: Use image node_id 4 for calling a global function with example usage: heatmap(AUC, title, xlabel, ylabel, xticklabels, yticklabels, figure_width, figure_height, correct_orientation, cmap, fmt, graph_filepath, normalize, remove_diagonal) without return types