code: def test_shutdown_with_kill(test_queue, mocker):
      mock_entry_foo = mocker.Mock(stash_rev="af12de")
      mock_entry_foo.name = "foo"
      mock_entry_bar = mocker.Mock(stash_rev="bar")
      mock_entry_bar.name = None
  
      shutdown_spy = mocker.patch("celery.app.control.Control.shutdown")
      mocker.patch.object(
          test_queue,
          "iter_active",
          return_value=[mock_entry_foo, mock_entry_bar],
      )
      kill_spy = mocker.patch.object(test_queue, "_kill_entries")
  
      test_queue.shutdown(kill=True)
  
      shutdown_spy.assert_called_once()
      kill_spy.assert_called_once_with(
          {mock_entry_foo: "foo", mock_entry_bar: "bar"}, True
      )
  
file_path: dvc/tests/unit/repo/experiments/queue/test_celery.py
imports: import time
  import pytest
  from celery import shared_task
  from celery.result import AsyncResult
  from dvc.exceptions import DvcException
  from dvc.repo.experiments.exceptions import UnresolvedExpNamesError
  from dvc.repo.experiments.queue.base import QueueDoneResult
  from dvc.repo.experiments.queue.exceptions import CannotKillTasksError
label_desc: Use image node_id 4 for calling a global function with example usage: test_shutdown_with_kill(test_queue, mocker) without return types