code: def _load_data_from_tree(index, prefix, ws, key, tree):
      from dvc_data.index import DataIndexEntry, Meta
  
      parents = set()
  
      for okey, ometa, ohi in tree:
          for key_len in range(1, len(okey)):
              parents.add((*key, *okey[:key_len]))
  
          fkey = (*key, *okey)
          index[(*prefix, ws, *fkey)] = DataIndexEntry(
              key=fkey,
              meta=ometa,
              hash_info=ohi,
          )
  
      for parent in parents:
          index[(*prefix, ws, *parent)] = DataIndexEntry(
              key=parent, 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 3 for calling a global function with example usage: _load_data_from_tree(index, prefix, ws, key, tree) without return types