code: def _linesearch_powell(func, p, xi, tol=1e-3, maxiter=500):
      # line-search algorithm using fminbound
      #  find the minimium of the function
      #  func(x0+ alpha*direc)
      def myfunc(alpha):
          return func(p + alpha * xi)
  
      alpha_min, fret, iter, num = brent(
          myfunc, full_output=1, tol=tol, maxiter=maxiter
      )
      xi = alpha_min * xi
      return squeeze(fret), p + xi, xi
  
imports: import numpy
  from numpy import atleast_1d, eye, mgrid, argmin, zeros, shape, empty, squeeze, isscalar, vectorize, asarray, absolute, sqrt, Inf, asfarray, isinf
  from mystic import linesearch
  from collections.abc import Callable
  import builtins
label_desc: Use image node_id 25 for calling a global function with example usage: _linesearch_powell(func, p, xi, tol, maxiter) and returns: squeeze,  unknown,  xi, func