code: def _check_key_type(key, superclass):
      """Check that scalar, list or slice is of a certain type.
  
      This is only used in _get_column and _get_column_indices to check
      if the `key` (column specification) is fully integer or fully string-like.
  
      Parameters
      ----------
      key : scalar, list, slice, array-like
          The column specification to check
      superclass : int or str
          The type for which to check the `key`
      """
      if isinstance(key, superclass):
          return True
      if isinstance(key, slice):
          return isinstance(
              key.start, (superclass, type(None))
          ) and isinstance(key.stop, (superclass, type(None)))
      if isinstance(key, list):
          return all(isinstance(x, superclass) for x in key)
      if hasattr(key, "dtype"):
          if superclass is int:
              return key.dtype.kind == "i"
          else:
              # superclass = str
              return key.dtype.kind in ("O", "U", "S")
      return False
  
imports: from itertools import chain
  import numpy
  import pandas
  from sklearn.preprocessing import LabelEncoder
  from sktime.base import _HeterogenousMetaEstimator
  from sktime.classification.base import BaseClassifier
label_desc: Use image node_id 2 for calling a global function with example usage: _check_key_type(key, superclass) and returns: False, True, unknown, all, unknown, unknown