code: def _collect_pipeline_files(
      repo, targets: List[str], props, onerror=None
  ):
      result: Dict[str, Dict] = {}
      top_plots = repo.index._plots
      for dvcfile, plots_def in top_plots.items():
          dvcfile_path = _relpath(repo.dvcfs, dvcfile)
          dvcfile_defs_dict: Dict[str, Union[Dict, None]] = {}
          for elem in plots_def:
              if isinstance(elem, str):
                  dvcfile_defs_dict[elem] = None
              else:
                  assert elem
                  k, v = next(iter(elem.items()))
                  dvcfile_defs_dict[k] = v
  
          resolved = _resolve_definitions(
              repo.dvcfs,
              targets,
              props,
              dvcfile_path,
              dvcfile_defs_dict,
              onerror=onerror,
          )
          dpath.merge(
              result,
              {dvcfile_path: resolved},
          )
      return result
  
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 15 for calling a global function with example usage: _collect_pipeline_files(repo, targets, props, onerror) and returns: result