def get_descendants(<EOL>self,<EOL>collections=True,<EOL>resources=True,<EOL>depth_first=False,<EOL>depth="<STR_LIT>",<EOL>add_self=False,<EOL>):
assert depth in ("<STR_LIT:0>", "<STR_LIT:1>", "<STR_LIT>")<EOL>res = []<EOL>if add_self and not depth_first:<EOL><INDENT>res.append(self)<EOL><DEDENT>if depth != "<STR_LIT:0>" and self.is_collection:<EOL><INDENT>for child in self.get_member_list():<EOL><INDENT>if not child:<EOL><INDENT>self.get_member_list()<EOL><DEDENT>want = (collections and child.is_collection) or (<EOL>resources and not child.is_collection<EOL>)<EOL>if want and not depth_first:<EOL><INDENT>res.append(child)<EOL><DEDENT>if child.is_collection and depth == "<STR_LIT>":<EOL><INDENT>res.extend(<EOL>child.get_descendants(<EOL>collections, resources, depth_first, depth, add_self=False<EOL>)<EOL>)<EOL><DEDENT>if want and depth_first:<EOL><INDENT>res.append(child)<EOL><DEDENT><DEDENT><DEDENT>if add_self and depth_first:<EOL><INDENT>res.append(self)<EOL><DEDENT>return res<EOL>
Return a list _DAVResource objects of a collection (children,
        grand-children, ...).

        This default implementation calls self.get_member_list() recursively.

        This function may also be called for non-collections (with add_self=True).

        :Parameters:
            depth_first : bool
                use <False>, to list containers before content.
                (e.g. when moving / copying branches.)
                Use <True>, to list content before containers.
                (e.g. when deleting branches.)
            depth : string
                '0' | '1' | 'infinity'