def factory_choice_generator(values):
def choice_generator():<EOL><INDENT>my_list = list(values)<EOL>rand = random.Random()<EOL>while(True):<EOL><INDENT>yield random.choice(my_list)<EOL><DEDENT><DEDENT>return choice_generator<EOL>
Return a generator that picks values from a list randomly