code: def _is_valid_sparse_format(obj):
      """Check if the object is in CSR sparse format (the only valid type for KNeighborsClassifier)"""
      return isinstance(obj, sp.sparse.csr_matrix)
  
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 15 for calling a global function with example usage: _is_valid_sparse_format(obj) and returns: isinstance