<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_node_path(self, node):
 """Return the path from the root to ``node`` as a list of node names."""

        path = []
        while node.up:
            path.append(node.name)
            node = node.up
        return list(reversed(path))