code: def _ls(
      repo: "Repo",
      path: str,
      recursive: Optional[bool] = None,
      dvc_only: bool = False,
  ):
      fs: "DVCFileSystem" = repo.dvcfs
      fs_path = fs.from_os_path(path)
  
      fs_path = fs.info(fs_path)["name"]
  
      infos = {}
      for root, dirs, files in fs.walk(
          fs_path, dvcfiles=True, dvc_only=dvc_only, detail=True
      ):
          if not recursive:
              files.update(dirs)
  
          parts = fs.relparts(root, fs_path)
          if parts == (".",):
              parts = ()
  
          for name, entry in files.items():
              infos[os.path.join(*parts, name)] = entry
  
          if not recursive:
              break
  
      if not infos and fs.isfile(fs_path):
          infos[os.path.basename(path)] = fs.info(fs_path)
  
      ret = {}
      for name, info in infos.items():
          dvc_info = info.get("dvc_info", {})
          ret[name] = {
              "isout": dvc_info.get("isout", False),
              "isdir": info["type"] == "directory",
              "isexec": info.get("isexec", False),
              "size": info.get("size"),
          }
  
      return ret
  
label_desc: Use image node_id 2 for calling a global function with example usage: _ls(repo, path, recursive, dvc_only) and returns: ret