code: def test_delete_jobs_by_job_id(
      jobs_ids: list[str],
      job_ids_to_cancel: list[str],
      expected_canceled_number: int,
  ) -> None:
      test_type = "test_type"
      test_difficulty = 50
      queue = Queue()
  
      # we cannot really set job_id, so, we create jobs and get their job id, using dataset as a proxy
      real_job_ids_to_cancel = []
      waiting_jobs = 0
      for job_id in list(set(jobs_ids + job_ids_to_cancel)):
          job = queue.add_job(
              job_type=test_type,
              dataset=job_id,
              revision="test_revision",
              difficulty=test_difficulty,
          )
          waiting_jobs += 1
          assert_metric(
              job_type=test_type,
              status=Status.WAITING,
              total=waiting_jobs,
          )
          if job_id in job_ids_to_cancel:
              real_job_id = job.info()["job_id"]
              real_job_ids_to_cancel.append(real_job_id)
          if job_id not in jobs_ids:
              # delete the job, in order to simulate that it did never exist (we just wanted a valid job_id)
              job.delete()
  
      queue.start_job()
      assert_metric(job_type=test_type, status=Status.WAITING, total=1)
      assert_metric(job_type=test_type, status=Status.STARTED, total=1)
      canceled_number = queue.delete_jobs_by_job_id(
          job_ids=real_job_ids_to_cancel
      )
      assert canceled_number == expected_canceled_number
  
imports: import json
  import os
  import random
  import time
  from datetime import datetime, timedelta
  from multiprocessing import Pool
  from pathlib import Path
  from typing import Optional
  from unittest.mock import patch
  import pytest
  import pytz
  from libcommon.constants import QUEUE_TTL_SECONDS
  from libcommon.queue import EmptyQueueError, JobDocument, JobTotalMetricDocument, Lock, Queue, lock
  from libcommon.resources import QueueMongoResource
  from libcommon.utils import Priority, Status, get_datetime
  from .utils import assert_metric
label_desc: Use image node_id 4 for calling a global function with example usage: test_delete_jobs_by_job_id(jobs_ids, job_ids_to_cancel, expected_canceled_number) without return types