code: def test_basic(self):
      def f(x):
          return np.sum(x**2)
  
      lb = [-1, None, 1, None, -0.5]
      ub = [-0.5, -0.5, None, None, -0.5]
      bounds = [(a, b) for a, b in zip(lb, ub)]
      # these are converted to Bounds internally
  
      res = minimize(
          f, x0=[1, 2, 3, 4, 5], method="cobyla", bounds=bounds
      )
      ref = [-0.5, -0.5, 1, 0, -0.5]
      assert res.success
      assert_allclose(res.x, ref, 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 1 for calling the TestBounds obj's underlying member method code with example usage: obj.test_basic() and returns: np