code: def check_target_type(y, indicate_one_vs_all=False):
      """Check the target types to be conform to the current samplers.
  
      The current samplers should be compatible with ``'binary'``,
      ``'multilabel-indicator'`` and ``'multiclass'`` targets only.
  
      Parameters
      ----------
      y : ndarray
          The array containing the target.
  
      indicate_one_vs_all : bool, default=False
          Either to indicate if the targets are encoded in a one-vs-all fashion.
  
      Returns
      -------
      y : ndarray
          The returned target.
  
      is_one_vs_all : bool, optional
          Indicate if the target was originally encoded in a one-vs-all fashion.
          Only returned if ``indicate_multilabel=True``.
      """
      type_y = type_of_target(y)
      if type_y == "multilabel-indicator":
          if np.any(y.sum(axis=1) > 1):
              raise ValueError(
                  "Imbalanced-learn currently supports binary, multiclass and "
                  "binarized encoded multiclasss targets. Multilabel and "
                  "multioutput targets are not supported."
              )
          y = y.argmax(axis=1)
      else:
          y = column_or_1d(y)
  
      return (
          (y, type_y == "multilabel-indicator")
          if indicate_one_vs_all
          else y
      )
  
imports: import warnings
  from collections import OrderedDict
  from functools import wraps
  from inspect import Parameter, signature
  from numbers import Integral, Real
  import numpy
  from sklearn.base import clone
  from sklearn.neighbors import NearestNeighbors
  from sklearn.utils import check_array, column_or_1d
  from sklearn.utils.multiclass import type_of_target
  from sklearn.utils.validation import _num_samples
  from .fixes import _is_pandas_df
label_desc: Use image node_id 4 for calling a global function with example usage: check_target_type(y, indicate_one_vs_all) and returns: unknown