docstr: Sanity checks
docstr_tok: ["Sanity","checks"]
code: def check_index(self, is_sorted=True, unique=True, index=None):
      """Sanity checks"""
      if not index:
          index = self.index
      if is_sorted:
          test = pd.DataFrame(lrange(len(index)), index=index)
          test_sorted = test.sort()
          if not test.index.equals(test_sorted.index):
              raise Exception("Data is not be sorted")
      if unique:
          if len(index) != len(index.unique()):
              raise Exception("Duplicate index entries")
  
imports: from statsmodels.compat.python import lrange, lzip
  import numpy
  import pandas
  import statsmodels.tools.data
  from pandas import Index, MultiIndex
label_desc: Use image node_id 9 for calling the Grouping obj's underlying member method code with example usage: obj.check_index(is_sorted, unique, index) without return types