code: def ref_sort_fw(x, axis, reverse, with_index, only_index):
      y = np.sort(x, axis)
      i = np.argsort(x, axis)
      if reverse:
          y = np.flip(y, axis)
          i = np.flip(i, axis)
      if only_index:
          return i
      if with_index:
          return y, i
      return y
  
file_path: nnabla/python/test/function/test_sort.py
imports: import pytest
  import numpy
  import nnabla
  import nnabla.functions
  from nbla_test_utils import list_context, function_tester
label_desc: Use image node_id 1 for calling a global function with example usage: ref_sort_fw(x, axis, reverse, with_index, only_index) and returns: y, i, y,  i