import asyncio


async def subprocess_output(cmd, **kwargs):
    """
    Run cmd until completion & return stdout, stderr

    Convenience method to start and run a process
    """
    proc = await asyncio.create_subprocess_exec(
        *cmd,
        stdout=asyncio.subprocess.PIPE,
        stderr=asyncio.subprocess.PIPE,
        **kwargs)

    stdout, stderr = await proc.communicate() 

    return stdout.decode(), stderr.decode()