code: def test_rankdata_execution(setup):
      rs = np.random.RandomState(0)
      a = rs.rand(4)
  
      t1 = tensor(a, chunk_size=5)
      r = rankdata(t1)
  
      result = r.execute().fetch()
      expected = sp_rankdata(a)
      np.testing.assert_array_almost_equal(result, expected)
  
      b = rs.rand(4, 4)
  
      t2 = tensor(b, chunk_size=5)
      r2 = rankdata(t2, axis=1)
  
      result = r2.execute().fetch()
      expected = sp_rankdata(b, axis=1)
      np.testing.assert_array_almost_equal(result, expected)
  
      c = rs.rand(0, 4)
  
      t3 = tensor(c, chunk_size=5)
      r3 = rankdata(t3, axis=1)
  
      result = r3.execute().fetch()
      expected = sp_rankdata(c, axis=1)
      np.testing.assert_array_almost_equal(result, expected)
  
      methods = [
          "average",
          "min",
          "max",
          "dense",
          "ordinal",
      ]
  
      for method in methods:
          r = rankdata(t1, method=method)
          result = r.execute().fetch()
  
          expected = sp_rankdata(a, method=method)
          np.testing.assert_almost_equal(result, expected)
  
      with pytest.raises(ValueError):
          r = rankdata(t1, method="unknown")
  
file_path: mars/mars/tensor/stats/tests/test_stats_execution.py
imports: import functools
  import numpy
  import pytest
  import scipy
  from scipy.stats import entropy, power_divergence, chisquare, ks_1samp, ks_2samp, norm, ttest_rel, ttest_ind, ttest_ind_from_stats, ttest_1samp, rankdata
  from ....lib.version import parse
  from ...None import tensor
  from ..None import entropy, power_divergence, chisquare, ttest_ind, ttest_rel, ttest_1samp, ttest_ind_from_stats, ks_1samp, ks_2samp, rankdata
label_desc: Use image node_id 7 for calling a global function with example usage: test_rankdata_execution(setup) without return types