code: def unfetched_view(
      index: "Index",
      targets: "TargetType",
      unpartial: bool = False,
      **kwargs,
  ) -> Tuple["IndexView", "IndexView", List["Dependency"]]:
      """Return index view of imports which have not been fetched.
  
      Returns:
          Tuple in the form (legacy_view, view, changed_deps) where changed_imports is a
          list of import dependencies that cannot be fetched due to changed data source.
      """
      from dvc.cachemgr import LEGACY_HASH_NAMES
  
      changed_deps: List["Dependency"] = []
  
      def need_fetch(stage: "Stage", legacy: bool = False) -> bool:
          if not stage.is_import or (
              stage.is_partial_import and not unpartial
          ):
              return False
  
          out = stage.outs[0]
          if not out.changed_cache():
              return False
  
          dep = stage.deps[0]
          if dep.changed_checksum():
              changed_deps.append(dep)
              return False
  
          if out.hash_name in LEGACY_HASH_NAMES and legacy:
              return True
          if out.hash_name not in LEGACY_HASH_NAMES and not legacy:
              return True
          return False
  
      legacy_unfetched = index.targets_view(
          targets,
          stage_filter=partial(need_fetch, legacy=True),
          **kwargs,
      )
      unfetched = index.targets_view(
          targets, stage_filter=need_fetch, **kwargs
      )
      return legacy_unfetched, unfetched, changed_deps
  
file_path: dvc/dvc/repo/imports.py
imports: import os
  from functools import partial
  from tempfile import TemporaryDirectory
  from typing import TYPE_CHECKING, List, Set, Tuple, Union
  from dvc.log import logger
label_desc: Use image node_id 1 for calling a global function with example usage: unfetched_view(index, targets, unpartial) and returns: legacy_unfetched,  unfetched,  changed_deps, False, False, False, False, True, True