code: def test_data_grid_comparisons(
      request, mtcars, conditional, variable
  ):
      model, idata = mtcars
      grid = data_grid(
          model,
          conditional,
          variable=variable,
          effect_type="comparisons",
      )
  
      id = request.node.name
      if id == "defaults":
          assert grid.shape == (200, 3)
          assert grid.columns.tolist() == ["drat", "am", "hp"]
      elif id == "user_passed" or id == "defaults_and_user_passed":
          assert grid.shape == (16, 3)
          assert grid.columns.tolist() == ["drat", "am", "hp"]
  
      with pytest.raises(
          ValueError,
          match="'If passing an argument to 'variable', the parameter 'effect_type' must be either "
          f"'comparisons' or 'slopes'. Received: {None}",
      ):
          data_grid(
              model, conditional, variable=variable, effect_type=None
          )
  
file_path: bambi/tests/test_interpret.py
imports: import numpy
  import pandas
  import pytest
  import bambi
  from bambi.interpret.helpers import data_grid, select_draws
label_desc: Use image node_id 4 for calling a global function with example usage: test_data_grid_comparisons(request, mtcars, conditional, variable) without return types