code: def random_combination_with_replacement(iterable, r):
      """Return a random *r* length subsequence of elements in *iterable*,
      allowing individual elements to be repeated.
  
          >>> random_combination_with_replacement(range(3), 5) # doctest:+SKIP
          (0, 0, 1, 2, 2)
  
      This equivalent to taking a random selection from
      ``itertools.combinations_with_replacement(iterable, r)``.
  
      """
      pool = tuple(iterable)
      n = len(pool)
      indices = sorted(randrange(n) for i in range(r))
      return tuple(pool[i] for i in indices)
  
imports: import warnings
  from collections import deque
  from itertools import chain, combinations, count, cycle, groupby, islice, repeat, starmap, tee, zip_longest
  import operator
  from random import randrange, sample, choice
label_desc: Use image node_id 25 for calling a global function with example usage: random_combination_with_replacement(iterable, r) and returns: tuple