code: def _data_cells(
      exp: "ExpState",
      *,
      metrics_headers: Iterable[str],
      params_headers: Iterable[str],
      metrics_names: Mapping[str, Iterable[str]],
      params_names: Mapping[str, Iterable[str]],
      deps_names: Iterable[str],
      fill_value: Optional[str] = "-",
      error_value: str = "!",
      precision: Optional[int] = None,
      **kwargs,
  ) -> Iterator[Tuple[str, "CellT"]]:
      def _d_cells(
          d: Mapping[str, Any],
          names: Mapping[str, Iterable[str]],
          headers: Iterable[str],
      ) -> Iterator[Tuple[str, "CellT"]]:
          from dvc.compare import _format_field, with_value
  
          for fname, data in d.items():
              item = data.get("data", {})
              item = (
                  flatten(item)
                  if isinstance(item, dict)
                  else {fname: item}
              )
              for name in names[fname]:
                  value = with_value(
                      item.get(name),
                      error_value if data.get("error") else fill_value,
                  )
                  # wrap field data in ui.rich_text, otherwise rich may
                  # interpret unescaped braces from list/dict types as rich
                  # markup tags
                  value = ui.rich_text(
                      str(_format_field(value, precision))
                  )
                  if name in headers:
                      yield name, value
                  else:
                      yield f"{fname}:{name}", value
  
      if not exp.data:
          return
      yield from _d_cells(
          exp.data.metrics, metrics_names, metrics_headers
      )
      yield from _d_cells(exp.data.params, params_names, params_headers)
      for name in deps_names:
          dep = exp.data.deps.get(name)
          if dep:
              yield name, dep.hash or fill_value
  
imports: from collections import Counter, defaultdict
  from datetime import date, datetime
  from typing import TYPE_CHECKING, Any, Dict, Iterable, Iterator, List, Literal, Mapping, NamedTuple, Optional, Set, Tuple, Union
  from dvc.exceptions import InvalidArgumentError
  from dvc.log import logger
  from dvc.scm import Git
  from dvc.ui import ui
  from dvc.utils.flatten import flatten
  from .collect import collect
label_desc: Use image node_id 7 for calling a global function with example usage: _data_cells(exp) without return types