def is_exe_in_path(name):
    if sys.platform == 'win32' and not name.endswith('.exe'):
        name += '.exe'

    for dir in os.environ['PATH'].split(os.pathsep):
        if os.path.exists(os.path.join(dir, name)):
            return True

    return False
Checks whether an executable is in the user's search path.
dataset/ETHPy150Open reviewboard/rbtools/rbtools/utils/filesystem.py/is_exe_in_path