docstr: Return duplicated indices in group based on column names
  
  Args:
      df: dataframe to check
      key_col: a list of column names to check the duplicates
  
  Returns:
      A list of list with all duplicated row index
docstr_tok: ["Return","duplicated","indices","in","group","based","on","column","names","Args",":","df",":","dataframe","to","check","key_col",":","a","list","of","column","names","to","check","the","duplicates","Returns",":","A","list","of","list","with","all","duplicated","row","index"]
code: def duplication_check(
      cls, df: pd.DataFrame, key_col: List[str] = None
  ):
      """
      Return duplicated indices in group based on column names
  
      Args:
          df: dataframe to check
          key_col: a list of column names to check the duplicates
  
      Returns:
          A list of list with all duplicated row index
  
      """
      if key_col is None:
          key_col = df.columns
      else:
          for col in key_col:
              if col not in df.columns:
                  raise ColumnNotFound(col, df.columns)
      groups = df.groupby(by=key_col).groups
      results = list()
      for indices in groups.values():
          if len(indices) > 1:
              results.append(indices.to_list())
      return results
  
file_path: contextual-ai/xai/data/validator/dataframe_validator.py
imports: import operator
  from collections import Counter
  from typing import List, Tuple
  import pandas
  from xai.data.exceptions import ColumnNotFound
label_desc: Use image node_id 1 for calling the DataframeValidator obj's underlying member method code with example usage: obj.duplication_check(cls, df, key_col) and returns: results