class documentation

class Shuffler: (source)

View In Hierarchy

This class implements shuffling with a special consistency property. Consistency means that, for a given seed and key function, if two sets of items are shuffled, the resulting order will agree on the intersection of the two sets. For example, if items are removed from an original set, the shuffled order for the new set will be the shuffled order of the original set restricted to the smaller set.

Method __init__ Undocumented
Method shuffle Return a new list of the items in a shuffled order.
Class Variable hash_algorithm Undocumented
Instance Variable seed Undocumented
Instance Variable seed_source Undocumented
Property seed_display Undocumented
Class Method _hash_text Undocumented
Method _hash_item Undocumented
def __init__(self, seed=None): (source)

Undocumented

def shuffle(self, items, key): (source)

Return a new list of the items in a shuffled order. The `key` is a function that accepts an item in `items` and returns a string unique for that item that can be viewed as a string id. The order of the return value is deterministic. It depends on the seed and key function but not on the original order.

hash_algorithm: str = (source)

Undocumented

Undocumented

seed_source = (source)

Undocumented

@property
seed_display = (source)

Undocumented

@classmethod
def _hash_text(cls, text): (source)

Undocumented

def _hash_item(self, item, key): (source)

Undocumented