code: def test_grouping_column():
      paths = [
          "smalldata/titanic/titanic_expanded.csv",
          "smalldata/logreg/prostate.csv",
          "smalldata/iris/iris2.csv",
      ]
      ys = ["fare", "CAPSULE", "response"]
      names_to_extract = ["name", None, None]
      targets = [None, None, "setosa"]
      cols_as_factors = [None, ["GLEASON", "CAPSULE"], None]
      grouping_variable = ["cabin_type", "GLEASON", "response"]
  
      for i in range(len(paths)):
          train = h2o.upload_file(pyunit_utils.locate(paths[i]))
          if cols_as_factors[i] is not None:
              for col in cols_as_factors[i]:
                  train[col] = train[col].asfactor()
          gbm = H2OGradientBoostingEstimator(
              seed=1234, model_id="my_awesome_model_py" + str(i)
          )
          gbm.train(y=ys[i], training_frame=train)
  
          cols_to_test = _get_cols_to_test(train, ys[i])
          if names_to_extract[i] is not None:
              if names_to_extract[i] in cols_to_test:
                  cols_to_test.remove(names_to_extract[i])
  
          _assert_list_of_plots_was_produced(
              cols_to_test, gbm, train, targets[i], grouping_variable[i]
          )
  
imports: import sys
  import os
  import matplotlib
  import h2o
  import math
  import matplotlib.pyplot
  from tests import pyunit_utils
  from h2o.estimators import *
  from h2o.explanation._explain import *
  from h2o.explanation._explain import _handle_orig_values, _factor_mapper
  from h2o.two_dim_table import H2OTwoDimTable
label_desc: Use image node_id 6 for calling a global function with example usage: test_grouping_column() without return types