Python code to mutli-thread a K-means algorithm