<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_completed(self, p_completion_date=date.today()):
 """ Marks the todo as complete. Sets the completed flag and sets the completion date to today. """

        if not self.is_completed():
            self.set_priority(None)

            self.fields['completed'] = True
            self.fields['completionDate'] = p_completion_date

            self.src = re.sub(r'^(\([A-Z]\) )?',
                              'x ' + p_completion_date.isoformat() + ' ',
                              self.src)