code: def group_by_all():
      """
      This is a comprehenisve test that will test all aggregations in the groupBy class.
      """
      generate_dict_answers()  # generate answer dictionary
  
      # perform group-by with datasets containing no NAs. All three na mode should produce same results
      h2o_iris = h2o.import_file(
          path=pyunit_utils.locate("smalldata/iris/iris_wheader.csv")
      )
      result_all = perform_group_by(h2o_iris, "all")
      result_ignore = perform_group_by(h2o_iris, "ignore")
      result_rm = perform_group_by(h2o_iris, "rm")
  
      # make sure return type of get_frame() is H2OFrame
      assert_is_type(result_all, H2OFrame)
      assert_is_type(result_ignore, H2OFrame)
      assert_is_type(result_rm, H2OFrame)
  
      # make sure the result frame contains the correct number of rows and columns
      assert (
          result_all.shape
          == result_ignore.shape
          == result_rm.shape
          == (3, 30)
      ), "H2O group_by() command is not working."
  
      # check all group by results are the same
      assert pyunit_utils.compare_frames(
          result_all,
          result_ignore,
          0,
          0,
          1e-6,
          strict=True,
          compare_NA=False,
      ), "H2O group_by() command is not working."
      assert pyunit_utils.compare_frames(
          result_ignore,
          result_rm,
          0,
          0,
          1e-6,
          strict=True,
          compare_NA=False,
      ), "H2O group_by() command is not working."
  
      # check group by result with known correct result
      assert_group_by_result(
          result_all, g_iris_setosa_sepal_len, "Iris-setosa"
      )
      assert_group_by_result(
          result_rm, g_iris_versicolor_sepal_wid, "Iris-versicolor"
      )
      assert_group_by_result(
          result_ignore, g_iris_virginica_petal_wid, "Iris-virginica"
      )
  
      # perform group-by with datasets contain NAs.
      h2o_iris_NA = h2o.import_file(
          path=pyunit_utils.locate(
              "smalldata/iris/iris_wheader_NA_2.csv"
          )
      )
      result_all_NA = perform_group_by(h2o_iris_NA, "all")
      result_ignore_NA = perform_group_by(h2o_iris_NA, "ignore")
      result_rm_NA = perform_group_by(h2o_iris_NA, "rm")
  
      # make sure return type of get_frame() is H2OFrame
      assert_is_type(result_all_NA, H2OFrame)
      assert_is_type(result_ignore_NA, H2OFrame)
      assert_is_type(result_rm_NA, H2OFrame)
  
      # make sure the result frame contains the correct number of rows and columns
      assert (
          result_all_NA.shape
          == result_ignore_NA.shape
          == result_rm_NA.shape
          == (3, 30)
      ), "H2O group_by() command is not working."
  
      # column petal_wid contains no NA and hence should provide same result as before independent of NA treatment
      assert pyunit_utils.compare_frames(
          result_all_NA[list(g_iris_virginica_petal_wid.keys())],
          result_rm_NA[list(g_iris_virginica_petal_wid.keys())],
          0,
          0,
          1e-6,
          strict=False,
          compare_NA=False,
      ), "H2O group_by() command is not working."
      assert pyunit_utils.compare_frames(
          result_all_NA[list(g_iris_virginica_petal_wid.keys())],
          result_ignore_NA[list(g_iris_virginica_petal_wid.keys())],
          0,
          0,
          1e-6,
          strict=False,
          compare_NA=False,
      ), "H2O group_by() command is not working."
      assert_group_by_result(
          result_all_NA, g_iris_virginica_petal_wid, "Iris-virginica"
      )
  
      # check to make sure result_all_NA columns for sepal_len, sepal_wid, petal_len are all NAs for na='all'
      assert_all_NAs(
          result_all_NA, list(g_iris_setosa_sepal_len.keys())
      )  # check sepal_len
      assert_all_NAs(
          result_all_NA, list(g_iris_versicolor_sepal_wid.keys())
      )  # check sepal_wid
      assert_all_NAs(
          result_all_NA,
          list(g_iris_versicolor_petal_len_NA_ignore.keys()),
      )  # check petal_len
  
      # check to make sure na="ignore", and na="rm" are calculated correctly against known answers
      assert_group_by_result(
          result_ignore_NA,
          g_iris_versicolor_petal_len_NA_ignore,
          "Iris-versicolor",
      )
      assert_group_by_result(
          result_rm_NA,
          g_iris_versicolor_petal_len_NA_rm,
          "Iris-versicolor",
      )
  
file_path: h2o-3/h2o-py/tests/testdir_munging/pyunit_groupby_allOps.py
imports: import sys
  import h2o
  import math
  from tests import pyunit_utils
  from h2o.utils.typechecks import assert_is_type
  from h2o.frame import H2OFrame
label_desc: Use image node_id 1 for calling a global function with example usage: group_by_all() without return types