class_docstr: Specifies an experiment which can be run in benchmarks.
  
  Parameters
  ----------
  function: ExperimentFunction
      the function to run the experiment on. It must inherit from ExperimentFunction to implement
      necessary functionalities (parametrization, descriptors, evaluation_function, pseudotime etc)
  
  Note
  ----
  - "run" method catches error but forwards stderr so that errors are not completely hidden
  - "run" method outputs the description of the experiment, which is a set of figures/names from the functions
  settings (dimension, etc...), the optimization settings (budget, etc...) and the results (loss, etc...)
docstr: Run an experiment with the provided artificial function and optimizer
  
  Parameter
  ---------
  callbacks: dict
      a dictionary of callbacks to register on the optimizer with key "ask" and/or "tell" (see base Optimizer class).
      This is only for easier debugging.
docstr_tok: ["Run","an","experiment","with","the","provided","artificial","function","and","optimizer","Parameter","--","--","--","--","-","callbacks",":","dict","a","dictionary","of","callbacks","to","register","on","the","optimizer","with","key","``","ask","''","and\/or","``","tell","''","(","see","base","Optimizer","class",")",".","This","is","only","for","easier","debugging","."]
code: def _run_with_error(
      self,
      callbacks: tp.Optional[tp.Dict[str, obase._OptimCallBack]] = None,
  ) -> None:
      """Run an experiment with the provided artificial function and optimizer
  
      Parameter
      ---------
      callbacks: dict
          a dictionary of callbacks to register on the optimizer with key "ask" and/or "tell" (see base Optimizer class).
          This is only for easier debugging.
      """
      if self.seed is not None and self._optimizer is None:
          # Note: when resuming a job (if optimizer is not None), seeding is pointless (reproducibility is lost)
          np.random.seed(
              self.seed
          )  # seeds both functions and parametrization (for which random state init is lazy)
          random.seed(self.seed)
          torch.manual_seed(self.seed)
      pfunc = self.function.copy()
      # check constraints are propagated
      assert len(pfunc.parametrization._constraint_checkers) == len(
          self.function.parametrization._constraint_checkers
      )
      # optimizer instantiation can be slow and is done only here to make xp iterators very fast
      if self._optimizer is None:
          self._optimizer = self.optimsettings.instantiate(
              parametrization=pfunc.parametrization
          )
          if pfunc.multiobjective_upper_bounds is not None:
              self._optimizer.tell(
                  p.MultiobjectiveReference(),
                  pfunc.multiobjective_upper_bounds,
              )
          else:
              self._optimizer.register_callback(
                  "tell", _assert_singleobjective_callback
              )
      if callbacks is not None:
          for name, func in callbacks.items():
              self._optimizer.register_callback(name, func)
      assert (
          self._optimizer.budget is not None
      ), "A budget must be provided"
      t0 = time.time()
      executor = self.optimsettings.executor
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore", category=errors.InefficientSettingsWarning
          )  # benchmark do not need to be efficient
          try:
              # call the actual Optimizer.minimize method because overloaded versions could alter the worklflow
              # and provide unfair comparisons  (especially for parallelized settings)
              obase.Optimizer.minimize(
                  self._optimizer,
                  pfunc,
                  batch_mode=executor.batch_mode,
                  executor=executor,
                  constraint_violation=self.constraint_violation,
              )
          except Exception as e:  # pylint: disable=broad-except
              self._log_results(pfunc, t0, self._optimizer.num_ask)
              raise e
      self._log_results(pfunc, t0, self._optimizer.num_ask)
  
imports: import sys
  import time
  import random
  import numbers
  import warnings
  import traceback
  import nevergrad.common.typing
  import typing
  import numpy
  from nevergrad.parametrization import parameter
  from nevergrad.common import decorators
  from nevergrad.common import errors
  from ..functions import base
  from ..optimization import base
  from ..optimization.optimizerlib import registry
  from .None import execution
label_desc: Use image node_id 6 for calling the Experiment obj's underlying member method code with example usage: obj._run_with_error(callbacks) without return types