code: def _resolve_data_sources(
      plots_data: Dict, rev: str, cache: bool = False
  ):
      from dvc.progress import Tqdm
  
      values = list(plots_data.values())
      to_resolve = []
      while values:
          value = values.pop()
          if isinstance(value, dict):
              if "data_source" in value:
                  to_resolve.append(value)
              values.extend(value.values())
  
      def resolve(value):
          data_source = value.pop("data_source")
          assert callable(data_source)
          value.update(data_source(cache=cache))
  
      if not to_resolve:
          return
  
      executor = ThreadPoolExecutor(
          max_workers=min(16, 4 * cpu_count()),
          thread_name_prefix="resolve_data",
          cancel_on_error=True,
      )
      with executor:
          iterable = executor.imap_unordered(resolve, to_resolve)
          with Tqdm(
              iterable,
              total=len(to_resolve),
              desc=f"Reading plot's data from {rev}",
              unit="files",
              unit_scale=False,
          ) as progress_iterable:
              list(progress_iterable)
  
imports: import csv
  import io
  import os
  from collections import defaultdict
  from copy import deepcopy
  from functools import partial
  from multiprocessing import cpu_count
  from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Optional, Set, Union
  import dpath
  import dpath.options
  from funcy import first, ldistinct, project, reraise
  from dvc.exceptions import DvcException
  from dvc.log import logger
  from dvc.utils import error_handler, errored_revisions
  from dvc.utils.objects import cached_property
  from dvc.utils.serialize import PARSERS, EncodingError
  from dvc.utils.threadpool import ThreadPoolExecutor
  from dvc_render.image import ImageRenderer
label_desc: Use image node_id 4 for calling a global function with example usage: _resolve_data_sources(plots_data, rev, cache) without return types