code: def test_local_search_option_bounds(self):
      func = lambda x: np.sum((x - 5) * (x - 1))
      bounds = list(zip([-6, -5], [6, 5]))
      # Test bounds can be passed (see gh-10831)
  
      with np.testing.suppress_warnings() as sup:
          sup.record(RuntimeWarning, "Values in x were outside bounds ")
  
          dual_annealing(
              func,
              bounds=bounds,
              local_search_options={
                  "method": "SLSQP",
                  "bounds": bounds,
              },
          )
  
      with np.testing.suppress_warnings() as sup:
          sup.record(RuntimeWarning, "Method CG cannot handle ")
  
          dual_annealing(
              func,
              bounds=bounds,
              local_search_options={"method": "CG", "bounds": bounds},
          )
  
          # Verify warning happened for Method cannot handle bounds.
          assert sup.log
  
imports: from scipy.optimize import dual_annealing
  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
  from scipy._lib._pep440 import Version
label_desc: Use image node_id 19 for calling the TestDualAnnealing obj's underlying member method code with example usage: obj.test_local_search_option_bounds() without return types