<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def getDescendants(self, all_descendants=False):
 """Returns the descendant Analysis Requests :param all_descendants: recursively include all descendants """


        # N.B. full objects returned here from
        #      `Products.Archetypes.Referenceable.getBRefs`
        #      -> don't add this method into Metadata
        children = self.getBackReferences(
            "AnalysisRequestParentAnalysisRequest")

        descendants = []

        # recursively include all children
        if all_descendants:
            for child in children:
                descendants.append(child)
                descendants += child.getDescendants(all_descendants=True)
        else:
            descendants = children

        return descendants