code: def _determine_groups(self, X, provided_groups):
      if provided_groups is None:
          raise ValueError("Groups have to be specified")
      if isinstance(provided_groups, list):
          if not isinstance(X.columns, pd.MultiIndex):
              raise ValueError(
                  "Groups have to be provided as a dict when X is not a MultiIndex"
              )
          groups = {
              g: [
                  (g, c)
                  for c in X.columns.get_level_values(1)[
                      X.columns.get_level_values(0) == g
                  ]
              ]
              for g in provided_groups
          }
      else:
          groups = provided_groups
      return groups
  
imports: from __future__ import annotations
  import collections
  import altair
  import numpy
  import pandas
  import sklearn.utils
  from prince import pca, utils
label_desc: Use image node_id 4 for calling the MFA obj's underlying member method code with example usage: obj._determine_groups(X, provided_groups) and returns: groups