import asyncio


def aiowait(timeout):
    """Wait for the awaitable to complete with a timeout."""
    def decorator(func):
        def wrapper(*args, **kwargs):
            return asyncio.wait_for(func(*args, **kwargs), timeout)
        return wrapper
    return decorator