code: def __weight_sampler_factory(self) -> Sampler:
      if self.resampling_strategy == self._BAGGING:
          return BaggingSampler()
      elif self.resampling_strategy == self._SUBBAGGING:
          return SubBaggingSampler()
      else:
          return ConstantSampler()
  
imports: from __future__ import annotations
  import abc
  import collections
  import math
  import random
  import sys
  from river import base, drift, metrics, tree, utils
  from river.tree.nodes.et_nodes import ETLeafAdaptive, ETLeafMean, ETLeafModel
  from river.tree.splitter.random_splitter import RegRandomSplitter
label_desc: Use image node_id 7 for calling the ExtraTrees obj's underlying member method code with example usage: obj.__weight_sampler_factory() and returns: BaggingSampler, SubBaggingSampler, ConstantSampler