code: def check_variable_groups(variable_groups, explainer):
      variable_groups_copy = deepcopy(variable_groups)
      if variable_groups_copy is not None:
          if not isinstance(variable_groups_copy, dict):
              raise TypeError(
                  "'variable_groups' should be of class dict"
              )
  
          wrong_names = np.empty(len(variable_groups_copy))
          for i, key in enumerate(variable_groups_copy):
              if isinstance(variable_groups_copy[key], list):
                  variable_groups_copy[key] = np.array(
                      variable_groups_copy[key]
                  )
              elif not isinstance(
                  variable_groups_copy[key], np.ndarray
              ):
                  raise TypeError(
                      "'variable_groups' is a dict of lists of variables"
                  )
  
              if not isinstance(variable_groups_copy[key][0], str):
                  raise TypeError(
                      "'variable_groups' is a dict of lists of variables"
                  )
  
              wrong_names[i] = np.in1d(
                  variable_groups_copy[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. "
                  "'variable_groups' is a dict of lists of numeric variables."
              )
  
      return variable_groups_copy
  
file_path: DALEX/python/dalex/dalex/aspect/_predict_aspect_importance/checks.py
imports: import numpy
  import pandas
  from copy import deepcopy
  from warnings import warn
label_desc: Use image node_id 3 for calling a global function with example usage: check_variable_groups(variable_groups, explainer) and returns: variable_groups_copy