def _ensure_node_parents(self, child):
        task_level = child.task_level
        if task_level.parent() is None:
            return self

        parent = self._nodes.get(task_level.parent())
        if parent is None:
            parent = WrittenAction(task_level=task_level.parent(),
                                   task_uuid=child.task_uuid)
        parent = parent._add_child(child)
        return self._insert_action(parent)
Ensure the node (WrittenAction/WrittenMessage) is referenced by parent
dataset/ETHPy150Open ClusterHQ/eliot/eliot/_parse.py/Task._ensure_node_parents