docs: def which(cmd, safe=False):
      """https://github.com/jc0n/python-which"""
      from autopaths.file_path import FilePath
      def is_executable(path):
          return os.path.exists(path) and os.access(path, os.X_OK) and not os.path.isdir(path)
      path, name = os.path.split(cmd)
      if path:
          if is_executable(cmd): return FilePath(cmd)
      else:
          for path in os.environ['PATH'].split(os.pathsep):
              candidate = os.path.join(path, cmd)
              if is_executable(candidate): return FilePath(candidate)
      if not safe: raise Exception('which failed to locate a proper command path "%s"' % cmd)