code: def test_serialize_groupby_level():
      idx = pd.MultiIndex.from_tuples(
          [(1, 1), (1, 2), (2, 2)], names=("a", "b")
      )
      pdf = pd.DataFrame({"c": [1, 2, 3], "d": [2, 3, 4]}, index=idx)
      df = cudf.from_pandas(pdf)
      gb = df.groupby(level="a")
      expect = gb.mean()
      outgb = gb.deserialize(*gb.serialize())
      got = outgb.mean()
      assert_eq(expect.sort_index(), got.sort_index())
  
imports: import pickle
  import msgpack
  import numpy
  import pandas
  import pytest
  import cudf
  from cudf.testing import _utils
  from cudf.testing._utils import assert_eq
label_desc: Use image node_id 12 for calling a global function with example usage: test_serialize_groupby_level() without return types