code: def setup_exp(entry_dict: Dict[str, Any]) -> "BaseExecutor":
      """Setup an experiment.
  
      Arguments:
          entry_dict: Serialized QueueEntry for this experiment.
  
      Returns:
          Root executor (temp) directory for this experiment.
      """
      from dvc.repo import Repo
  
      entry = QueueEntry.from_dict(entry_dict)
      with Repo(entry.dvc_root) as repo:
          # TODO: split executor.init_cache into separate subtask - we can release
          # exp.scm_lock before DVC push
          executor = BaseStashQueue.init_executor(
              repo.experiments,
              entry,
              TempDirExecutor,
              location="dvc-task",
          )
          infofile = repo.experiments.celery_queue.get_infofile_path(
              entry.stash_rev
          )
          executor.info.dump_json(infofile)
      return executor
  
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 1 for calling a global function with example usage: setup_exp(entry_dict) and returns: executor