code: def _plot_confusion_matrix(
      labels: List[int], preds: List[int], graph_fold: str
  ):
      """
      Plot confusion matrix
      Args:
          labels: ground truth labels
          preds: model predictions
          graph_fold: path to a folder to store confusion matrix plot
      """
      cm = confusion_matrix(labels, preds)
      logging.info(f"Confusion matrix:\n{cm}")
      fig = plt.figure()
      ax = fig.add_subplot(111)
      cax = ax.matshow(cm)
      plt.title("Confusion matrix of the classifier")
      fig.colorbar(cax)
      plt.xlabel("Predicted")
      plt.ylabel("True")
      os.makedirs(graph_fold, exist_ok=True)
      plt.savefig(
          os.path.join(graph_fold, time.strftime("%Y%m%d-%H%M%S"))
      )
  
imports: import os
  import time
  from typing import Callable, Dict, List, Optional, Union
  import numpy
  import torch
  import torch.nn.functional
  from matplotlib import pyplot
  from sklearn.metrics import classification_report, confusion_matrix
  from torch import Tensor
  from nemo.collections.nlp.modules.common.megatron.utils import erf_gelu
  from nemo.collections.nlp.modules.common.megatron.utils import openai_gelu
  from nemo.collections.nlp.modules.common.megatron.utils import squared_relu
  from nemo.utils import logging
label_desc: Use image node_id 5 for calling a global function with example usage: _plot_confusion_matrix(labels, preds, graph_fold) without return types