<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_parent(self, key_name, new_parent):
 """Sets the parent of the key."""

        self.unbake()
        kf = self.dct[key_name]
        kf['parent'] = new_parent
        self.bake()