rewrite k_means.py, add test file.