<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def strip(self, inplace=False):
 """ Sets all edge lengths to None """

        if not inplace:
            t = self.copy()
        else:
            t = self
        for e in t._tree.preorder_edge_iter():
            e.length = None
        t._dirty = True
        return t