code: def assert_armijo(s, phi, c1=1e-4, err_msg=""):
      """
      Check that Armijo condition applies
      """
      phi1 = phi(s)
      phi0 = phi(0)
      msg = f"s = {s}; phi(0) = {phi0}; phi(s) = {phi1}; {err_msg}"
      assert phi1 <= (1 - c1 * s) * phi0, msg
  
imports: from numpy.testing import 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 2 for calling a global function with example usage: assert_armijo(s, phi, c1, err_msg) without return types