code: def test_list(tmp_dir, scm, dvc, exp_stage):
      baseline_old = scm.get_rev()
  
      results = dvc.experiments.run(
          exp_stage.addressing, params=["foo=2"]
      )
      exp_a = first(results)
      ref_info_a = first(exp_refs_by_rev(scm, exp_a))
  
      results = dvc.experiments.run(
          exp_stage.addressing, params=["foo=3"]
      )
      exp_b = first(results)
      ref_info_b = first(exp_refs_by_rev(scm, exp_b))
  
      tmp_dir.scm_gen("new", "new", commit="new")
      baseline_new = scm.get_rev()
  
      results = dvc.experiments.run(
          exp_stage.addressing, params=["foo=4"]
      )
      exp_c = first(results)
      ref_info_c = first(exp_refs_by_rev(scm, exp_c))
  
      assert dvc.experiments.ls() == {
          baseline_new: [(ref_info_c.name, exp_c)]
      }
  
      exp_list = dvc.experiments.ls(rev=ref_info_a.baseline_sha)
      assert {key: set(val) for key, val in exp_list.items()} == {
          baseline_old: {
              (ref_info_a.name, exp_a),
              (ref_info_b.name, exp_b),
          }
      }
  
      exp_list = dvc.experiments.ls(rev=[baseline_old, baseline_new])
      assert {key: set(val) for key, val in exp_list.items()} == {
          baseline_old: {
              (ref_info_a.name, exp_a),
              (ref_info_b.name, exp_b),
          },
          baseline_new: {(ref_info_c.name, exp_c)},
      }
  
      exp_list = dvc.experiments.ls(all_commits=True)
      assert {key: set(val) for key, val in exp_list.items()} == {
          baseline_old: {
              (ref_info_a.name, exp_a),
              (ref_info_b.name, exp_b),
          },
          baseline_new: {(ref_info_c.name, exp_c)},
      }
  
      scm.checkout("branch", True)
      exp_list = dvc.experiments.ls(all_commits=True)
      assert {key: set(val) for key, val in exp_list.items()} == {
          baseline_old: {
              (ref_info_a.name, exp_a),
              (ref_info_b.name, exp_b),
          },
          baseline_new: {(ref_info_c.name, exp_c)},
      }
  
imports: import itertools
  import logging
  import os
  import stat
  from textwrap import dedent
  import pytest
  from configobj import ConfigObj
  from funcy import first
  from dvc.dvcfile import PROJECT_FILE
  from dvc.env import DVC_EXP_BASELINE_REV, DVC_EXP_NAME, DVC_ROOT, DVC_STUDIO_OFFLINE, DVC_STUDIO_REPO_URL, DVC_STUDIO_TOKEN, DVC_STUDIO_URL
  from dvc.exceptions import DvcException, ReproductionError
  from dvc.repo.experiments.exceptions import ExperimentExistsError
  from dvc.repo.experiments.queue.base import BaseStashQueue
  from dvc.repo.experiments.refs import CELERY_STASH
  from dvc.repo.experiments.utils import exp_refs_by_rev
  from dvc.scm import SCMError, resolve_rev
  from dvc.stage.exceptions import StageFileDoesNotExistError
  from dvc.testing.scripts import COPY_SCRIPT
  from dvc.utils.serialize import PythonFileCorruptedError
label_desc: Use image node_id 12 for calling a global function with example usage: test_list(tmp_dir, scm, dvc, exp_stage) without return types