scamp_extensions.process.generators.non_repeating_shuffle
- scamp_extensions.process.generators.non_repeating_shuffle(input_list, stop_after=inf, insertion_threshold=0.5)[source]
Returns a generator that randomly selects items from the input list, avoiding repeat selections.
- Parameters:
input_list – the list to shuffle through
stop_after – stops after returning this many items
insertion_threshold – how close to insert an item back in the deck after it has been selected. When close to 1, the same item can be returned in close proximity to itself, when close to 0, we cycle through almost every other item before getting the same item again. (At 0, becomes a deterministic repeated shuffle.)