def cmd_exists(cmd):
    return subprocess.call("type " + cmd, shell=True,
                               stdout=subprocess.PIPE,
                               stderr=subprocess.PIPE) == 0
Returns: bool, True if 'cmd' is in PATH, False otherwise.
dataset/ETHPy150Open m-lab/operator/tools/drac.py/cmd_exists