def __init__()

in online_attacks/datastream/toy_data.py [0:0]


    def __init__(self, N: int, max_perms: int = 120):
        self.perms = []
        total_perms = np.math.factorial(N)
        max_perms = np.minimum(max_perms, total_perms)
        for i in range(
            max_perms
        ):  # (1) Draw N samples from permutations Universe U (#U = k!)
            while True:  # (2) Endless loop
                perm = np.random.permutation(
                    N
                )  # (3) Generate a random permutation form U
                key = tuple(perm)
                if (
                    key not in self.perms
                ):  # (4) Check if permutation already has been drawn (hash table)
                    self.perms.append(key)  # (5) Insert into set
                    break
                pass