<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def restart(self, key):
 """Restart a previously finished entry."""

        if key in self.queue:
            if self.queue[key]['status'] in ['failed', 'done']:
                new_entry = {'command': self.queue[key]['command'],
                             'path': self.queue[key]['path']}
                self.add_new(new_entry)
                self.write()
                return True
        return False