code: def test_ks_2samp(setup, chunk_size):
      n1 = 10
      n2 = 15
      rs = np.random.RandomState(0)
      rvs1 = sp_norm.rvs(size=n1, loc=0.0, scale=1, random_state=rs)
      rvs2 = sp_norm.rvs(size=n2, loc=0.5, scale=1.5, random_state=rs)
  
      d1 = tensor(rvs1, chunk_size=chunk_size)
      d2 = tensor(rvs2, chunk_size=chunk_size)
  
      result = ks_2samp(d1, d2).execute().fetch()
      expected = sp_ks_2samp(rvs1, rvs2)
      assert result == expected
  
      with pytest.raises(ValueError):
          ks_2samp(d1, d2, alternative="unknown")
  
      with pytest.raises(ValueError):
          ks_2samp(d1, d2, mode="unknown")
  
      with pytest.raises(ValueError):
          ks_2samp(d1, [])
  
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 6 for calling a global function with example usage: test_ks_2samp(setup, chunk_size) without return types