code: def check_variable_groups(variable_groups, explainer):
      if variable_groups is not None:
          if not isinstance(variable_groups, dict):
              raise TypeError("variable_groups should be of class dict")
  
          wrong_names = np.empty(len(variable_groups))
          for i, key in enumerate(variable_groups):
              if isinstance(variable_groups[key], list):
                  variable_groups[key] = np.array(variable_groups[key])
              elif not isinstance(variable_groups[key], np.ndarray):
                  raise TypeError(
                      "variable_groups' is a dict of lists of variables"
                  )
  
              if not isinstance(variable_groups[key][0], str):
                  raise TypeError(
                      "variable_groups' is a dict of lists of variables"
                  )
  
              wrong_names[i] = np.in1d(
                  variable_groups[key], explainer.data.columns
              ).all()
  
          wrong_names = not wrong_names.all()
  
          if wrong_names:
              raise ValueError(
                  "You have passed wrong variables names in variable_groups argument"
              )
  
      return variable_groups
  
file_path: DALEX/python/dalex/dalex/model_explanations/_variable_importance/checks.py
imports: from warnings import warn
  from .._model_performance.utils import *
  from .._variable_importance.loss_functions import *
label_desc: Use image node_id 2 for calling a global function with example usage: check_variable_groups(variable_groups, explainer) and returns: variable_groups