code: def test_L8(self):
      def f(x):
          x = np.hstack(([0], x))  # 1-indexed to match reference
          fun = (
              3 * x[1]
              + 0.000001 * x[1] ** 3
              + 2 * x[2]
              + 0.000002 / 3 * x[2] ** 3
          )
          return fun
  
      A = np.zeros((3, 5))
      A[1, [4, 3]] = 1, -1
      A[2, [3, 4]] = 1, -1
      A = A[1:, 1:]
      b = np.array([-0.55, -0.55])
  
      def c1(x):
          x = np.hstack(([0], x))  # 1-indexed to match reference
          return [
              1000 * np.sin(-x[3] - 0.25)
              + 1000 * np.sin(-x[4] - 0.25)
              + 894.8
              - x[1],
              1000 * np.sin(x[3] - 0.25)
              + 1000 * np.sin(x[3] - x[4] - 0.25)
              + 894.8
              - x[2],
              1000 * np.sin(x[4] - 0.25)
              + 1000 * np.sin(x[4] - x[3] - 0.25)
              + 1294.8,
          ]
  
      L = LinearConstraint(A, b, np.inf)
      N = NonlinearConstraint(c1, np.full(3, -0.001), np.full(3, 0.001))
  
      bounds = [(0, 1200)] * 2 + [(-0.55, 0.55)] * 2
      constraints = (L, N)
  
      with suppress_warnings() as sup:
          sup.filter(UserWarning)
          # original Lampinen test was with rand1bin, but that takes a
          # huge amount of CPU time. Changing strategy to best1bin speeds
          # things up a lot
          res = differential_evolution(
              f,
              bounds,
              strategy="best1bin",
              seed=1234,
              constraints=constraints,
              maxiter=5000,
          )
  
      x_opt = (679.9453, 1026.067, 0.1188764, -0.3962336)
      f_opt = 5126.4981
  
      assert_allclose(f(x_opt), f_opt, atol=1e-3)
      assert_allclose(res.x[:2], x_opt[:2], atol=2e-3)
      assert_allclose(res.x[2:], x_opt[2:], atol=2e-3)
      assert_allclose(res.fun, f_opt, atol=2e-2)
      assert res.success
      assert_(np.all(A @ res.x >= b))
      assert_(np.all(np.array(c1(res.x)) >= -0.001))
      assert_(np.all(np.array(c1(res.x)) <= 0.001))
      assert_(np.all(res.x >= np.array(bounds)[:, 0]))
      assert_(np.all(res.x <= np.array(bounds)[:, 1]))
  
imports: import multiprocessing
  import platform
  from scipy.optimize._differentialevolution import DifferentialEvolutionSolver, _ConstraintWrapper
  from scipy.optimize import differential_evolution
  from scipy.optimize._constraints import Bounds, NonlinearConstraint, LinearConstraint
  from scipy.optimize import rosen
  from scipy.sparse import csr_matrix
  from scipy._lib._pep440 import Version
  import numpy
  from numpy.testing import assert_equal, assert_allclose, assert_almost_equal, assert_array_equal, assert_string_equal, assert_, suppress_warnings
  from pytest import raises, warns
  import pytest
label_desc: Use image node_id 54 for calling the TestDifferentialEvolutionSolver obj's underlying member method code with example usage: obj.test_L8() and returns: fun, list