<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_partition(self, partition):
 """ Store the partition in self.partition, and move the old self.partition into self.prev_partition """

        assert len(partition) == self.numgrp
        self.partition, self.prev_partition = partition, self.partition