code: def _to_objective(function):
      """convert ``f(*xargs, **kwds)`` to ``f(x, *args, **kwds)``, where ``xargs = x + args``
  
      Args:
        function (function): a function of the form ``f(*xargs, **kwds)``
  
      Returns:
        a function of the form ``f(x, *args, **kwds)``
  
      Examples:
        >>> @_to_objective
        ... def cost(x,y,z):
        ...   return x+y+z
        ...
        >>> x = [1,2,3]
        >>> cost(x)
        6
      """
  
      def objective(x, *args, **kwds):
          return function(*(tuple(x) + args), **kwds)
  
      objective.__doc__ = function.__doc__
      return objective
  
imports: from mystic.math import _rbf
label_desc: Use image node_id 5 for calling a global function with example usage: _to_objective(function) and returns: objective, function