<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def exe_cmd(*cmds):
 """Executes commands in a new shell. Directing stderr to PIPE. This is fastboot's own exe_cmd because of its peculiar way of writing non-error info to stderr. Args: cmds: A sequence of commands and arguments. Returns: The output of the command run. Raises: Exception: An error occurred during the command execution. """

    cmd = ' '.join(cmds)
    proc = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True)
    (out, err) = proc.communicate()
    if not err:
        return out
    return err