def is_node_free(node_name):
    print node_name
    try:
        cpu_usage = float(subprocess.Popen(SSH_CMD.split(' ') + [node_name,
            PYTHON_CMD, '%s/scripts/get_cpu_usage.py' % CLUSTER_DIR],
            stdout=subprocess.PIPE).communicate()[0])
        cpu_usage /= 100.0
        mem_usage = float(subprocess.Popen(SSH_CMD.split(' ') + [node_name,
            PYTHON_CMD, '%s/scripts/get_mem_usage.py' % CLUSTER_DIR],
            stdout=subprocess.PIPE).communicate()[0])
    except Exception as e:
        print e
        return False
    print cpu_usage, mem_usage
    return cpu_usage < CPU_FREE_TOL and mem_usage < RAM_FREE_TOL
dataset/ETHPy150Open amaas/stanford-ctc/ctc_fast/cluster/utils.py/is_node_free/original