code: def assert_result_dataframe(
      df: pd.DataFrame,
      duplicates_variations: t.Optional[
          t.Sequence[DuplicateVariation]
      ] = None,
  ):
      assert_that(df, instance_of(pd.DataFrame))
      assert_that(df.index.names, equal_to(["Duplicate", "Sample ID"]))
      assert_that(df.columns, equal_to(["Text"]))
  
      if len(df) == 0:
          return
      if not duplicates_variations:
          return
  
      data = df.reset_index().groupby(["Duplicate"])
      data = data.aggregate(lambda x: x.to_list())
  
      for idx, variant in enumerate(duplicates_variations):
          variant_data = dict(data.iloc[idx])
          assert_that(
              variant_data["Sample ID"], equal_to(variant.sample_ids)
          )
          assert_that(variant_data["Text"], equal_to(variant.text))
  
file_path: deepchecks/tests/nlp/checks/data_integrity/text_duplicates_test.py
imports: import typing
  import pandas
  import pytest
  from hamcrest import *
  from deepchecks.core.check_result import CheckResult
  from deepchecks.nlp.checks import TextDuplicates
  from deepchecks.nlp.text_data import TextData
  from deepchecks.utils.strings import format_percent
  from tests.base.utils import equal_condition_result
label_desc: Use image node_id 5 for calling a global function with example usage: assert_result_dataframe(df, duplicates_variations) without return types