code: def random_maximise(
      obj, bounds, max_evals, return_history=False, vectorised=True
  ):
      """Optimises a function by randomly sampling and choosing its maximum."""
      rand_pts, obj_vals = random_sample(
          obj, bounds, max_evals, vectorised
      )
      max_idx = obj_vals.argmax()
      max_val = obj_vals[max_idx]
      max_pt = rand_pts[max_idx]
      if return_history:
          history = Namespace(
              query_vals=obj_vals, query_points=rand_pts
          )
      else:
          history = None
      return max_val, max_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 3 for calling a global function with example usage: random_maximise(obj, bounds, max_evals, return_history, vectorised) and returns: max_val,  max_pt,  history