code: def test_constraint_dictionary_2(self):
      fun = lambda x: (x[0] - 1) ** 2 + (x[1] - 2.5) ** 2
      cons = {
          "type": "eq",
          "fun": lambda x, p1, p2: p1 * x[0] - p2 * x[1],
          "args": (1, 1.1),
          "jac": lambda x, p1, p2: np.array([[p1, -p2]]),
      }
      with suppress_warnings() as sup:
          sup.filter(UserWarning, "delta_grad == 0.0")
          res = minimize(
              fun,
              self.x0,
              method=self.method,
              bounds=self.bnds,
              constraints=cons,
          )
      assert_allclose(res.x, [1.7918552, 1.62895927])
      assert_allclose(res.fun, 1.3857466063348418)
  
imports: from __future__ import division, print_function, absolute_import
  import numpy
  from numpy.testing import assert_, assert_array_almost_equal, assert_allclose, assert_equal, TestCase
  import pytest
  from scipy._lib._numpy_compat import suppress_warnings
  from scipy.optimize import NonlinearConstraint, LinearConstraint, Bounds, OptimizeWarning, minimize, BFGS
  from .test_minimize_constrained import Maratos, HyperbolicIneq, Rosenbrock, IneqRosenbrock, EqIneqRosenbrock, BoundedRosenbrock, Elec
  from scipy._lib._numpy_compat import _assert_warns, suppress_warnings
label_desc: Use image node_id 2 for calling the TestOldToNew obj's underlying member method code with example usage: obj.test_constraint_dictionary_2() without return types