Deterministic A/B tests via the hashing trick
In principle A/B testing is really simple. To do it you need to define two separate user experiences, and then randomly allocate users between them:
def final_experience(user):
if random.choice([0,1]) == 0:
return…