code: def test_type_of_target():
      for group, group_examples in EXAMPLES.items():
          for example in group_examples:
              assert (
                  type_of_target(example) == group
              ), "type_of_target(%r) should be %r, got %r" % (
                  example,
                  group,
                  type_of_target(example),
              )
  
      for example in NON_ARRAY_LIKE_EXAMPLES:
          msg_regex = (
              r"Expected array-like \(array or non-string sequence\).*"
          )
          with pytest.raises(ValueError, match=msg_regex):
              type_of_target(example)
  
      for example in MULTILABEL_SEQUENCES:
          msg = (
              "You appear to be using a legacy multi-label data "
              "representation. Sequence of sequences are no longer supported;"
              " use a binary array or sparse matrix instead."
          )
          with pytest.raises(ValueError, match=msg):
              type_of_target(example)
  
imports: from itertools import product
  import numpy
  import pytest
  from scipy.sparse import issparse
  from sklearn import config_context, datasets
  from sklearn.model_selection import ShuffleSplit
  from sklearn.svm import SVC
  from sklearn.utils._array_api import yield_namespace_device_dtype_combinations
  from sklearn.utils._testing import _array_api_for_tests, assert_allclose, assert_array_almost_equal, assert_array_equal
  from sklearn.utils.estimator_checks import _NotAnArray
  from sklearn.utils.fixes import COO_CONTAINERS, CSC_CONTAINERS, CSR_CONTAINERS, DOK_CONTAINERS, LIL_CONTAINERS
  from sklearn.utils.metaestimators import _safe_split
  from sklearn.utils.multiclass import _ovr_decision_function, check_classification_targets, class_distribution, is_multilabel, type_of_target, unique_labels
label_desc: Use image node_id 8 for calling a global function with example usage: test_type_of_target() without return types