code: def create_differences_data(
      condition_info: ConditionalInfo,
      variable_info: VariableInfo,
      effect_type: str,
  ) -> pd.DataFrame:
      """Creates either unit level or grid level data for 'comparisons' and 'slopes'
      depending if the user passed covariate values.
  
      Parameters
      ----------
      condition_info : ConditionalInfo
          Information about the conditional argument passed into the plot
          function.
      variable_info : VariableInfo
          Information about the variable of interest. This is `contrast` for
          'comparisons' and `wrt` for 'slopes'.
      effect_type : str
          The type of effect being computed. Either "comparisons" or "slopes".
  
      Returns
      -------
      pd.DataFrame
          A dataframe containing the data used to generate predictions. If no
          covariates were passed, then the original data used to fit the model
          is returned. Otherwise, a grid of values is created using the covariates
          passed into the `conditional` argument.
      """
      if not condition_info.covariates:
          return _differences_unit_level(variable_info, effect_type)
  
      return create_grid(
          condition_info, variable_info, effect_type=effect_type
      )
  
file_path: bambi/bambi/interpret/create_data.py
imports: import itertools
  from typing import Union
  from statistics import mode
  import numpy
  import pandas
  from pandas.api.types import is_categorical_dtype, is_float_dtype, is_integer_dtype, is_numeric_dtype, is_object_dtype, is_string_dtype
  from bambi import Model
  from bambi.interpret.utils import ConditionalInfo, enforce_dtypes, get_model_covariates, VariableInfo
  from bambi.interpret.logs import log_interpret_defaults
label_desc: Use image node_id 4 for calling a global function with example usage: create_differences_data(condition_info, variable_info, effect_type) and returns: create_grid, _differences_unit_level