code: def random_permutation(iterable, r=None):
      """Return a random *r* length permutation of the elements in *iterable*.
  
      If *r* is not specified or is ``None``, then *r* defaults to the length of
      *iterable*.
  
          >>> random_permutation(range(5))  # doctest:+SKIP
          (3, 4, 0, 1, 2)
  
      This equivalent to taking a random selection from
      ``itertools.permutations(iterable, r)``.
  
      """
      pool = tuple(iterable)
      r = len(pool) if r is None else r
      return tuple(sample(pool, r))
  
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 23 for calling a global function with example usage: random_permutation(iterable, r) and returns: tuple