code: def test_check_non_negative_then_return_value_execution(setup):
      raw = np.random.randint(10, size=(10, 5))
      c = mt.tensor(raw, chunk_size=(3, 2))
  
      r = check_non_negative_then_return_value(c, c, "sth")
      result = r.execute().fetch()
      np.testing.assert_array_equal(result, raw)
  
      raw = raw.copy()
      raw[1, 3] = -1
      c = mt.tensor(raw, chunk_size=(3, 2))
  
      r = check_non_negative_then_return_value(c, c, "sth")
      with pytest.raises(ValueError):
          _ = r.execute().fetch()
  
      raw = sps.random(10, 5, density=0.3, format="csr")
      c = mt.tensor(raw, chunk_size=(3, 2))
  
      r = check_non_negative_then_return_value(c, c, "sth")
      result = r.execute().fetch()
      np.testing.assert_array_equal(result.toarray(), raw.A)
  
      raw = raw.copy()
      raw[1, 3] = -1
      c = mt.tensor(raw, chunk_size=(3, 2))
  
      r = check_non_negative_then_return_value(c, c, "sth")
      with pytest.raises(ValueError):
          _ = r.execute().fetch()
  
      raw = pd.DataFrame(np.random.rand(10, 4))
      c = md.DataFrame(raw, chunk_size=(3, 2))
  
      r = check_non_negative_then_return_value(c, c, "sth")
      result = r.execute().fetch()
  
      pd.testing.assert_frame_equal(result, raw)
  
      raw = raw.copy()
      raw.iloc[1, 3] = -1
      c = md.DataFrame(raw, chunk_size=(3, 2))
  
      r = check_non_negative_then_return_value(c, c, "sth")
      with pytest.raises(ValueError):
          _ = r.execute().fetch()
  
file_path: mars/mars/learn/utils/tests/test_checks.py
imports: import numpy
  import pandas
  import pytest
  import scipy.sparse
  from ....None import tensor
  from ....None import dataframe
  from ....config import option_context
  from ..checks import check_non_negative_then_return_value, assert_all_finite
label_desc: Use image node_id 1 for calling a global function with example usage: test_check_non_negative_then_return_value_execution(setup) without return types