code: def test_sort(self):
      # data frame
      sorted_data, index = self.grouping.sort(self.data)
      expected_sorted_data = self.data.sort_index()
  
      assert_frame_equal(sorted_data, expected_sorted_data)
      np.testing.assert_(isinstance(sorted_data, pd.DataFrame))
      np.testing.assert_(not index.equals(self.grouping.index))
  
      # make sure it copied
      if hasattr(sorted_data, "equals"):  # newer pandas
          np.testing.assert_(not sorted_data.equals(self.data))
  
      # 2d arrays
      sorted_data, index = self.grouping.sort(self.data.values)
      np.testing.assert_array_equal(
          sorted_data, expected_sorted_data.values
      )
      np.testing.assert_(isinstance(sorted_data, np.ndarray))
  
      # 1d series
      series = self.data[self.data.columns[0]]
      sorted_data, index = self.grouping.sort(series)
  
      expected_sorted_data = series.sort_index()
      assert_series_equal(sorted_data, expected_sorted_data)
      np.testing.assert_(isinstance(sorted_data, pd.Series))
      if hasattr(sorted_data, "equals"):
          np.testing.assert_(not sorted_data.equals(series))
  
      # 1d array
      array = series.values
      sorted_data, index = self.grouping.sort(array)
  
      expected_sorted_data = series.sort_index().values
      np.testing.assert_array_equal(sorted_data, expected_sorted_data)
      np.testing.assert_(isinstance(sorted_data, np.ndarray))
  
imports: from statsmodels.compat.pandas import assert_frame_equal, assert_series_equal
  import numpy
  from numpy.testing import assert_equal
  import pandas
  import pytest
  from scipy import sparse
  from statsmodels.tools.grouputils import dummy_sparse, Grouping, Group, combine_indices, group_sums
  from statsmodels.datasets import grunfeld, anes96
label_desc: Use image node_id 3 for calling the CheckGrouping obj's underlying member method code with example usage: obj.test_sort() without return types