code: def create_result(
      Xi, yi, space=None, rng=None, specs=None, models=None
  ):
      """
      Initialize an `OptimizeResult` object.
  
      Parameters
      ----------
      Xi : list of lists, shape (n_iters, n_features)
          Location of the minimum at every iteration.
  
      yi : array-like, shape (n_iters,)
          Minimum value obtained at every iteration.
  
      space : Space instance, optional
          Search space.
  
      rng : RandomState instance, optional
          State of the random state.
  
      specs : dict, optional
          Call specifications.
  
      models : list, optional
          List of fit surrogate models.
  
      Returns
      -------
      res : `OptimizeResult`, scipy object
          OptimizeResult instance with the required information.
      """
      res = OptimizeResult()
      yi = np.asarray(yi)
      if np.ndim(yi) == 2:
          res.log_time = np.ravel(yi[:, 1])
          yi = np.ravel(yi[:, 0])
      best = np.argmin(yi)
      res.x = Xi[best]
      res.fun = yi[best]
      res.func_vals = yi
      res.x_iters = Xi
      res.models = models
      res.space = space
      res.random_state = rng
      res.specs = specs
      return res
  
imports: from copy import deepcopy
  from functools import wraps
  from sklearn.utils import check_random_state
  import numpy
  from scipy.optimize import OptimizeResult
  from scipy.optimize import minimize
  from sklearn.base import is_regressor
  from sklearn.ensemble import GradientBoostingRegressor
  from joblib import dump
  from joblib import load
  from collections import OrderedDict
  from .learning import ExtraTreesRegressor
  from .learning import GaussianProcessRegressor
  from .learning import GradientBoostingQuantileRegressor
  from .learning import RandomForestRegressor
  from .learning.gaussian_process.kernels import ConstantKernel
  from .learning.gaussian_process.kernels import HammingKernel
  from .learning.gaussian_process.kernels import Matern
  from .sampler import Sobol, Lhs, Hammersly, Halton, Grid
  from .sampler import InitialPointGenerator
  from .space import Space, Categorical, Integer, Real, Dimension
label_desc: Use image node_id 1 for calling a global function with example usage: create_result(Xi, yi, space, rng, specs, models) and returns: res