code: def _number_of_samples(model, spec):
      """Get the number of samples the model is fitted to."""
  
      if _is_algorithm_brute(model):
          return model._fit_X.shape[0]
      elif _is_algorithm_kd_tree(model):
          return len(np.asarray(model._tree.data))
      return 0
  
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 5 for calling a global function with example usage: _number_of_samples(model, spec) and returns: int, model, len