code: def _check_fitted(model):
      """Simple wrapper to check if the KNeighborsClassifier has been fitted."""
      return _sklearn_util.check_fitted(
          model,
          lambda m: hasattr(m, "_fit_method") or hasattr(m, "_fit_X"),
      )
  
imports: from ..._deps import _HAS_SKLEARN
  from ...models import MLModel
  import coremltools
  from coremltools.proto import FeatureTypes_pb2
  import numpy
  import scipy
  import six
label_desc: Use image node_id 8 for calling a global function with example usage: _check_fitted(model) and returns: _sklearn_util