code: def test_constraint_population_feasibilities(self):
      def constr_f(x):
          return [x[0] + x[1]]
  
      def constr_f2(x):
          return [x[0] ** 2 + x[1], x[0] - x[1]]
  
      nlc = NonlinearConstraint(constr_f, -np.inf, 1.9)
  
      solver = DifferentialEvolutionSolver(
          rosen, [(0, 2), (0, 2)], constraints=(nlc)
      )
  
      # are population feasibilities correct
      # [0.5, 0.5] corresponds to scaled values of [1., 1.]
      feas, cv = solver._calculate_population_feasibilities(
          np.array([[0.5, 0.5], [1.0, 1.0]])
      )
      assert_equal(feas, [False, False])
      assert_almost_equal(cv, np.array([[0.1], [2.1]]))
      assert cv.shape == (2, 1)
  
      nlc2 = NonlinearConstraint(constr_f2, -np.inf, 1.8)
      solver = DifferentialEvolutionSolver(
          rosen, [(0, 2), (0, 2)], constraints=(nlc, nlc2)
      )
  
      feas, cv = solver._calculate_population_feasibilities(
          np.array([[0.5, 0.5], [0.6, 0.5]])
      )
      assert_equal(feas, [False, False])
      assert_almost_equal(cv, np.array([[0.1, 0.2, 0], [0.3, 0.64, 0]]))
  
      feas, cv = solver._calculate_population_feasibilities(
          np.array([[0.5, 0.5], [1.0, 1.0]])
      )
      assert_equal(feas, [False, False])
      assert_almost_equal(cv, np.array([[0.1, 0.2, 0], [2.1, 4.2, 0]]))
      assert cv.shape == (2, 3)
  
      feas, cv = solver._calculate_population_feasibilities(
          np.array([[0.25, 0.25], [1.0, 1.0]])
      )
      assert_equal(feas, [True, False])
      assert_almost_equal(
          cv, np.array([[0.0, 0.0, 0.0], [2.1, 4.2, 0]])
      )
      assert cv.shape == (2, 3)
  
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 41 for calling the TestDifferentialEvolutionSolver obj's underlying member method code with example usage: obj.test_constraint_population_feasibilities() and returns: list, list