code: def collect_exp(
      proc_dict: Dict[str, Any],  # noqa: ARG001
      entry_dict: Dict[str, Any],
  ) -> str:
      """Collect results for an experiment.
  
      Arguments:
          proc_dict: Serialized ProcessInfo for experiment executor process.
          entry_dict: Serialized QueueEntry for this experiment.
  
      Returns:
          Directory to be cleaned up after this experiment.
      """
      from dvc.repo import Repo
  
      entry = QueueEntry.from_dict(entry_dict)
      with Repo(entry.dvc_root) as repo:
          celery_queue = repo.experiments.celery_queue
          infofile = celery_queue.get_infofile_path(entry.stash_rev)
          executor_info = ExecutorInfo.load_json(infofile)
          logger.debug(
              "Collecting experiment info '%s'", str(executor_info)
          )
          executor = TempDirExecutor.from_info(executor_info)
          exec_result = executor_info.result
          try:
              if exec_result is not None:
                  BaseStashQueue.collect_executor(
                      repo.experiments, executor, exec_result
                  )
              else:
                  logger.debug(
                      "Experiment failed (Exec result was None)"
                  )
                  celery_queue.stash_failed(entry)
          except Exception:
              # Log exceptions but do not re-raise so that task chain execution
              # continues
              logger.exception("Failed to collect experiment")
      return executor.root_dir
  
file_path: dvc/dvc/repo/experiments/queue/tasks.py
imports: from typing import TYPE_CHECKING, Any, Dict, List, Optional
  from celery import shared_task
  from celery.utils.log import get_task_logger
  from dvc.repo.experiments.executor.base import ExecutorInfo
  from dvc.repo.experiments.executor.local import TempDirExecutor
  from .base import BaseStashQueue, QueueEntry
label_desc: Use image node_id 2 for calling a global function with example usage: collect_exp(proc_dict, entry_dict) and returns: executor