    def keyword_validator(tokens):
        """Wrap a validator to call get_single_keyword on tokens."""
        keyword = get_single_keyword(tokens)
        if function(keyword):
            return keyword
Wrap a validator to call get_single_keyword on tokens.
weasyprint/css/utils.py