def src(tokens, base_url):
    """``src`` descriptor validation."""
    if len(tokens) in (1, 2):
        tokens, token = tokens[:-1], tokens[-1]
        if token.type == 'function' and token.lower_name == 'format':
            tokens, token = tokens[:-1], tokens[-1]
        if token.type == 'function' and token.lower_name == 'local':
            return 'local', font_family(token.arguments, allow_spaces=True)
        url = get_url(token, base_url)
        if url is not None and url[0] == 'url':
            return url[1]
``src`` descriptor validation.
weasyprint/css/validation/descriptors.py