code: def _parallel_build_trees(
      tree,
      forest,
      X,
      y,
      sample_weight,
      tree_idx,
      n_trees,
      verbose=0,
      class_weight=None,
      n_samples_bootstrap=None,
  ):
      """
      Private function used to fit a single tree in parallel."""
      if verbose > 1:
          print("building tree %d of %d" % (tree_idx + 1, n_trees))
  
      if forest.bootstrap:
          n_samples = X.shape[0]
          indices = _generate_sample_indices(
              tree.random_state, n_samples, n_samples_bootstrap
          )
          X, y = X[indices].copy(), y[indices].copy()
          curr_sample_weight = sample_weight[indices].copy()
  
          if class_weight == "subsample":
              with catch_warnings():
                  simplefilter("ignore", DeprecationWarning)
                  curr_sample_weight *= compute_sample_weight(
                      "auto", y, indices=indices
                  )
          elif class_weight == "balanced_subsample":
              curr_sample_weight *= compute_sample_weight(
                  "balanced", y, indices=indices
              )
  
          tree.fit(
              X, y, sample_weight=curr_sample_weight, check_input=False
          )
      else:
          tree.fit(X, y, sample_weight=sample_weight, check_input=False)
  
      return tree
  
imports: from typing import Union
  import numpy
  import forestci
  from joblib import Parallel, delayed
  from warnings import catch_warnings, simplefilter, warn
  from sklearn.exceptions import DataConversionWarning
  from sklearn.utils.validation import check_random_state, _check_sample_weight
  from sklearn.utils.multiclass import type_of_target
  from sklearn import __version__
  from sklearn.ensemble._forest import DOUBLE, DTYPE, MAX_INT
  from sklearn.ensemble._forest import ForestRegressor
  from sklearn.ensemble._forest import compute_sample_weight, issparse
  from sklearn.ensemble._forest import _generate_sample_indices, _get_n_samples_bootstrap
  from .causaltree import CausalTreeRegressor
label_desc: Use image node_id 1 for calling a global function with example usage: _parallel_build_trees(tree, forest, X, y, sample_weight, tree_idx, n_trees, verbose, class_weight, n_samples_bootstrap) and returns: tree