from itertools import cycle treatments = { 'partner': cycle(['other_region', 'other_school', 'ctrl', 'name', 'same_class']), 'partner_interactive_tasks': cycle(['ctrl', 'name', 'same_class']), 'partner_redistribute': cycle(['name', 'same_class/other_school', 'other_school/same_class', 'same_region/other_region', 'ctrl']), 'elective': cycle(['moral', 'lying']), 'iat': cycle(['gender_stem', 'social_background', 'gender', 'market_regulation', 'science']), 'redistribute': cycle(['no_merit', 'merit']), 'qv': cycle(['A']), 'ambiguity': cycle([1, 2]), 'trolley_skins': cycle(['white', 'black']), 'trolley_scenarios': cycle(['bystander', 'bystander', 'footbridge', 'footbridge']), 'sel_treatment': cycle(['self_affirmation', 'student_adviser', 'ctrl']), 'creativity_rating_with_incentive': cycle([True, False]), 'creativity_rating_with_name': cycle([True, True, False, False]), 'grit_round1_hardship': cycle([True, False]), }