

def _program_in_path(program):
    path = os.environ.get('PATH', os.defpath).split(os.pathsep)
    path = [os.path.join(dir, program) for dir in path]
    path = [True for file in path if (os.path.isfile(file) or os.path.isfile((file + '.exe')))]
    return bool(path)

dataset/ETHPy150Open Exa-Networks/exabgp/lib/exabgp/dep/objgraph.py _program_in_path/original