code: def worker(worker_id, storage, space_type, size):
      """Run trials until experiment is done
  
      Parameters
      ----------
      worker_id: int
          ID of the worker. This is used to distinguish logs from different workers.
      storage: str
          See `get_experiment`.
      space_type: str
          See `get_experiment`.
      size: int
          See `get_experiment`.
  
      """
      try:
          experiment = get_experiment(storage, space_type, size)
  
          assert experiment.version == 1, experiment.version
  
          print(f"{worker_id: 6d} enters")
  
          num_trials = 0
          while not experiment.is_done:
              try:
                  trial = experiment.suggest()
              except ReservationTimeout:
                  trial - None
  
              if trial is None:
                  break
  
              results = f(trial.params["x"], worker_id)
              num_trials += 1
              experiment.observe(trial, results=results)
  
          print(
              f"{worker_id: 6d} leaves | is done? {experiment.is_done}"
          )
      except DatabaseTimeout as e:
          print(f"{worker_id: 6d} timeouts and leaves")
          return num_trials
      except Exception as e:
          print(f"{worker_id: 6d} crashes")
          traceback.print_exc()
          return None
  
      return num_trials
  
file_path: orion/tests/stress/client/stress_experiment.py
imports: import os
  import random
  import time
  import traceback
  from multiprocessing import Pool
  import matplotlib.pyplot
  from pymongo import MongoClient
  from orion.client import create_experiment
  from orion.core.io.database import DatabaseTimeout
  from orion.core.utils.exceptions import ReservationTimeout
label_desc: Use image node_id 3 for calling a global function with example usage: worker(worker_id, storage, space_type, size) and returns: num_trials, num_trials, None