def list_of(validate_item):
def validate(value, should_raise=True):<EOL><INDENT>validate_type = is_type(list)<EOL>if not validate_type(value, should_raise=should_raise):<EOL><INDENT>return False<EOL><DEDENT>for item in value:<EOL><INDENT>try:<EOL><INDENT>validate_item(item)<EOL><DEDENT>except TypeError as e:<EOL><INDENT>if should_raise:<EOL><INDENT>samtranslator.model.exceptions.prepend(e, "<STR_LIT>")<EOL>raise<EOL><DEDENT>return False<EOL><DEDENT><DEDENT>return True<EOL><DEDENT>return validate<EOL>
Returns a validator function that succeeds only if the input is a list, and each item in the list passes as input
    to the provided validator validate_item.

    :param callable validate_item: the validator function for items in the list
    :returns: a function which returns True its input is an list of valid items, and raises TypeError otherwise
    :rtype: callable