code: def _with_results(
      objective_fn: Callable[P, float]
  ) -> Callable[P, list[dict]]:
      """Adds the boilerplate to create a list of 'Results' dictionary from the objective."""
  
      @functools.wraps(objective_fn)
      def _with_results(
          *args: P.args, **kwargs: P.kwargs
      ) -> list[dict]:
          objective = objective_fn(*args, **kwargs)
          return [
              dict(name="objective", type="objective", value=objective)
          ]
  
      return _with_results
  
imports: from __future__ import annotations
  import functools
  import random
  from pathlib import Path
  from typing import Callable
  import numpy
  import pytest
  from typing_extensions import ParamSpec
  from orion.algo.base import BaseAlgorithm
  from orion.algo.space import Space
  from orion.algo.tpe import TPE
  from orion.client import build_experiment, workon
  from orion.client.experiment import ExperimentClient
  from orion.core.io.space_builder import SpaceBuilder
  from orion.core.worker.trial import Trial
  from orion.core.worker.warm_start.knowledge_base import KnowledgeBase
  from orion.storage.base import BaseStorageProtocol, setup_storage
label_desc: Use image node_id 6 for calling a global function with example usage: _with_results(objective_fn) and returns: _with_results, list