code: def _assert_success(
      res, desired_fun=None, desired_x=None, rtol=1e-7, atol=1e-7
  ):
      # res: linprog result object
      # desired_fun: desired objective function value or None
      # desired_x: desired solution or None
      assert_(res.success)
      assert_equal(res.status, 0)
      if desired_fun is not None:
          assert_allclose(
              res.fun,
              desired_fun,
              err_msg="converged to an unexpected objective value",
              rtol=rtol,
              atol=atol,
          )
      if desired_x is not None:
          assert_allclose(
              res.x,
              desired_x,
              err_msg="converged to an unexpected solution",
              rtol=rtol,
              atol=atol,
          )
  
imports: import numpy
  from numpy.testing import assert_, assert_allclose, assert_equal
  from .test_linprog import magic_square
  from scipy.optimize._remove_redundancy import _remove_redundancy_svd
  from scipy.optimize._remove_redundancy import _remove_redundancy_pivot_dense
  from scipy.optimize._remove_redundancy import _remove_redundancy_pivot_sparse
  from scipy.optimize._remove_redundancy import _remove_redundancy_id
  from scipy.sparse import csc_matrix
label_desc: Use image node_id 2 for calling a global function with example usage: _assert_success(res, desired_fun, desired_x, rtol, atol) without return types