code: def assert_frame_equal_by_index_group(expect, got):
      assert sorted(expect.columns) == sorted(got.columns)
      assert sorted(set(got.index)) == sorted(set(expect.index))
      # Note the set_index sort is not stable,
      unique_values = sorted(set(got.index))
      for iv in unique_values:
          sr_expect = expect.loc[[iv]]
          sr_got = got.loc[[iv]]
  
          for k in expect.columns:
              # Sort each column before we compare them
              sorted_expect = sr_expect.sort_values(k)[k]
              sorted_got = sr_got.sort_values(k)[k]
              np.testing.assert_array_equal(sorted_expect, sorted_got)
  
imports: import random
  import cupy
  import numpy
  import pandas
  import pytest
  from packaging import version
  import dask
  from dask import dataframe
  from dask.dataframe.core import make_meta, meta_nonempty
  from dask.utils import M
  import cudf
  import dask_cudf
label_desc: Use image node_id 14 for calling a global function with example usage: assert_frame_equal_by_index_group(expect, got) without return types