code: def worktree_view(
      index: "Index",
      targets: Optional["TargetType"] = None,
      push: bool = False,
      **kwargs: Any,
  ) -> "IndexView":
      """Return view of data that can be stored in worktree remotes.
  
      Args:
          targets: Optional targets.
          push: Whether the view should be restricted to pushable data only.
  
      Additional kwargs will be passed into target collection.
      """
  
      def stage_filter(stage: "Stage") -> bool:
          if push and stage.is_repo_import:
              return False
          return True
  
      def outs_filter(out: "Output") -> bool:
          if (
              not out.is_in_repo
              or not out.use_cache
              or (push and not out.can_push)
          ):
              return False
          return True
  
      return index.targets_view(
          targets,
          stage_filter=stage_filter,
          outs_filter=outs_filter,
          **kwargs,
      )
  
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 3 for calling a global function with example usage: worktree_view(index, targets, push) and returns: index, True, True, False, False