code: def get_experiment(storage, space_type, size):
      """Create an experiment or load from DB if already existing
  
      Parameters
      ----------
      storage: str
          Can be `pickleddb` or `mongodb`. A default configuration is used for each.
      space_type: str
          Can be one of
          - `discrete` Search space is discrete and limited to `max_trials`
          - `real-seeded` Search space is continuous and algos is seeded, leading to many race
            conditions while algos are sampling the same points in parallel, or
          - `real` Search space is real and algo is not seeded, leading to very few race conditions.
      size: int
          This defines `max_trials`, and the size of the search space (`uniform(0, size)`).
  
      """
      if storage == "pickleddb":
          storage_config = {"type": "pickleddb", "host": DB_FILE}
      elif storage == "mongodb":
          storage_config = {
              "type": "mongodb",
              "name": "stress",
              "host": "mongodb://user:pass@localhost",
          }
  
      discrete = space_type == "discrete"
      high = size  # * 2
  
      return create_experiment(
          "stress-test",
          space={"x": f"uniform(0, {high}, discrete={discrete})"},
          max_trials=size,
          max_idle_time=60 * 5,
          algorithm={
              "random": {"seed": None if space_type == "real" else 1}
          },
          storage={"type": "legacy", "database": storage_config},
      )
  
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 2 for calling a global function with example usage: get_experiment(storage, space_type, size) and returns: create_experiment