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)
          )  # noqa: T201
  
      # name of step of final estimator in pipeline
      final_estimator = tree.steps[-1][1]
  
      if forest.bootstrap:
          n_samples = X.shape[0]
          if sample_weight is None:
              curr_sample_weight = np.ones(
                  (n_samples,), dtype=np.float64
              )
          else:
              curr_sample_weight = sample_weight.copy()
  
          indices = _generate_sample_indices(
              final_estimator.random_state,
              n_samples,
              n_samples_bootstrap,
          )
          sample_counts = np.bincount(indices, minlength=n_samples)
          curr_sample_weight *= sample_counts
  
          if class_weight == "subsample":
              with catch_warnings():
                  simplefilter("ignore", DeprecationWarning)
                  curr_sample_weight *= compute_sample_weight(
                      "auto", y, indices
                  )
          elif class_weight == "balanced_subsample":
              curr_sample_weight *= compute_sample_weight(
                  "balanced", y, indices
              )
          tree.fit(X, y)
      else:
          tree.fit(X, y)
  
      return tree
  
imports: from abc import abstractmethod
  from warnings import catch_warnings, simplefilter
  import numpy
  import pandas
  from joblib import Parallel, delayed
  from numpy import float64
  from sklearn.base import clone
  from sklearn.ensemble._forest import MAX_INT, BaseForest, _generate_sample_indices, _get_n_samples_bootstrap
  from sklearn.exceptions import DataConversionWarning
  from sklearn.utils import check_array, check_random_state, compute_sample_weight
  from sktime.transformations.panel.summarize import RandomIntervalFeatureExtractor
  from sktime.utils.random_state import set_random_state
  from sktime.utils.warnings import warn
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