code: def _tree_decision_function(instance, estimator):
      n_samples = _num_samples(instance)
  
      # We get as many rows as possible within our working_memory budget
      # (defined by sklearn.get_config()['working_memory']) to store
      # self._max_features in each row during computation.
      #
      # Note:
      #  - this will get at least 1 row, even if 1 row of score will
      #    exceed working_memory.
      #  - this does only account for temporary memory usage while loading
      #    the data needed to compute the scores -- the returned scores
      #    themselves are 1D.
  
      chunk_n_rows = get_chunk_n_rows(
          row_bytes=16 * instance.shape[1], max_n_rows=n_samples
      )
      slices = sklearn_gen_batches(n_samples, chunk_n_rows)
  
      scores = np.zeros(n_samples, order="f")
  
      for sl in slices:
          # compute score on the slices of test samples:
          scores[sl] = _compute_score_samples(instance[sl], estimator)
  
      return scores
  
imports: import numbers
  import warnings
  from typing import Union
  import numpy
  from sklearn.base import OutlierMixin
  from sklearn.tree import ExtraTreeRegressor
  from sklearn.utils import check_array, gen_batches
  from ...None import tensor
  from ...lib.sparse import issparse
  from ...session import execute
  from ...tensor.utils import check_random_state
  from ..utils import get_chunk_n_rows, convert_to_tensor_or_dataframe
  from ..utils.validation import _num_samples, check_is_fitted
  from ._bagging import BaseBagging, BaggingPredictionOperand, PredictionType
label_desc: Use image node_id 2 for calling a global function with example usage: _tree_decision_function(instance, estimator) and returns: scores