@@ -0,0 +1,619 @@
+import os%0Aimport stat%0Aimport sys%0A%0A_PATH = os.environ.get('PATH', '').split(os.pathsep)%0A_IS_WINDOWS = sys.platform.lower().startswith('win')%0A%0Adef is_executable(p, *path):%0A  path = os.path.join(p, *path)%0A  return os.path.exists(path) and %5C%0A    not os.path.isdir(path) and %5C%0A    os.stat(path)%5Bstat.ST_MODE%5D & stat.S_IXUSR%0A%0Adef which(binary):%0A  if os.path.isabs(binary) and is_executable(binary):%0A    return binary%0A  for dir_ in _PATH:%0A    exe = os.path.join(dir_, binary)%0A    if is_executable(exe):%0A      return exe%0A  if _IS_WINDOWS and not binary.lower().endswith('.exe'):%0A    return which(binary + '.exe')%0A  return None%0A

Add which() function.