code: def _plot_cm(cm, cmap, ax, target_names, normalize):
      """Adds confusion matrix graphical elements to a ``matplotlib.Axes`` object"""
      _add_values_to_matrix(cm, ax)
  
      im = ax.imshow(cm, interpolation="nearest", cmap=cmap)
      ax.figure.colorbar(im)
      tick_marks = np.arange(len(target_names))
      ax.set_xticks(tick_marks)
      ax.set_xticklabels(target_names)
      ax.set_yticks(tick_marks)
      ax.set_yticklabels(target_names)
  
      title = "Confusion matrix"
  
      if normalize:
          title += " (normalized)"
  
      ax.set_title(title)
  
      ax.set_ylabel("True label")
      ax.set_xlabel("Predicted label")
      return ax
  
imports: import json
  from pathlib import Path
  import numpy
  import matplotlib.pyplot
  from sklearn.metrics import confusion_matrix
  from sklearn_evaluation import __version__
  from ..telemetry import SKLearnEvaluationLogger
  from ..plot.matplotlib import bar
  from ..metrics import precision_at
  from ..None import compute
  from ..util import is_column_vector, is_row_vector, default_heatmap
  from sklearn_evaluation.plot.plot import AbstractPlot, AbstractComposedPlot
  from ..plot import _matrix
  from ploomber_core.exceptions import modify_exceptions
label_desc: Use image node_id 7 for calling a global function with example usage: _plot_cm(cm, cmap, ax, target_names, normalize) and returns: ax