code: def random_maximise_cts_dscr(
      obj,
      cts_bounds,
      dscr_vals,
      max_evals,
      return_history=False,
      vectorised=True,
  ):
      """Optimises a function by randomly sampling and choosing its maximum."""
      cts_rand_pts, dscr_rand_pts, obj_vals = random_sample_cts_dscr(
          obj, cts_bounds, dscr_vals, max_evals, vectorised
      )
      max_idx = obj_vals.argmax()
      max_val = obj_vals[max_idx]
      max_cts_pt = cts_rand_pts[max_idx]
      max_dscr_pt = dscr_rand_pts[max_idx]
      if return_history:
          history = Namespace(
              query_vals=obj_vals,
              query_cts_points=cts_rand_pts,
              query_dscr_points=dscr_rand_pts,
          )
      else:
          history = None
      return max_val, max_cts_pt, max_dscr_pt, history
  
imports: from __future__ import print_function
  from __future__ import division
  from argparse import Namespace
  from datetime import datetime
  from warnings import warn
  import os
  import numpy
  from .general_utils import map_to_bounds
  from .doo import DOOFunction, pdoo_wrap
label_desc: Use image node_id 19 for calling a global function with example usage: random_maximise_cts_dscr(obj, cts_bounds, dscr_vals, max_evals, return_history, vectorised) and returns: max_val,  max_cts_pt,  max_dscr_pt,  history