def gen_node_list(self):
        """
        generates an ordered node_list such that parent appears before children
        useful for updating predictive posteriors
        """
        self.node_list = [self.root]
        i = -1
        while True:
            try:
                i += 1
                node_id = self.node_list[i]
            except __HOLE__:
                break
            if not node_id.is_leaf:
                self.node_list.extend([node_id.left, node_id.right])
dataset/ETHPy150Open balajiln/mondrianforest/src/mondrianforest.py/MondrianTree.gen_node_list