code: def _local_parallel_build_trees(
      sampler,
      tree,
      bootstrap,
      X,
      y,
      sample_weight,
      tree_idx,
      n_trees,
      verbose=0,
      class_weight=None,
      n_samples_bootstrap=None,
      forest=None,
      missing_values_in_feature_mask=None,
  ):
      # resample before to fit the tree
      X_resampled, y_resampled = sampler.fit_resample(X, y)
      if sample_weight is not None:
          sample_weight = _safe_indexing(
              sample_weight, sampler.sample_indices_
          )
      if _get_n_samples_bootstrap is not None:
          n_samples_bootstrap = min(
              n_samples_bootstrap, X_resampled.shape[0]
          )
  
      params_parallel_build_trees = {
          "tree": tree,
          "X": X_resampled,
          "y": y_resampled,
          "sample_weight": sample_weight,
          "tree_idx": tree_idx,
          "n_trees": n_trees,
          "verbose": verbose,
          "class_weight": class_weight,
          "n_samples_bootstrap": n_samples_bootstrap,
      }
  
      if parse_version(sklearn_version.base_version) >= parse_version(
          "1.4"
      ):
          # TODO: remove when the minimum supported version of scikit-learn will be 1.4
          # support for missing values
          params_parallel_build_trees[
              "missing_values_in_feature_mask"
          ] = missing_values_in_feature_mask
  
      # TODO: remove when the minimum supported version of scikit-learn will be 1.1
      # change of signature in scikit-learn 1.1
      if parse_version(sklearn_version.base_version) >= parse_version(
          "1.1"
      ):
          params_parallel_build_trees["bootstrap"] = bootstrap
      else:
          params_parallel_build_trees["forest"] = forest
  
      tree = _parallel_build_trees(**params_parallel_build_trees)
  
      return sampler, tree
  
imports: import numbers
  from copy import deepcopy
  from warnings import warn
  import numpy
  import sklearn
  from numpy import float32
  from numpy import float64
  from scipy.sparse import issparse
  from sklearn.base import clone, is_classifier
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.ensemble._base import _set_random_states
  from sklearn.ensemble._forest import _generate_unsampled_indices, _get_n_samples_bootstrap, _parallel_build_trees
  from sklearn.exceptions import DataConversionWarning
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.utils import _safe_indexing, check_random_state, parse_version
  from sklearn.utils.multiclass import type_of_target
  from sklearn.utils.validation import _check_sample_weight
  from ..base import _ParamsValidationMixin
  from ..pipeline import make_pipeline
  from ..under_sampling import RandomUnderSampler
  from ..utils import Substitution
  from ..utils._docstring import _n_jobs_docstring, _random_state_docstring
  from ..utils._param_validation import Hidden, Interval, StrOptions
  from ..utils._validation import check_sampling_strategy
  from ..utils.fixes import _fit_context
  from ._common import _random_forest_classifier_parameter_constraints
label_desc: Use image node_id 1 for calling a global function with example usage: _local_parallel_build_trees(sampler, tree, bootstrap, X, y, sample_weight, tree_idx, n_trees, verbose, class_weight, n_samples_bootstrap, forest, missing_values_in_feature_mask) and returns: sampler,  tree