code: def _check_grouping_columns(X_group, **kwargs) -> pd.DataFrame:
      """Do basic checks on grouping columns"""
      # Do regular checks on numeric columns
      X_group_num = X_group.select_dtypes(include="number")
      if X_group_num.shape[1]:
          check_array(X_group_num, **kwargs)
  
      # Only check missingness in object columns
      if (
          X_group.select_dtypes(exclude="number")
          .isnull()
          .any(axis=None)
      ):
          raise ValueError("X has NaN values")
  
      # The grouping part we always want as a DataFrame with range index
      return X_group.reset_index(drop=True)
  
file_path: scikit-lego/sklego/meta/_grouped_utils.py
imports: from typing import Tuple
  import numpy
  import pandas
  from scipy.sparse import issparse
  from sklearn.utils import check_array
  from sklearn.utils.validation import _ensure_no_complex_data
  from sklego.common import as_list
label_desc: Use image node_id 7 for calling a global function with example usage: _check_grouping_columns(X_group) and returns: X_group