code: def test__check_targets(setup, type1, y1, type2, y2):
      # Check that _check_targets correctly merges target types, squeezes
      # output and fails if input lengths differ.
      try:
          expected = EXPECTED[type1, type2]
      except KeyError:
          expected = EXPECTED[type2, type1]
      if expected is None:
          with pytest.raises(ValueError):
              _check_targets(y1, y2).execute()
  
          if type1 != type2:
              with pytest.raises(ValueError):
                  _check_targets(y1, y2).execute()
  
          else:
              if type1 not in (BIN, MC, IND):
                  with pytest.raises(ValueError):
                      _check_targets(y1, y2).execute()
  
      else:
          merged_type, y1out, y2out = (
              _check_targets(y1, y2).execute().fetch()
          )
          assert merged_type == expected
          if merged_type.startswith("multilabel"):
              assert isinstance(y1out, SparseNDArray)
              assert isinstance(y2out, SparseNDArray)
          else:
              np.testing.assert_array_equal(y1out, np.squeeze(y1))
              np.testing.assert_array_equal(y2out, np.squeeze(y2))
          with pytest.raises(ValueError):
              _check_targets(y1[:-1], y2).execute()
  
imports: import numpy
  import pytest
  from sklearn import datasets, svm
  from sklearn.exceptions import UndefinedMetricWarning
  from sklearn.metrics import accuracy_score
  from sklearn.utils import check_random_state
  from sklearn.utils._testing import assert_almost_equal, assert_array_equal, assert_array_almost_equal
  from sklearn.utils._mocking import MockDataFrame
  from ....None import execute, fetch
  from ....None import tensor
  from ....lib.sparse import SparseNDArray
  from ..None import accuracy_score, log_loss
  from .._classification import _check_targets, multilabel_confusion_matrix, precision_recall_fscore_support, precision_score, recall_score, f1_score, fbeta_score
label_desc: Use image node_id 2 for calling a global function with example usage: test__check_targets(setup, type1, y1, type2, y2) without return types