code: def generate_benchmark_experiments_trials(
      benchmark_algorithms,
      experiment_config,
      trial_config,
      task_number,
      max_trial,
  ):
      """Return a list of experiments and trials for a benchmark"""
      gen_exps = []
      gen_trials = []
      algo_num = len(benchmark_algorithms)
      for i in range(task_number * algo_num):
          exp = copy.deepcopy(experiment_config)
          exp["_id"] = i
          exp["name"] = f"experiment-name-{i}"
          exp["algorithm"] = benchmark_algorithms[i % algo_num]
          exp["max_trials"] = max_trial
          exp["metadata"]["datetime"] = datetime.datetime.utcnow()
          gen_exps.append(exp)
  
          exp_trial_config = copy.deepcopy(trial_config)
          exp_trial_config["experiment"] = i
          for j, trial in enumerate(
              generate_trials(
                  exp_trial_config, ["completed"] * max_trial
              )
          ):
              trial["_id"] = f"{i}_{j}"
              gen_trials.append(trial)
  
      return gen_exps, gen_trials
  
imports: import contextlib
  import copy
  import datetime
  import os
  from contextlib import contextmanager
  from falcon import testing
  import orion.algo.space
  import orion.core.io.experiment_builder
  from orion.core.io.space_builder import SpaceBuilder
  from orion.core.worker.producer import Producer
  from orion.serving.webapi import WebApi
  from orion.testing.state import OrionState
label_desc: Use image node_id 3 for calling a global function with example usage: generate_benchmark_experiments_trials(benchmark_algorithms, experiment_config, trial_config, task_number, max_trial) and returns: gen_exps,  gen_trials