<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _add_node(self, node, depth):
 """Add a node to the graph, and the stack."""

        self._topmost_node.add_child(node, bool(depth[1]))
        self._stack.append((depth, node))