SciPy

scipy.spatial.KDTree.indices

KDTree.indices