code: def _which(command):
      
      if isinstance(command, str):
          command = [command]
      command = list(command)
      name = command[0]
      args = command[1:]
  
      if _is_windows():
          pathext = _decode_if_not_text(os.environ.get("PATHEXT", ""))
          path = _find_executable(name, pathext.split(os.pathsep))
      else:
          path = _find_executable(name)
  
      if not path:
          return None
      return [path] + args
docs: protected