code: def _find_child_of(self, parent_task_spec):
          
          if self.parent is None:
              return self
          if self.parent.task_spec == parent_task_spec:
              return self
          return self.parent._find_child_of(parent_task_spec)
docs: 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.