code: def assert_groupby_consistent(self, expected, real):
      from pandas.core.groupby import DataFrameGroupBy, SeriesGroupBy
      from ..lib.groupby_wrapper import GroupByWrapper
      from ..dataframe.core import (
          DATAFRAME_GROUPBY_TYPE,
          SERIES_GROUPBY_TYPE,
      )
      from ..dataframe.core import (
          DATAFRAME_GROUPBY_CHUNK_TYPE,
          SERIES_GROUPBY_CHUNK_TYPE,
      )
  
      df_groupby_types = (DataFrameGroupBy,)
      series_groupby_types = (SeriesGroupBy,)
  
      try:
          from cudf.core.groupby.groupby import (
              DataFrameGroupBy as CUDataFrameGroupBy,
              SeriesGroupBy as CUSeriesGroupBy,
          )
  
          df_groupby_types += (CUDataFrameGroupBy,)
          series_groupby_types += (CUSeriesGroupBy,)
      except ImportError:
          pass
  
      if isinstance(real, GroupByWrapper):
          real = real.groupby_obj
  
      if isinstance(
          expected,
          (DATAFRAME_GROUPBY_TYPE, DATAFRAME_GROUPBY_CHUNK_TYPE),
      ) and isinstance(real, df_groupby_types):
          selection = getattr(real, "_selection", None)
          if not selection:
              self.assert_dataframe_consistent(expected, real.obj)
          else:
              self.assert_dataframe_consistent(
                  expected, real.obj[selection]
              )
      elif isinstance(
          expected, (SERIES_GROUPBY_TYPE, SERIES_GROUPBY_CHUNK_TYPE)
      ) and isinstance(real, series_groupby_types):
          self.assert_series_consistent(expected, real.obj)
      else:
          raise AssertionError(
              "GroupBy type not consistent. Expecting %r but receive %r"
              % (type(expected), type(real))
          )
  
imports: import fnmatch
  import functools
  import inspect
  import itertools
  import logging
  import os
  import sys
  import time
  import types
  from typing import Dict
  import numpy
  import pandas
  import pytest
  from ..core.operand import OperandStage
  from ..utils import lazy_import
label_desc: Use image node_id 8 for calling the ObjectCheckMixin obj's underlying member method code with example usage: obj.assert_groupby_consistent(expected, real) without return types