python: add chain-NN clustering snippet