code: def collect_queued(
      repo: "Repo",
      baseline_revs: Collection[str],
      **kwargs,
  ) -> Dict[str, List["ExpRange"]]:
      """Collect queued experiments derived from the specified revisions.
  
      Args:
          repo: Repo.
          baseline_revs: Resolved baseline Git SHAs.
  
      Returns:
          Dict mapping baseline revision to list of queued experiments.
      """
      if not baseline_revs:
          return {}
      queued_data = {}
      for (
          rev,
          ranges,
      ) in repo.experiments.celery_queue.collect_queued_data(
          baseline_revs, **kwargs
      ).items():
          for exp_range in ranges:
              for exp_state in exp_range.revs:
                  if exp_state.data:
                      attrs = [f.name for f in fields(SerializableExp)]
                      exp_state.data = SerializableExp(
                          **{
                              attr: getattr(exp_state.data, attr)
                              for attr in attrs
                              if attr != "metrics"
                          }
                      )
          queued_data[rev] = ranges
      return queued_data
  
imports: import itertools
  import os
  from dataclasses import fields
  from datetime import datetime
  from typing import TYPE_CHECKING, Collection, Dict, Iterable, Iterator, List, Optional, Tuple, Union
  from funcy import first
  from scmrepo.exceptions import SCMError
  from dvc.log import logger
  from dvc.scm import Git, SCMError, iter_revs
  from .exceptions import InvalidExpRefError
  from .refs import EXEC_BRANCH, ExpRefInfo
  from .serialize import ExpRange, ExpState, SerializableError, SerializableExp
  from .utils import describe
label_desc: Use image node_id 5 for calling a global function with example usage: collect_queued(repo, baseline_revs) and returns: queued_data, dict