def vd_str_in(alist):
    """Return a validator that tests whether a string is in a list"""
    def str_in(value):
        if value not in alist:
            raise ValueError("Invalid value '{}', must be in {}!".format(
                value, alist))
        return value
    return str_in