code: def assert_wolfe(s, phi, derphi, c1=1e-4, c2=0.9, err_msg=""):
      """
      Check that strong Wolfe conditions apply
      """
      phi1 = phi(s)
      phi0 = phi(0)
      derphi0 = derphi(0)
      derphi1 = derphi(s)
      msg = (
          "s = %s; phi(0) = %s; phi(s) = %s; phi'(0) = %s; phi'(s) = %s; %s"
          % (s, phi0, phi1, derphi0, derphi1, err_msg)
      )
  
      assert_(phi1 <= phi0 + c1 * s * derphi0, "Wolfe 1 failed: " + msg)
      assert_(
          abs(derphi1) <= abs(c2 * derphi0), "Wolfe 2 failed: " + msg
      )
  
imports: from numpy.testing import assert_, assert_equal, assert_array_almost_equal, assert_array_almost_equal_nulp, assert_warns, suppress_warnings
  import scipy.optimize.linesearch
  from scipy.optimize.linesearch import LineSearchWarning
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: assert_wolfe(s, phi, derphi, c1, c2, err_msg) without return types