code: def wrap_nested(outer_function, inner_function):
      """nest a function call within a function object
  
      This is useful for nesting a constraints function in a cost function;
      thus, the constraints will be enforced at every cost function evaluation.
      """
  
      def function_wrapper(x):
          _x = x[
              :
          ]  # XXX: trouble if x not a list or ndarray... maybe "deepcopy"?
          return outer_function(inner_function(_x))
  
      return function_wrapper
  
imports: from functools import reduce
  from collections.abc import Callable
  from mystic._counter import Counter
  from itertools import permutations
  from dill.source import getblocks
  from dill.source import getsource
  from mystic.monitors import Monitor
  from mystic.monitors import VerboseMonitor
  from mystic.monitors import LoggingMonitor
  from mystic.monitors import CustomMonitor
  from mystic.monitors import Null
label_desc: Use image node_id 25 for calling a global function with example usage: wrap_nested(outer_function, inner_function) and returns: function_wrapper, outer_function