code: def test_unbounded(self):
      def f(x):
          return np.sum(x**2)
  
      bounds = Bounds([-np.inf, -np.inf], [np.inf, np.inf])
      res = minimize(f, x0=[1, 2], method="cobyla", bounds=bounds)
      assert res.success
      assert_allclose(res.x, 0, atol=1e-3)
  
      bounds = Bounds([1, -np.inf], [np.inf, np.inf])
      res = minimize(f, x0=[1, 2], method="cobyla", bounds=bounds)
      assert res.success
      assert_allclose(res.x, [1, 0], atol=1e-3)
  
file_path: scipy/scipy/optimize/tests/test_cobyla.py
imports: import math
  import numpy
  from numpy.testing import assert_allclose, assert_, assert_array_equal
  from scipy.optimize import fmin_cobyla, minimize, Bounds
label_desc: Use image node_id 2 for calling the TestBounds obj's underlying member method code with example usage: obj.test_unbounded() and returns: np