The code below picks every n-th element in a way that has good statistical properties while being completely deterministic (so that it returns the same results every time).
def select_every(entry: str, n: int):
import hashlib
h = hashlib.sha256()
h.update(b'salt')
h.update(entry.encode('ascii'))
h = int(h.hexdigest(), 16)
return h % n == 0