code: def _split_groups_and_values(
      X, groups, name="", min_value_cols=1, check_X=True, **kwargs
  ) -> Tuple[pd.DataFrame, np.ndarray]:
      _data_format_checks(X, name=name)
      _shape_check(X, min_value_cols)
  
      try:
          if isinstance(X, pd.DataFrame):
              X_group = X.loc[:, as_list(groups)]
              X_value = X.drop(columns=groups).values
          else:
              X_group = pd.DataFrame(X[:, as_list(groups)])
              pos_indexes = range(X.shape[1])
              X_value = np.delete(
                  X, [pos_indexes[g] for g in as_list(groups)], axis=1
              )
      except (KeyError, IndexError):
          raise ValueError(
              f"Could not drop groups {groups} from columns of X"
          )
  
      X_group = _check_grouping_columns(X_group, **kwargs)
  
      if check_X:
          X_value = check_array(X_value, **kwargs)
  
      return X_group, X_value
  
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 4 for calling a global function with example usage: _split_groups_and_values(X, groups, name, min_value_cols, check_X) and returns: X_group,  X_value