code: def grow_tree_local(tree, X, y, depth):
      """Build a decision tree by recursively finding the best split."""
      # Population for each class in current node. The predicted class is the one
      # largest population.
      num_samples_per_class = [
          np.sum(y == i) for i in range(tree.n_classes_)
      ]
      predicted_class = np.argmax(num_samples_per_class)
      node = Node(
          gini=tree._gini(y),
          num_samples=y.size,
          num_samples_per_class=num_samples_per_class,
          predicted_class=predicted_class,
      )
  
      # Split recursively until maximum depth is reached.
      if depth < tree.max_depth:
          idx, thr = tree._best_split(X, y)
          if idx is not None:
              indices_left = X[:, idx] < thr
              X_left, y_left = X[indices_left], y[indices_left]
              X_right, y_right = X[~indices_left], y[~indices_left]
              node.feature_index = idx
              node.threshold = thr
              node.left = grow_tree_local(
                  tree, X_left, y_left, depth + 1
              )
              node.right = grow_tree_local(
                  tree, X_right, y_right, depth + 1
              )
      return node
  
imports: import numpy
  import ray
  from sklearn import datasets, metrics
  import time
  import tempfile
  import os
  import json
label_desc: Use image node_id 1 for calling a global function with example usage: grow_tree_local(tree, X, y, depth) and returns: node