code: def check_variable_splits(
      variable_splits,
      variables,
      grid_points,
      data,
      variable_splits_type,
      variable_splits_with_obs,
      new_observation,
  ):
      """
      Validate variable splits
      """
      if variable_splits is None:
          variable_splits_ = utils.calculate_variable_split(
              data,
              variables,
              grid_points,
              variable_splits_type,
              variable_splits_with_obs,
              new_observation,
          )
      else:
          if not isinstance(variable_splits, dict):
              raise TypeError("variable_splits has to be a dict")
  
          if not set(variable_splits.keys()) == set(variables):
              raise ValueError(
                  "variable_splits variables do not match with these in explainer data"
              )
  
          variable_splits_ = deepcopy(variable_splits)
  
          for key in variable_splits_.keys():
              if not isinstance(
                  variable_splits_[key], (list, np.ndarray)
              ):
                  raise TypeError(
                      "variable_splits values have to be list or numpy.ndarrays"
                  )
              if isinstance(variable_splits_[key], list):
                  variable_splits_[key] = np.array(
                      variable_splits_[key]
                  )
  
      return variable_splits_
  
file_path: DALEX/python/dalex/dalex/predict_explanations/_ceteris_paribus/checks.py
imports: import warnings
  from copy import deepcopy
  import numpy
  import pandas
  from .None import utils
label_desc: Use image node_id 5 for calling a global function with example usage: check_variable_splits(variable_splits, variables, grid_points, data, variable_splits_type, variable_splits_with_obs, new_observation) and returns: variable_splits_