code: def _confusion_matrix_validate(y_true, y_pred, target_names, cmap):
      """Validate values for confusion matrix and initialize defaults"""
      target_names = _confusion_matrix_validate_predictions(
          y_true, y_pred, target_names
      )
      cmap = _confusion_matrix_init_defaults(cmap)
      return target_names, cmap
  
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 5 for calling a global function with example usage: _confusion_matrix_validate(y_true, y_pred, target_names, cmap) and returns: target_names,  cmap