revised get_partitions.py, not finished -KL