code: def pdoo_wrap(
      doo_obj,
      total_budget,
      nu_max=1.0,
      rho_max=0.9,
      K=2,
      C_init=0.8,
      tol=1e-3,
      POO_mult=0.5,
      Randomize=False,
      return_history=False,
  ):
      """Wrapper for running PDOO optimisation."""
      # pylint: disable=too-many-locals
      total_budget = (
          total_budget
          * doo_obj.eval_cost_single_point_normalised([1.0])
      )
      opt_tree = OptTree(
          doo_obj,
          nu_max,
          rho_max,
          total_budget,
          K,
          C_init,
          tol,
          Randomize,
      )
      results, index = opt_tree.run_PDOO(POO_mult)
      max_pt = doo_obj.get_unnormalised_coords(results[index][2])
      # IF not return history
      if not return_history:
          return results[index][0], max_pt, None
      history = Namespace()
      max_iter = int(total_budget)
      query_pts, query_vals = opt_tree.get_queried_pts()
      max_val = max(query_vals)
      history.query_step_idxs = [i for i in range(max_iter)]
      history.query_send_times = list(range(0, max_iter))
      history.query_receive_times = list(range(1, max_iter + 1))
      history.query_points = [
          doo_obj.get_unnormalised_coords(x) for x in query_pts
      ]
      history.query_vals = query_vals
      history.query_true_vals = query_vals
      history.curr_opt_vals = []
      history.curr_opt_points = []
      curr_max = -np.inf
      for idx, qv in enumerate(history.query_vals):
          if qv >= curr_max:
              curr_max = qv
              curr_opt_point = history.query_points[idx]
          history.curr_opt_vals.append(curr_max)
          history.curr_opt_points.append(curr_opt_point)
      history.query_eval_times = [1 for _ in range(max_iter)]
      history.curr_true_opt_vals = history.curr_opt_vals
      return max_val, max_pt, history
  
imports: from __future__ import division
  from functools import total_ordering
  from argparse import Namespace
  import numpy
  from .general_utils import map_to_bounds
label_desc: Use image node_id 1 for calling a global function with example usage: pdoo_wrap(doo_obj, total_budget, nu_max, rho_max, K, C_init, tol, POO_mult, Randomize, return_history) and returns: max_val,  max_pt,  history, results,  max_pt,  None