def _find_child_of(self, parent_task_spec):
if self.parent is None:<EOL><INDENT>return self<EOL><DEDENT>if self.parent.task_spec == parent_task_spec:<EOL><INDENT>return self<EOL><DEDENT>return self.parent._find_child_of(parent_task_spec)<EOL>
Returns the ancestor that has a task with the given task spec
as a parent.
If no such ancestor was found, the root task is returned.

:type  parent_task_spec: TaskSpec
:param parent_task_spec: The wanted ancestor.
:rtype:  Task
:returns: The child of the given ancestor.