code: def maximize_structured(f, search_space, num_evals=50, pmap=map):
      """Basic function maximization routine. Maximizes ``f`` within
      the given box constraints.
  
      :param f: the function to be maximized
      :param search_space: the search space (see :doc:`/user/structured_search_spaces` for details)
      :param num_evals: number of permitted function evaluations
      :param pmap: the map function to use
      :type pmap: callable
      :returns: retrieved maximum, extra information and solver info
  
      This function will implicitly choose an appropriate solver and
      its initialization based on ``num_evals`` and the box constraints.
  
      """
      tree = search_spaces.SearchTree(search_space)
      box = tree.to_box()
  
      # we need to position the call log here
      # because the function signature used later on is internal logic
      f = fun.logged(f)
  
      # wrap the decoder and constraints for the internal search space representation
      f = tree.wrap_decoder(f)
      f = _wrap_hard_box_constraints(f, box, -sys.float_info.max)
  
      suggestion = suggest_solver(num_evals, "particle swarm", **box)
      solver = make_solver(**suggestion)
      solution, details = optimize(
          solver,
          f,
          maximize=True,
          max_evals=num_evals,
          pmap=pmap,
          decoder=tree.decode,
      )
      return solution, details, suggestion
  
imports: import timeit
  import sys
  import operator
  from .None import functions
  from .None import solvers
  from .None import search_spaces
  from .solvers import solver_registry
  from .util import DocumentedNamedTuple
  from .constraints import wrap_constraints
label_desc: Use image node_id 11 for calling a global function with example usage: maximize_structured(f, search_space, num_evals, pmap) and returns: solution,  details,  suggestion