code: def _get_rescale_factors(data_blocks, rescale_mode):
      if rescale_mode == "max":
          scale_factors = np.array(
              [
                  max(data_block.std(axis=0))
                  for data_block in data_blocks
              ]
          )
      elif rescale_mode == "mean":
          scale_factors = np.array(
              [
                  np.mean(data_block.std(axis=0))
                  for data_block in data_blocks
              ]
          )
      elif rescale_mode is None:
          scale_factors = np.ones(len(data_blocks))
      else:
          raise ValueError("Invalid rescale mode.")
      scale_factors = scale_factors / scale_factors[0]
      return scale_factors
  
imports: from abc import ABC, abstractmethod
  import numpy
  from collections import defaultdict
  from sklearn.ensemble import BaseEnsemble
  from sklearn.ensemble._forest import _generate_unsampled_indices, _generate_sample_indices
  from .local_stumps import make_stumps, tree_feature_transform
label_desc: Use image node_id 2 for calling a global function with example usage: _get_rescale_factors(data_blocks, rescale_mode) and returns: scale_factors