code: def test_compound(
      education_df,
      normalize,
      sort,
      ascending,
      expected_rows,
      expected_count,
      expected_group_size,
      dtype,
  ):
      education_df = education_df.astype(dtype)
      education_df.columns = education_df.columns.astype(dtype)
      # Multiple groupby keys and as_index=False
      gp = education_df.groupby(
          ["country", "gender"], as_index=False, sort=False
      )
      result = gp["education"].value_counts(
          normalize=normalize, sort=sort, ascending=ascending
      )
      expected = DataFrame()
      for column in ["country", "gender", "education"]:
          expected[column] = [
              education_df[column][row] for row in expected_rows
          ]
          expected = expected.astype(dtype)
          expected.columns = expected.columns.astype(dtype)
      if normalize:
          expected["proportion"] = expected_count
          expected["proportion"] /= expected_group_size
          if dtype == "string[pyarrow]":
              expected["proportion"] = expected[
                  "proportion"
              ].convert_dtypes()
      else:
          expected["count"] = expected_count
          if dtype == "string[pyarrow]":
              expected["count"] = expected["count"].convert_dtypes()
      tm.assert_frame_equal(result, expected)
  
imports: import numpy
  import pytest
  import pandas.util._test_decorators
  from pandas import Categorical, CategoricalIndex, DataFrame, Grouper, Index, MultiIndex, Series, date_range, to_datetime
  import pandas._testing
  from pandas.util.version import Version
label_desc: Use image node_id 15 for calling a global function with example usage: test_compound(education_df, normalize, sort, ascending, expected_rows, expected_count, expected_group_size, dtype) without return types