def _flatten_descendants(self, include_parts=True):
def get_all_descendants(term):<EOL><INDENT>descendants = set()<EOL>for id_ in term.children:<EOL><INDENT>descendants.add(id_)<EOL>descendants.update(get_all_descendants(self[id_]))<EOL><DEDENT>if include_parts:<EOL><INDENT>for id_ in term.parts:<EOL><INDENT>descendants.add(id_)<EOL>descendants.update(get_all_descendants(self[id_]))<EOL><DEDENT><DEDENT>return descendants<EOL><DEDENT>for term in self:<EOL><INDENT>term.descendants = get_all_descendants(term)<EOL><DEDENT>
Determines and stores all descendants of each GO term.

        Parameters
        ----------
        include_parts: bool, optional
            Whether to include ``part_of`` relations in determining
            descendants.

        Returns
        -------
        None