code: def launch(
      experiment: str,
      num_workers: int = 1,
      seed: tp.Optional[int] = None,
      cap_index: tp.Optional[int] = None,
      output: tp.Optional[tp.PathLike] = None,
  ) -> Path:
      """Launch experiment with given names and selection modulo
      cap_index can be specified to provide a limited number of settings
      """
      # create the data
      csvpath = (
          Path(experiment + ".csv") if output is None else Path(output)
      )
      if num_workers == 1:
          df = core.compute(experiment, cap_index=cap_index, seed=seed)
      else:
          with futures.ProcessPoolExecutor(
              max_workers=num_workers
          ) as executor:
              df = core.compute(  # type: ignore
                  experiment, seed=seed, cap_index=cap_index, executor=executor, num_workers=num_workers  # type: ignore
              )
      # save data to csv
      try:
          core.save_or_append_to_csv(df, csvpath)
      except Exception:  # pylint: disable=broad-except
          csvpath = Path(experiment + ".csv")
          print(
              f"Failed to save to {output}, falling back to {csvpath}"
          )
          core.save_or_append_to_csv(df, csvpath)
      else:
          print(f"Saved data to {csvpath}")
      return csvpath
  
file_path: nevergrad/nevergrad/benchmark/__main__.py
imports: import argparse
  from pathlib import Path
  from concurrent import futures
  import nevergrad.common.typing
  from .None import utils
  from .None import core
  from .None import plotting
label_desc: Use image node_id 1 for calling a global function with example usage: launch(experiment, num_workers, seed, cap_index, output) and returns: csvpath