code: def is_executable(command):
      
  
      paths = os.environ.get("PATH", "").split(os.path.pathsep)
      candidates = [command] + [os.path.join(p, command) for p in paths]
      return any(os.access(path, os.X_OK) for path in candidates)
docs: Returns if a command matches an executable on the PATH