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 math
  import operator
  from collections import deque
  from collections.abc import Sized
  from functools import partial, reduce
  from itertools import chain, combinations, compress, count, cycle, groupby, islice, product, repeat, starmap, tee, zip_longest
  from random import randrange, sample, choice
label_desc: Use image node_id 27 for calling a global function with example usage: random_combination_with_replacement(iterable, r) and returns: tuple