code: def test_all_nograd_minimizers(self):
      # test 2d minimizations without gradient.  Newton-CG requires jac=True,
      # so not included here.
      i = 1
      methods = [
          "CG",
          "BFGS",
          "L-BFGS-B",
          "TNC",
          "SLSQP",
          "Nelder-Mead",
          "Powell",
          "COBYLA",
      ]
      minimizer_kwargs = copy.copy(self.kwargs_nograd)
      for method in methods:
          minimizer_kwargs["method"] = method
          res = basinhopping(
              func2d_nograd,
              self.x0[i],
              minimizer_kwargs=minimizer_kwargs,
              niter=self.niter,
              disp=self.disp,
          )
          tol = self.tol
          if method == "COBYLA":
              tol = 2
          assert_almost_equal(res.x, self.sol[i], decimal=tol)
  
imports: from __future__ import division, print_function, absolute_import
  import copy
  from numpy.testing import assert_almost_equal, assert_equal, assert_
  from pytest import raises
  import numpy
  from numpy import cos, sin
  from scipy.optimize import basinhopping, OptimizeResult
  from scipy.optimize._basinhopping import Storage, RandomDisplacement, Metropolis, AdaptiveStepsize
label_desc: Use image node_id 9 for calling the TestBasinHopping obj's underlying member method code with example usage: obj.test_all_nograd_minimizers() without return types