cuckoo/filter.py in insert(self, item)
221 for _ in range(self.max_kicks):
222 # Swap the item's fingerprint with a fingerprint in the bucket
--> 223 fingerprint = self.buckets[index].swap(fingerprint)
224
225 # Save the swapped fingerprint here so we can restore it later
cuckoo/bucket.py in swap(self, fingerprint)
99 # TODO: Investigate if there is a better solution for this cause this
100 # is a form of local limit of Cuckoo filter.
--> 101 rindex = random.choice([i for i in range(len(self.bucket))
102 if fingerprint != self.bucket[i]])
103