code: def test_sort_index_execution(setup):
      raw = pd.DataFrame(
          np.random.rand(100, 20), index=np.random.rand(100)
      )
  
      mdf = DataFrame(raw)
      result = mdf.sort_index().execute().fetch()
      expected = raw.sort_index()
      pd.testing.assert_frame_equal(result, expected)
  
      mdf = DataFrame(raw)
      mdf.sort_index(inplace=True)
      result = mdf.execute().fetch()
      expected = raw.sort_index()
      pd.testing.assert_frame_equal(result, expected)
  
      mdf = DataFrame(raw, chunk_size=30)
      result = mdf.sort_index().execute().fetch()
      expected = raw.sort_index()
      pd.testing.assert_frame_equal(result, expected)
  
      mdf = DataFrame(raw, chunk_size=20)
      result = mdf.sort_index(ascending=False).execute().fetch()
      expected = raw.sort_index(ascending=False)
      pd.testing.assert_frame_equal(result, expected)
  
      mdf = DataFrame(raw, chunk_size=10)
      result = mdf.sort_index(ignore_index=True).execute().fetch()
      try:  # for python3.5
          expected = raw.sort_index(ignore_index=True)
      except TypeError:
          expected = raw.sort_index()
          expected.index = pd.RangeIndex(len(expected))
      pd.testing.assert_frame_equal(result, expected)
  
      # test axis=1
      raw = pd.DataFrame(
          np.random.rand(10, 10), columns=np.random.rand(10)
      )
  
      mdf = DataFrame(raw)
      result = mdf.sort_index(axis=1).execute().fetch()
      expected = raw.sort_index(axis=1)
      pd.testing.assert_frame_equal(result, expected)
  
      mdf = DataFrame(raw, chunk_size=3)
      result = mdf.sort_index(axis=1).execute().fetch()
      expected = raw.sort_index(axis=1)
      pd.testing.assert_frame_equal(result, expected)
  
      mdf = DataFrame(raw, chunk_size=4)
      result = mdf.sort_index(axis=1, ascending=False).execute().fetch()
      expected = raw.sort_index(axis=1, ascending=False)
      pd.testing.assert_frame_equal(result, expected)
  
      mdf = DataFrame(raw, chunk_size=4)
  
      result = (
          mdf.sort_index(axis=1, ignore_index=True).execute().fetch()
      )
      try:  # for python3.5
          expected = raw.sort_index(axis=1, ignore_index=True)
      except TypeError:
          expected = raw.sort_index(axis=1)
          expected.index = pd.RangeIndex(len(expected))
      pd.testing.assert_frame_equal(result, expected)
  
      # test series
      raw = pd.Series(np.random.rand(10), index=np.random.rand(10))
  
      series = Series(raw)
      result = series.sort_index().execute().fetch()
      expected = raw.sort_index()
      pd.testing.assert_series_equal(result, expected)
  
      series = Series(raw, chunk_size=2)
      result = series.sort_index().execute().fetch()
      expected = raw.sort_index()
      pd.testing.assert_series_equal(result, expected)
  
      series = Series(raw, chunk_size=3)
      result = series.sort_index(ascending=False).execute().fetch()
      expected = raw.sort_index(ascending=False)
      pd.testing.assert_series_equal(result, expected)
  
file_path: mars/mars/dataframe/sort/tests/test_sort_execution.py
imports: import os
  import sys
  import numpy
  import pandas
  import pytest
  from ....tests.core import require_cudf
  from ...None import DataFrame, Series, ArrowStringDtype
label_desc: Use image node_id 2 for calling a global function with example usage: test_sort_index_execution(setup) without return types