code: def test_remove_queued(test_queue, mocker):
      queued_test = ["queue1", "queue2", "queue3"]
  
      stash_dict = {}
      for name in queued_test:
          stash_dict[name] = mocker.Mock()
  
      msg_dict = {}
      entry_dict = {}
      for name in queued_test:
          msg_dict[name] = mocker.Mock(delivery_tag=f"msg_{name}")
          entry_dict[name] = mocker.Mock(stash_rev=name)
          entry_dict[name].name = name
  
      msg_iter = [
          (msg_dict[name], entry_dict[name]) for name in queued_test
      ]
      entry_iter = [entry_dict[name] for name in queued_test]
  
      stash = mocker.patch.object(
          test_queue, "stash", return_value=mocker.Mock()
      )
      stash.stash_revs = stash_dict
      mocker.patch.object(
          test_queue, "_iter_queued", return_value=msg_iter
      )
      mocker.patch.object(
          test_queue, "iter_queued", return_value=entry_iter
      )
  
      remove_revs_mocker = mocker.patch.object(
          test_queue.stash, "remove_revs"
      )
      reject_mocker = mocker.patch.object(test_queue.celery, "reject")
  
      assert test_queue.remove(["queue2"]) == ["queue2"]
      reject_mocker.assert_called_once_with("msg_queue2")
      remove_revs_mocker.assert_called_once_with([stash_dict["queue2"]])
      remove_revs_mocker.reset_mock()
      reject_mocker.reset_mock()
  
      assert test_queue.clear(queued=True) == queued_test
      remove_revs_mocker.assert_called_once_with(
          list(stash_dict.values())
      )
      reject_mocker.assert_has_calls(
          [
              mocker.call("msg_queue1"),
              mocker.call("msg_queue2"),
              mocker.call("msg_queue3"),
          ]
      )
  
label_desc: Use image node_id 1 for calling a global function with example usage: test_remove_queued(test_queue, mocker) without return types