def validate_attr(attrs, affixes, exclude=tuple()):
    """
    >>> attrs = ['nonull', 'load']
    >>> affixes = ('uniq', 'nonull', 'index')
    >>> exclude = ('none', 'required', 'dump', 'load', 'exclude')
    >>> validate_attr(attrs, affixes, exclude)
    {'nonull': True}
    >>> attrs.append('bbb')
    >>> try:
    ...     validate_attr(attrs, affixes, exclude)
    ... except:
    ...     pass
    Error: Unknown attribute, bbb
    """
    diff = set(attrs) - set(exclude)
    for attr in diff:
        if attr not in affixes:
            print(f'Error: Unknown attribute, {attr}')
            exit(1)
    return dict(zip(diff, [True for i in diff]))