dbscan clustering python from scratch