code: def test_old_bounds_to_new():
      bounds = ([1, 2], (None, 3), (-1, None))
      lb_true = np.array([1, -np.inf, -1])
      ub_true = np.array([2, 3, np.inf])
  
      lb, ub = old_bound_to_new(bounds)
      assert_array_equal(lb, lb_true)
      assert_array_equal(ub, ub_true)
  
      bounds = [(-np.inf, np.inf), (np.array([1]), np.array([1]))]
      lb, ub = old_bound_to_new(bounds)
  
      assert_array_equal(lb, [-np.inf, 1])
      assert_array_equal(ub, [np.inf, 1])
  
imports: import pytest
  import numpy
  from numpy.testing import TestCase, assert_array_equal
  import scipy.sparse
  from scipy.optimize._constraints import Bounds, LinearConstraint, NonlinearConstraint, PreparedConstraint, new_bounds_to_old, old_bound_to_new, strict_bounds
label_desc: Use image node_id 4 for calling a global function with example usage: test_old_bounds_to_new() without return types