code: def assert_result_dataframe(
      df: pd.DataFrame,
      duplicates_variations: t.Optional[
          t.Sequence[DuplicateVariation]
      ] = None,
  ):
      assert_that(
          df.index.names,
          equal_to(["Duplicate", "Dataset", "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", "Dataset"])
      data = data.agg(lambda x: x.to_list())
  
      for idx, expected_variation in enumerate(duplicates_variations):
          train_variation = dict(data.loc[(idx, "train")])
          test_variation = dict(data.loc[(idx, "test")])
  
          assert_that(
              train_variation["Sample ID"],
              equal_to(expected_variation.train_sample_ids),
          )
          assert_that(
              train_variation["Text"],
              equal_to(expected_variation.train_samples),
          )
          assert_that(
              test_variation["Sample ID"],
              equal_to(expected_variation.test_sample_ids),
          )
          assert_that(
              test_variation["Text"],
              equal_to(expected_variation.test_samples),
          )
  
imports: import typing
  import pandas
  import pytest
  from hamcrest import *
  from deepchecks.nlp.checks import TrainTestSamplesMix
  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