def get_flat_relative_ids(self, upstream=False, found_descendants=None):
if not found_descendants:<EOL><INDENT>found_descendants = set()<EOL><DEDENT>relative_ids = self.get_direct_relative_ids(upstream)<EOL>for relative_id in relative_ids:<EOL><INDENT>if relative_id not in found_descendants:<EOL><INDENT>found_descendants.add(relative_id)<EOL>relative_task = self._dag.task_dict[relative_id]<EOL>relative_task.get_flat_relative_ids(upstream,<EOL>found_descendants)<EOL><DEDENT><DEDENT>return found_descendants<EOL>
Get a flat list of relatives' ids, either upstream or downstream.