def random_combination(iterable, r):
    """Random selection from itertools.combinations(iterable, r)"""
pool = tuple(iterable)
n = len(pool)
indices = sorted(random.sample(list(range(n)), r))
return tuple(pool[i] for i in indices)
Choose at random from combinations