def validate_list(arg, choices):
    """
    Make sure the argument is in the list of choices passed to the function
    """
    if arg not in choices:
        raise ValueError('Value not in list: %s' % str(choices))
