class_docstr: kd-tree for quick nearest-neighbor lookup
  
  This class provides an index into a set of k-dimensional points which
  can be used to rapidly look up the nearest neighbors of any point.
  
  Parameters
  ----------
  data : (N,K) array_like
      The data points to be indexed. This array is not copied, and
      so modifying this data will result in bogus results.
  leafsize : int, optional
      The number of points at which the algorithm switches over to
      brute-force.  Has to be positive.
  
  Raises
  ------
  RuntimeError
      The maximum recursion limit can be exceeded for large data
      sets.  If this happens, either increase the value for the `leafsize`
      parameter or increase the recursion limit by::
  
          >>> import sys
          >>> sys.setrecursionlimit(10000)
  
  See Also
  --------
  cKDTree : Implementation of `KDTree` in Cython
  
  Notes
  -----
  The algorithm used is described in Maneewongvatana and Mount 1999.
  The general idea is that the kd-tree is a binary tree, each of whose
  nodes represents an axis-aligned hyperrectangle. Each node specifies
  an axis and splits the set of points based on whether their coordinate
  along that axis is greater than or less than a particular value.
  
  During construction, the axis and splitting point are chosen by the
  "sliding midpoint" rule, which ensures that the cells do not all
  become long and thin.
  
  The tree can be queried for the r closest neighbors of any given point
  (optionally returning only those within some maximum distance of the
  point). It can also be queried, with a substantial gain in efficiency,
  for the r approximate closest neighbors.
  
  For large dimensions (20 is already large) do not expect this to run
  significantly faster than brute force. High-dimensional nearest-neighbor
  queries are a substantial open problem in computer science.
  
  The tree also supports all-neighbors queries, both with arrays of points
  and with other kd-trees. These do use a reasonably efficient algorithm,
  but the kd-tree is not necessarily the best data structure for this
  sort of calculation.
code: def __query_ball_point(self, x, r, p=2.0, eps=0):
      R = Rectangle(self.maxes, self.mins)
  
      def traverse_checking(node, rect):
          if rect.min_distance_point(x, p) > r / (1.0 + eps):
              return []
          elif rect.max_distance_point(x, p) < r * (1.0 + eps):
              return traverse_no_checking(node)
          elif isinstance(node, KDTree.leafnode):
              d = self.data[node.idx]
              return node.idx[minkowski_distance(d, x, p) <= r].tolist()
          else:
              less, greater = rect.split(node.split_dim, node.split)
              return traverse_checking(
                  node.less, less
              ) + traverse_checking(node.greater, greater)
  
      def traverse_no_checking(node):
          if isinstance(node, KDTree.leafnode):
              return node.idx.tolist()
          else:
              return traverse_no_checking(
                  node.less
              ) + traverse_no_checking(node.greater)
  
      return traverse_checking(self.tree, R)
  
imports: from __future__ import division, print_function, absolute_import
  import sys
  import numpy
  from heapq import heappush, heappop
  import scipy.sparse
label_desc: Use image node_id 5 for calling the KDTree obj's underlying member method code with example usage: obj.__query_ball_point(x, r, p, eps) and returns: traverse_checking, list, node, unknown, traverse_no_checking, node, unknown