def cmd_output(cmd, *args, **kwargs):
    if isinstance(cmd, basestring):
        cmd = cmd.split()
    return subprocess.check_output(cmd, *args, stderr=subprocess.STDOUT, **kwargs)
def cmd_output(cmd, *args, **kwargs):
    if isinstance(cmd, basestring):
        cmd = cmd.split()
    return subprocess.check_output(cmd, *args, stderr=subprocess.STDOUT, **kwargs)