def gen_choice(choices):

    # Validation for 'choices'
    if choices is None:
        raise ValueError("Choices argument cannot be None.")
    # We don't want a single dictionary value.
    if not isinstance(choices, Iterable) or isinstance(choices, dict):
        raise ValueError("Choices argument is not iterable.")
    if len(choices) == 0:
        raise ValueError("Choices argument cannot be empty.")
    # If only 1 item is present, return it right away
    if len(choices) == 1:
        return choices[0]

    random.seed()
    return random.choice(choices)
Returns a random choice from the available choices.
dataset/ETHPy150Open omaciel/fauxfactory/fauxfactory/__init__.py/gen_choice