<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parents(self, resources):
 """ Split the path in name and get parents """


        if self.docname == 'index':
            # The root has no parents
            return []
        parents = []
        parent = resources.get(self.parent)
        while parent is not None:
            parents.append(parent)
            parent = resources.get(parent.parent)
        return parents