def METHOD_NAME(
    storage,
    name,
    algorithms=None,
    targets=None,
    executor=None,
):
    """
    Create or get a benchmark object.
    Parameters
    ----------
    storage: BaseStorageProtocol
        Instance of the storage to use
    name: str
        Name of the benchmark
    algorithms: list, optional
        Algorithms used for benchmark, each algorithm can be a string or dict.
    targets: list, optional
        Targets for the benchmark, each target will be a dict with two keys.
        assess: list
            Assessment objects
        task: list
            Task objects
    executor: `orion.executor.base.BaseExecutor`, optional
        Executor to run the benchmark experiments
    Returns
    -------
    An instance of `orion.benchmark.Benchmark`
    """
    # fetch benchmark from db
    db_config = _fetch_benchmark(storage, name)
    benchmark_id = None
    input_configure = None
    if db_config:
        if algorithms or targets:
            input_benchmark = Benchmark(storage, name, algorithms, targets)
            input_configure = input_benchmark.configuration
        benchmark_id, algorithms, targets = _resolve_db_config(db_config)
    if not algorithms or not targets:
        raise NoConfigurationError(
            "Benchmark {} does not exist in DB, "
            "algorithms and targets space was not defined.".format(name)
        )
    benchmark = _create_benchmark(
        storage,
        name,
        algorithms,
        targets,
        executor=executor,
    )
    if input_configure and input_benchmark.configuration != benchmark.configuration:
        logger.warning(
            f"Benchmark with same name is found but has different configuration, "
            f"which will be used for this creation.\n{benchmark.configuration}"
        )
    if benchmark_id is None:
        logger.debug("Benchmark not found in DB. Now attempting registration in DB.")
        try:
            _register_benchmark(storage, benchmark)
            logger.debug("Benchmark successfully registered in DB.")
        except DuplicateKeyError:
            logger.info(
                "Benchmark registration failed. This is likely due to a race condition. "
                "Now rolling back and re-attempting building it."
            )
            benchmark.close()
            benchmark = METHOD_NAME(
                storage,
                name,
                algorithms,
                targets,
                executor,
            )
    return benchmark