code: def doe_dim4(
      seed: tp.Optional[int] = None,
  ) -> tp.Iterator[
      Experiment
  ]:  # Here, QR performs best, then Random, then LHS, then Cauchy.
      # prepare list of parameters to sweep for independent variables
      seedg = create_seed_generator(seed)
      names = [
          "sphere"
      ]  # n for n in ArtificialFunction.list_sorted_function_names() if "sphere" in n]
      optims = sorted(
          x
          for x, y in optimizers.registry.items()
          if y.one_shot and "arg" not in x and "mal" not in x
      )
      functions = [
          ArtificialFunction(
              name,
              block_dimension=bd,
              num_blocks=n_blocks,
              useless_variables=bd * uv_factor * n_blocks,
          )
          for name in names
          for bd in [4]
          for uv_factor in [0]
          for n_blocks in [1]
      ]
      for func in functions:
          for optim in optims:
              for budget in [30, 100, 3000, 10000]:
                  yield Experiment(
                      func,
                      optim,
                      budget=budget,
                      num_workers=1,
                      seed=next(seedg),
                  )
  
imports: import typing
  import numpy
  from nevergrad import optimizers
  from nevergrad.optimization.base import ConfiguredOptimizer
  from nevergrad.optimization import experimentalvariants
  from nevergrad.functions import ArtificialFunction
  from .xpbase import registry
  from .xpbase import create_seed_generator
  from .xpbase import Experiment
label_desc: Use image node_id 9 for calling a global function with example usage: doe_dim4(seed) without return types