def run_gpu_job(node, gpu, cmd, blocking=True, stdout=None):
    # TODO Need to ensure that the run folder names don't conflict
    # for training jobs
    print 'Running on %s gpu %d' % (node, gpu)
    if not blocking:
        cmd = (SSH_CMD, node, gpu, cmd) % '%s %s "export CUDA_DEVICE=%d; %s"'
        print cmd
        subprocess.Popen(cmd,
                stdout=stdout, stderr=subprocess.STDOUT, shell=True)
    else:
        cmd = '%s %s "export CUDA_DEVICE=%d; %s"' % (SSH_CMD, node, gpu, cmd)
        print cmd
        if not stdout:
            stdout = subprocess.PIPE
        output = subprocess.Popen(cmd,
                stdout=stdout, shell=True).communicate()[0]
        return output
dataset/ETHPy150Open amaas/stanford-ctc/ctc_fast/cluster/utils.py/run_gpu_job/swapped operands of `%`