code: def get_input_dimension(model):
      """Get the input dimension for the model"""
      _check_fitted(model)
      number_of_dimensions = 0
      if _is_algorithm_brute(model):
          number_of_dimensions = model._fit_X.shape[1]
      elif _is_algorithm_kd_tree(model):
          npdata = np.asarray(model._tree.data)
          number_of_dimensions = len(npdata[0])
      else:
          raise TypeError(
              "KNeighbors algorithm not supported for CoreML conversion: {}".format(
                  model.algorithm
              )
          )
      return number_of_dimensions
  
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 7 for calling a global function with example usage: get_input_dimension(model) and returns: number_of_dimensions