class_docstr: Read-only view of Index.data using filtered stages.
class_docstr_tok: ["Read-only","view","of","Index.data","using","filtered","stages","."]
code: def data(self) -> Dict[str, Union["DataIndex", "DataIndexView"]]:
      from dvc_data.index import DataIndex, view
  
      def key_filter(workspace: str, key: "DataIndexKey"):
          try:
              prefixes = self._data_prefixes[workspace]
              return key in prefixes.explicit or any(
                  key[: len(prefix)] == prefix
                  for prefix in prefixes.recursive
              )
          except KeyError:
              return False
  
      data: Dict[str, Union["DataIndex", "DataIndexView"]] = {}
      for workspace, data_index in self._index.data.items():
          if self.stages:
              data[workspace] = view(
                  data_index, partial(key_filter, workspace)
              )
          else:
              data[workspace] = DataIndex()
      return data
  
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 10 for calling the IndexView obj's underlying member method code with example usage: obj.data() and returns: data, unknown, False