code: def check_unique_type(y):
      target_types = pd.Series(y).map(type).unique()
      if len(target_types) != 1:
          raise TypeError(
              f"Values on the target must have the same type. Target has types {target_types}"
          )
  
imports: from collections.abc import Sequence
  from itertools import chain
  from scipy.sparse import issparse
  from scipy.sparse.base import spmatrix
  from scipy.sparse import dok_matrix
  from scipy.sparse import lil_matrix
  import scipy.sparse
  import numpy
  import pandas
label_desc: Use image node_id 10 for calling a global function with example usage: check_unique_type(y) without return types