code: def brent(
      func, args=(), brack=None, tol=1.48e-8, full_output=0, maxiter=500
  ):
      """Given a function of one-variable and a possible bracketing interval,
      return the minimum of the function isolated to a fractional precision of
      tol.
  
      :Parameters:
  
      func - objective func
      args - additional arguments (if present)
      brack - triple (a,b,c) where (a<b<c) and
          func(b) < func(a),func(c).  If bracket is two numbers (a,c) then they are
          assumed to be a starting interval for a downhill bracket search
          (see bracket); it doesn't always mean that obtained solution will satisfy a<=x<=c.
  
      full_output : number
          0 - return only x (default)
          1 - return all output args (xmin, fval, iter, funcalls)
  
      :Returns:
  
      xmin : ndarray
          optim point
      fval : number
          optim value
      iter : number
          number of iterations
      funcalls : number
          number of objective function evaluations
  
      :SeeAlso:
  
        fmin, fmin_powell, fmin_cg,
               fmin_bfgs, fmin_ncg -- multivariate local optimizers
        leastsq -- nonlinear least squares minimizer
  
        fmin_l_bfgs_b, fmin_tnc,
               fmin_cobyla -- constrained multivariate optimizers
  
        anneal, brute -- global optimizers
  
        fminbound, brent, golden, bracket -- local scalar minimizers
  
        fsolve -- n-dimenstional root-finding
  
        brentq, brenth, ridder, bisect, newton -- one-dimensional root-finding
  
        fixed_point -- scalar fixed-point finder
  
      Notes
  
      ----------------------------
  
      Uses inverse parabolic interpolation when possible to speed up convergence
      of golden section method.
  
      """
  
      brent = Brent(
          func=func,
          args=args,
          tol=tol,
          full_output=full_output,
          maxiter=maxiter,
      )
      brent.set_bracket(brack)
      brent.optimize()
      return brent.get_result(full_output=full_output)
  
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 22 for calling a global function with example usage: brent(func, args, brack, tol, full_output, maxiter) and returns: brent