<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def shell(cmd, **kwargs):
 """Execute cmd, check exit code, return stdout"""

    logger.debug("$ %s", cmd)
    return subprocess.check_output(cmd, shell=True, **kwargs)