code: def optimize(self, x0, f=None, df=None, f_df=None):
          
          # Based on the documentation of DIRECT, it does not seem we can pass through an initial point x0
          try:
              from DIRECT import solve
              def DIRECT_f_wrapper(f):
                  def g(x, user_data):
                      return f(np.array([x])), 0
                  return g
              lB = np.asarray(self.bounds)[:,0]
              uB = np.asarray(self.bounds)[:,1]
              x,_,_ = solve(DIRECT_f_wrapper(f),lB,uB, maxT=self.maxiter)
              return np.atleast_2d(x), f(np.atleast_2d(x))
          except ImportError:
              print("Cannot find DIRECT library, please install it to use this option.")
              raise
docs: :param x0: initial point for a local optimizer.
          :param f: function to optimize.
          :param df: gradient of the function to optimize.
          :param f_df: returns both the function to optimize and its gradient.