code: def _load_data_from_outs(index, prefix, outs):
      from dvc_data.index import DataIndexEntry, Meta
  
      parents = set()
      for out in outs:
          if not out.use_cache:
              continue
  
          ws, key = out.index_key
  
          for key_len in range(1, len(key)):
              parents.add((ws, key[:key_len]))
  
          tree = None
          if (
              out.stage.is_import
              and not out.stage.is_repo_import
              and not out.stage.is_db_import
              and out.stage.deps[0].files
          ):
              tree = out.stage.deps[0].get_obj()
          elif out.files:
              tree = out.get_obj()
  
          if tree is not None:
              _load_data_from_tree(index, prefix, ws, key, tree)
  
          entry = DataIndexEntry(
              key=key,
              meta=out.meta,
              hash_info=out.hash_info,
              loaded=None if tree is None else True,
          )
  
          if (
              out.stage.is_import
              and not out.stage.is_repo_import
              and not out.stage.is_db_import
          ):
              dep = out.stage.deps[0]
              entry.meta = dep.meta
              if out.hash_info:
                  entry.hash_info = out.hash_info
              else:
                  # partial import
                  entry.hash_info = dep.hash_info
  
          # FIXME PyGTrie-based DataIndex doesn't remove entry.key during
          # index.add, so we have to set the entry manually here to make
          # index.view() work correctly.
          index[(*prefix, ws, *key)] = entry
  
      for ws, key in parents:
          index[(*prefix, ws, *key)] = DataIndexEntry(
              key=key, meta=Meta(isdir=True), loaded=True
          )
  
imports: import logging
  import time
  from collections import defaultdict
  from functools import partial
  from itertools import chain
  from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator, List, NamedTuple, Optional, Set, Tuple, Union
  from funcy.debug import format_time
  from dvc.dependency import ParamsDependency
  from dvc.fs import LocalFileSystem
  from dvc.fs.callbacks import DEFAULT_CALLBACK
  from dvc.log import logger
  from dvc.utils.objects import cached_property
label_desc: Use image node_id 4 for calling a global function with example usage: _load_data_from_outs(index, prefix, outs) without return types