code: def __init__(self, sequence: Sequence[int]):
      sampled = random.choices(sequence, k=len(sequence))
  
      c = collections.Counter(sampled)
      max_value = len(sequence) + 1
  
      self.replacements: dict[int, list[int]] = {}
      for k, v in c.items():
          self.replacements[k] = [v]
          if v > 1:
              for _ in range(v - 1):
                  self.replacements[k].append(max_value)
                  max_value += 1
  
imports: from __future__ import annotations
  import collections
  import functools
  import itertools
  import logging
  import math
  import random
  from abc import ABC
  from typing import TYPE_CHECKING, overload
  from warnings import warn
  from .None import blocking, branch_and_bound
label_desc: Use image node_id 1 to create a new Resampler object from inherited base classes: object with example: obj = Resampler(sequence)