code: def _collect_definitions(
      repo: "Repo",
      targets=None,
      props: Optional[Dict] = None,
      onerror: Optional[Callable] = None,
      **kwargs,
  ) -> Dict:
      result: Dict = defaultdict(dict)
      props = props or {}
  
      fs = repo.dvcfs
      dpath.merge(
          result,
          _collect_pipeline_files(
              repo, targets, props, onerror=onerror
          ),
      )
  
      dpath.merge(
          result,
          _collect_output_plots(repo, targets, props, onerror=onerror),
      )
  
      for target in targets:
          if not result or fs.exists(target):
              unpacked = unpack_if_dir(
                  fs, target, props=props, onerror=onerror
              )
              dpath.merge(result[""], unpacked)
  
      return dict(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 16 for calling a global function with example usage: _collect_definitions(repo, targets, props, onerror) and returns: dict