code: def update_worktree_stages(
      repo: "Repo",
      stage_infos: Iterable["StageInfo"],
  ):
      from dvc.repo.index import IndexView
  
      def outs_filter(out: "Output") -> bool:
          return out.is_in_repo and out.use_cache and out.can_push
  
      view = IndexView(
          repo.index,
          stage_infos,
          outs_filter=outs_filter,
      )
      local_index = view.data["repo"]
      remote_indexes: Dict[str, Tuple["Remote", "DataIndex"]] = {}
      for stage in view.stages:
          for out in stage.outs:
              _update_worktree_out(
                  repo, out, local_index, remote_indexes
              )
          stage.dump(with_files=True, update_pipeline=False)
  
file_path: dvc/dvc/repo/worktree.py
imports: from functools import partial
  from typing import TYPE_CHECKING, Any, Dict, Iterable, Optional, Tuple, Union
  from funcy import first
  from dvc.log import logger
  from dvc.stage.exceptions import StageUpdateError
label_desc: Use image node_id 6 for calling a global function with example usage: update_worktree_stages(repo, stage_infos) and returns: unknown