code: def test_task_to_actor_assignment(ray_start_4_cpu):
      register_ray()
  
      pause_time = 5
  
      def worker_func(worker_id):
          launch_time = time.time()
          time.sleep(pause_time)
          return worker_id, launch_time
  
      num_workers = 4
      output = []
      with parallel_backend("ray", n_jobs=-1):
          output = Parallel()(
              delayed(worker_func)(worker_id)
              for worker_id in range(num_workers)
          )
  
      worker_ids = set()
      launch_times = []
      for worker_id, launch_time in output:
          worker_ids.add(worker_id)
          launch_times.append(launch_time)
  
      assert len(worker_ids) == num_workers
  
      for i in range(num_workers):
          for j in range(i + 1, num_workers):
              assert abs(launch_times[i] - launch_times[j]) < 1
  
imports: import os
  import sys
  import platform
  import pytest
  import tempfile
  import time
  import random
  from collections import defaultdict
  import queue
  import math
  import ray
  from ray._private.test_utils import SignalActor
  from ray.util.multiprocessing import Pool, TimeoutError, JoinableQueue
  from ray.util.joblib import register_ray
  from joblib import parallel_backend, Parallel, delayed
label_desc: Use image node_id 25 for calling a global function with example usage: test_task_to_actor_assignment(ray_start_4_cpu) and returns: worker_id,  launch_time