code: def test_cat_encoding():
      valid_values = [
          "auto",
          "enum",
          "one_hot_internal",
          "one_hot_explicit",
          "binary",
          "eigen",
          "label_encoder",
          "enum_limited",
          # "sort_by_response"    TODO: This is invalid parameter, remove it
      ]
      df = h2o.create_frame(
          rows=100,
          cols=4,
          categorical_fraction=0.4,
          integer_fraction=0,
          binary_fraction=0,
          real_range=100,
          integer_range=100,
          missing_fraction=0,
          seed=1234,
      )
      model = H2OAggregatorEstimator(target_num_exemplars=5)
      try:
          for val in valid_values:
              model.categorical_encoding = val
              model.train(training_frame=df)
      except:
          assert (
              False
          ), "Aggregator model should be able to process all valid categorical_encoding values"
  
      # Try with invalid value
      try:
          model = H2OAggregatorEstimator(
              target_num_exemplars=5,
              categorical_encoding="some_invalid_value",
          )
          assert (
              False
          ), "Passing invalid value of categorical_encoding should throw an error"
      except:
          pass
  
imports: import h2o
  from tests import pyunit_utils
  from h2o.frame import H2OFrame
  from h2o.estimators.aggregator import H2OAggregatorEstimator
label_desc: Use image node_id 3 for calling a global function with example usage: test_cat_encoding() without return types