<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _find_parent(self, path_elements):
 """Recurse up the tree of FileSetStates until we find a parent, i.e. one whose path_elements member is the start of the path_element argument"""

        if not self.path_elements:
            # Automatically terminate on root
            return self
        elif self.path_elements == path_elements[0:len(self.path_elements)]:
            return self
        else:
            return self.parent._find_parent(path_elements)