code: def data_grid(
      model: Model,
      conditional: Union[str, list, dict],
      variable: Union[str, dict, None] = None,
      effect_type: Union[str, None] = None,
      eps: Union[float, None] = None,
      **kwargs,
  ):
      """Create a pairwise grid of data using the covariates passed to the 'conditional' and optional
      'variable' argument. Covariates not passed to 'conditional', but are terms in the Bambi model,
      are set to typical values (e.g., mean or mode).
  
      Parameters
      ----------
      model : Model
          Bambi Model object.
      conditional : str, list, dict
          The covariates we would like to condition on. If dict, keys are the covariate names and
          values are the values to condition on.
      variable: str, dict, optional
          The variable of interest. This is 'contrast' for 'comparisons', 'wrt' for 'slopes', and
          'None' for 'predictions'. If dict, keys are the covariate names and values are the values.
      effect_type : str, optional
          The type of effect the data may be used for. This argument is useful for if the data
          will be used to compute 'comparisons' or 'slopes' and a parameter is passed to 'variable'
          as it determines the default 'eps' value. Defaults to None.
      eps : float, optional
          The epsilon value used to compute 'comparisons' or 'slopes'. If 'effect_type' is True,
          'comparisons' defaults to `0.5` and 'slopes' defaults to `1e-4`.
      **kwargs : dict
          Optional keywords arguments passed to 'create_grid' to determine the number of values `num`
          to return when computing a `np.linspace` grid for default values.
  
      Returns
      -------
      pd.DataFrame
          A dataframe containing pairwise combinations of values based on the parameters
          passed into 'conditional' and 'variable'.
  
      Raises
      ------
      ValueError
          If 'variable' and 'effect_type' not in ["comparisons", "slopes", "predictions"].
      TypeError
          If 'conditional' is a dict and the values are not of type int, float, list, or np.ndarray.
          If 'conditional' is a list and the elements are not of type str.
          If 'variable' is a dict and there is more than one key.
  
      """
      if variable and effect_type not in [
          "comparisons",
          "slopes",
          "predictions",
      ]:
          raise ValueError(
              "'If passing an argument to 'variable', the parameter 'effect_type' must be either "
              f"'comparisons' or 'slopes'. Received: {effect_type}"
          )
  
      if isinstance(conditional, dict):
          for value in conditional.values():
              if not isinstance(value, (int, float, list, np.ndarray)):
                  raise TypeError(
                      "Dictionary values must be of type int, float, list, or np.ndarray. "
                      f"Received: {type(value)}"
                  )
  
      if isinstance(conditional, list):
          for value in conditional:
              if not isinstance(value, str):
                  raise TypeError(
                      f"Elements of list must be of type str. Received: {type(value)}"
                  )
  
      conditional = ConditionalInfo(model, conditional)
      kwargs["effect_type"] = effect_type
  
      if variable:
          if isinstance(variable, dict):
              if len(variable) > 1:
                  raise ValueError(
                      "Variable dictionary must have only one key."
                  )
  
          if not eps and effect_type == "comparisons":
              eps = 0.5
          elif not eps and effect_type == "slopes":
              eps = 1e-4
  
          grid = bool(conditional.covariates)
          variable = VariableInfo(
              model, variable, kind=effect_type, eps=eps, grid=grid
          )
  
      return create_grid(conditional, variable, **kwargs)
  
file_path: bambi/bambi/interpret/helpers.py
imports: from typing import Union
  import warnings
  import numpy
  import pandas
  import xarray
  from arviz import InferenceData
  from bambi import Model
  from bambi.interpret.create_data import create_grid
  from bambi.interpret.utils import ConditionalInfo, VariableInfo
label_desc: Use image node_id 1 for calling a global function with example usage: data_grid(model, conditional, variable, effect_type, eps) and returns: create_grid