<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parent_resources(cls):
 """Get a list of parent resources, starting from the Document"""

        parent = cls.parent_resource
        parents = [parent]

        try:
            while True:
                parent = parent.parent_resource
                parents.append(parent)
        except AttributeError:
            pass

        parents.reverse()
        return parents