def justify_self(tokens):
    """``justify-self`` property validation."""
    if len(tokens) == 1:
        keyword = get_keyword(tokens[0])
        if keyword in (
                'auto', 'normal', 'stretch', 'center', 'start', 'end',
                'self-start', 'self-end', 'flex-start', 'flex-end', 'left',
                'right'):
            return (keyword,)
        elif keyword == 'baseline':
            return ('first', keyword)
    elif len(tokens) == 2:
        keywords = tuple(get_keyword(token) for token in tokens)
        if keywords[0] in ('safe', 'unsafe'):
            if keywords[1] in (
                    'center', 'start', 'end', 'self-start', 'self-end',
                    'flex-start', 'flex-end', 'left', 'right'):
                return keywords
        elif 'baseline' in keywords:
            if 'first' in keywords or 'last' in keywords:
                return keywords
``justify-self`` property validation.
weasyprint/css/validation/properties.py