code: def test_bounds_class(self):
      # test that result does not depend on the bounds type
      def func(x):
          f = np.sum(x * x - 10 * np.cos(2 * np.pi * x)) + 10 * np.size(
              x
          )
          return f
  
      lw = [-5.12] * 5
      up = [5.12] * 5
  
      # Unbounded global minimum is all zeros. Most bounds below will force
      # a DV away from unbounded minimum and be active at solution.
      up[0] = -2.0
      up[1] = -1.0
      lw[3] = 1.0
      lw[4] = 2.0
  
      # run optimizations
      bounds = Bounds(lw, up)
      ret_bounds_class = dual_annealing(func, bounds=bounds, seed=1234)
  
      bounds_old = list(zip(lw, up))
      ret_bounds_list = dual_annealing(
          func, bounds=bounds_old, seed=1234
      )
  
      # test that found minima, function evaluations and iterations match
      assert_allclose(ret_bounds_class.x, ret_bounds_list.x, atol=1e-8)
      assert_allclose(ret_bounds_class.x, np.arange(-2, 3), atol=1e-7)
      assert_allclose(
          ret_bounds_list.fun, ret_bounds_class.fun, atol=1e-9
      )
      assert ret_bounds_list.nfev == ret_bounds_class.nfev
  
imports: from scipy.optimize import dual_annealing, Bounds
  from scipy.optimize._dual_annealing import EnergyState
  from scipy.optimize._dual_annealing import LocalSearchWrapper
  from scipy.optimize._dual_annealing import ObjectiveFunWrapper
  from scipy.optimize._dual_annealing import StrategyChain
  from scipy.optimize._dual_annealing import VisitingDistribution
  from scipy.optimize import rosen, rosen_der
  import pytest
  import numpy
  from numpy.testing import assert_equal, assert_allclose, assert_array_less
  from pytest import raises
  from scipy._lib._util import check_random_state
label_desc: Use image node_id 32 for calling the TestDualAnnealing obj's underlying member method code with example usage: obj.test_bounds_class() and returns: f