

def is_exe_in_path(name):
    'Checks whether an executable is in the user\'s search path.\n\n    This expects a name without any system-specific executable extension.\n    It will append the proper extension as necessary. For example,\n    use "myapp" and not "myapp.exe".\n\n    This will return True if the app is in the path, or False otherwise.\n\n    Taken from djblets.util.filesystem to avoid an extra dependency\n    '
    if ((sys.platform == 'win32') and (not dir.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

dataset/ETHPy150Open reviewboard/rbtools/rbtools/utils/filesystem.py is_exe_in_path/VarMisuse@24/182 `name`->`dir`