code: def test_series_sort_index(nelem, asc):
      np.random.seed(0)
      sr = Series(100 * np.random.random(nelem))
      psr = sr.to_pandas()
  
      expected = psr.sort_index(ascending=asc)
      got = sr.sort_index(ascending=asc)
  
      assert_eq(expected, got)
  
imports: import string
  from itertools import product
  import numpy
  import pandas
  import pytest
  from cudf import DataFrame, Series
  from cudf.core.column import NumericalColumn
  from cudf.testing._utils import DATETIME_TYPES, NUMERIC_TYPES, assert_eq, assert_exceptions_equal, expect_warning_if
label_desc: Use image node_id 6 for calling a global function with example usage: test_series_sort_index(nelem, asc) without return types