docs: def which(
      exe=None, default_paths=['/bin', '/sbin', '/usr/bin', '/usr/sbin', '/usr/local/bin']
  ):
      """Return path of bin. Python clone of /usr/bin/which.
  
      from salt.util - https://www.github.com/saltstack/salt - license apache
  
      :param exe: Application to search PATHs for.
      :type exe: str
      :param default_path: Application to search PATHs for.
      :type default_path: list
      :rtype: str
      """
  
      def _is_executable_file_or_link(exe):
          # check for os.X_OK doesn't suffice because directory may executable
          return os.access(exe, os.X_OK) and (os.path.isfile(exe) or os.path.islink(exe))
  
      if _is_executable_file_or_link(exe):
          # executable in cwd or fullpath
          return exe
  
      # Enhance POSIX path for the reliability at some environments, when
      # $PATH is changing. This also keeps order, where 'first came, first
      # win' for cases to find optional alternatives
      search_path = (
          os.environ.get('PATH') and os.environ['PATH'].split(os.pathsep) or list()
      )
      for default_path in default_paths:
          if default_path not in search_path:
              search_path.append(default_path)
      os.environ['PATH'] = os.pathsep.join(search_path)
      for path in search_path:
          full_path = os.path.join(path, exe)
          if _is_executable_file_or_link(full_path):
              return full_path
      logger.info(
          '\'{0}\' could not be found in the following search path: '
          '\'{1}\''.format(exe, search_path)
      )
  
      return None