code: def powerset(iterable, min_size, max_size, with_replacement=False):
      """powerset([A, B, C], 1, 2) --> (A,) (B,) (C,) (A, B) (A, C) (B, C)"""
      combiner = (
          itertools.combinations_with_replacement
          if with_replacement
          else itertools.combinations
      )
      sizes = range(min_size, max_size + 1)
      return itertools.chain.from_iterable(
          combiner(list(iterable), size) for size in sizes
      )
  
file_path: river/river/feature_extraction/poly.py
imports: from __future__ import annotations
  import itertools
  from river import base, utils
label_desc: Use image node_id 1 for calling a global function with example usage: powerset(iterable, min_size, max_size, with_replacement) and returns: itertools