<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def detach(self):
 """ Detach from parent. @return: This element removed from its parent's child list and I{parent}=I{None} @rtype: L{Element} """

        if self.parent is not None:
            if self in self.parent.children:
                self.parent.children.remove(self)
            self.parent = None
        return self