code: def test_L2(self):
      # Lampinen ([5]) test problem 2
  
      def f(x):
          x = np.hstack(([0], x))  # 1-indexed to match reference
          fun = (
              (x[1] - 10) ** 2
              + 5 * (x[2] - 12) ** 2
              + x[3] ** 4
              + 3 * (x[4] - 11) ** 2
              + 10 * x[5] ** 6
              + 7 * x[6] ** 2
              + x[7] ** 4
              - 4 * x[6] * x[7]
              - 10 * x[6]
              - 8 * x[7]
          )
          return fun
  
      def c1(x):
          x = np.hstack(([0], x))  # 1-indexed to match reference
          return [
              127
              - 2 * x[1] ** 2
              - 3 * x[2] ** 4
              - x[3]
              - 4 * x[4] ** 2
              - 5 * x[5],
              196 - 23 * x[1] - x[2] ** 2 - 6 * x[6] ** 2 + 8 * x[7],
              282 - 7 * x[1] - 3 * x[2] - 10 * x[3] ** 2 - x[4] + x[5],
              -4 * x[1] ** 2
              - x[2] ** 2
              + 3 * x[1] * x[2]
              - 2 * x[3] ** 2
              - 5 * x[6]
              + 11 * x[7],
          ]
  
      N = NonlinearConstraint(c1, 0, np.inf)
      bounds = [(-10, 10)] * 7
      constraints = N
  
      with suppress_warnings() as sup:
          sup.filter(UserWarning)
          res = differential_evolution(
              f,
              bounds,
              strategy="rand1bin",
              seed=1234,
              constraints=constraints,
          )
  
      f_opt = 680.6300599487869
      x_opt = (
          2.330499,
          1.951372,
          -0.4775414,
          4.365726,
          -0.6244870,
          1.038131,
          1.594227,
      )
  
      assert_allclose(f(x_opt), f_opt)
      assert_allclose(res.fun, f_opt)
      assert_allclose(res.x, x_opt, atol=1e-5)
      assert res.success
      assert_(np.all(np.array(c1(res.x)) >= 0))
      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 48 for calling the TestDifferentialEvolutionSolver obj's underlying member method code with example usage: obj.test_L2() and returns: fun, list