code: def plot_confusion_matrix(
      confusion_matrix: np.ndarray,
      classes: Union[np.ndarray, List[Text]],
      normalize: bool = False,
      title: Text = "Confusion matrix",
      color_map: Any = None,
      zmin: int = 1,
      output_file: Optional[Text] = None,
  ) -> None:
      """Print and plot the provided confusion matrix.
      Normalization can be applied by setting `normalize=True`.
  
      Args:
          confusion_matrix: confusion matrix to plot
          classes: class labels
          normalize: If set to true, normalization will be applied.
          title: title of the plot
          color_map: color mapping
          zmin:
          output_file: output file to save plot to
  
      """
      import matplotlib.pyplot as plt
      from matplotlib.colors import LogNorm
  
      zmax = confusion_matrix.max() if len(confusion_matrix) > 0 else 1
      plt.clf()
      if not color_map:
          color_map = plt.cm.Blues
      plt.imshow(
          confusion_matrix,
          interpolation="nearest",
          cmap=color_map,
          aspect="auto",
          norm=LogNorm(vmin=zmin, vmax=zmax),
      )
      plt.title(title)
      plt.colorbar()
      tick_marks = np.arange(len(classes))
      plt.xticks(tick_marks, classes, rotation=90)
      plt.yticks(tick_marks, classes)
  
      if normalize:
          confusion_matrix = (
              confusion_matrix.astype("float")
              / confusion_matrix.sum(axis=1)[:, np.newaxis]
          )
          logger.info(
              f"Normalized confusion matrix: \n{confusion_matrix}"
          )
      else:
          logger.info(
              f"Confusion matrix, without normalization: \n{confusion_matrix}"
          )
  
      thresh = zmax / 2.0
      for i, j in itertools.product(
          range(confusion_matrix.shape[0]),
          range(confusion_matrix.shape[1]),
      ):
          plt.text(
              j,
              i,
              confusion_matrix[i, j],
              horizontalalignment="center",
              color="white"
              if confusion_matrix[i, j] > thresh
              else "black",
          )
  
      plt.ylabel("True label")
      plt.xlabel("Predicted label")
  
      # save confusion matrix to file before showing it
      if output_file:
          fig = plt.gcf()
          fig.set_size_inches(20, 20)
          fig.savefig(output_file, bbox_inches="tight")
  
file_path: rasa/rasa/utils/plotting.py
imports: import logging
  import itertools
  import os
  from functools import wraps
  import numpy
  from typing import Any, Callable, List, Optional, Text, TypeVar, Union, Tuple
  import matplotlib
  from matplotlib.ticker import FormatStrFormatter
  import rasa.shared.utils.io
  from rasa.constants import RESULTS_FILE
label_desc: Use image node_id 3 for calling a global function with example usage: plot_confusion_matrix(confusion_matrix, classes, normalize, title, color_map, zmin, output_file) without return types