code: def _check_targets(y_true, y_pred):
      """Check that y_true and y_pred belong to the same classification task
  
      This converts multiclass or binary types to a common shape, and raises a
      ValueError for a mix of multilabel and multiclass targets, a mix of
      multilabel formats, for the presence of continuous-valued or multioutput
      targets, or for targets of different lengths.
  
      Column vectors are squeezed to 1d, while multilabel formats are returned
      as CSR sparse label indicators.
  
      Parameters
      ----------
      y_true : array-like
  
      y_pred : array-like
  
      Returns
      -------
      type_true : one of {'multilabel-indicator', 'multiclass', 'binary'}
          The type of the true target data, as output by
          ``utils.multiclass.type_of_target``
  
      y_true : array or indicator matrix
  
      y_pred : array or indicator matrix
      """
      check_consistent_length(y_true, y_pred)
      type_true = type_of_target(y_true)
      type_pred = type_of_target(y_pred)
  
      y_type = set([type_true, type_pred])
      if y_type == set(["binary", "multiclass"]):
          y_type = set(["multiclass"])
  
      if len(y_type) > 1:
          raise ValueError(
              "Can't handle mix of {0} and {1}"
              "".format(type_true, type_pred)
          )
  
      # We can't have more than one value on y_type => The set is no more needed
      y_type = y_type.pop()
  
      # No metrics support "multiclass-multioutput" format
      if y_type not in ["binary", "multiclass", "multilabel-indicator"]:
          raise ValueError("{0} is not supported".format(y_type))
  
      if y_type in ["binary", "multiclass"]:
          y_true = column_or_1d(y_true)
          y_pred = column_or_1d(y_pred)
  
      if y_type.startswith("multilabel"):
          y_true = csr_matrix(y_true)
          y_pred = csr_matrix(y_pred)
          y_type = "multilabel-indicator"
  
      return y_type, y_true, y_pred
  
imports: from __future__ import division
  import warnings
  import numpy
  from scipy.sparse import coo_matrix
  from scipy.sparse import csr_matrix
  from ..preprocessing import LabelBinarizer, label_binarize
  from ..preprocessing import LabelEncoder
  from ..utils import assert_all_finite
  from ..utils import check_array
  from ..utils import check_consistent_length
  from ..utils import column_or_1d
  from ..utils.multiclass import unique_labels
  from ..utils.multiclass import type_of_target
  from ..utils.validation import _num_samples
  from ..utils.sparsefuncs import count_nonzero
  from ..utils.fixes import bincount
  from ..exceptions import UndefinedMetricWarning
label_desc: Use image node_id 1 for calling a global function with example usage: _check_targets(y_true, y_pred) and returns: y_type,  y_true,  y_pred