code: def _nodes(self, tree):
          
          def recourse(temp_tree_, nodes):
              if isinstance(temp_tree_, dict):
                  if temp_tree_['split'] != -1:
                      nodes.append(temp_tree_['node'])
                      if temp_tree_['split'] != -1:
                          for k in ['sl', 'sr']:
                              recourse(temp_tree_[k], nodes)
              return None
  
          nodes_ = []
          recourse(tree, nodes_)
          return nodes_
docs: Private function that find the number of nodes in a tree.
  
          Parameters
          ----------
          tree : object
  
          Returns
          -------
          nodes : array like of shape [n_nodes]