def assert_kwargs(kwargs):
    """Raise an exception if extra keys are present."""
    if len(kwargs) > 0:
        extra = 's' if len(kwargs) > 1 else ''
        raise TypeError('Unexpected argument%s: %s' % (extra, ', '.join(
            kwargs)))
