code: def _create_train_test_joined_duplicate_frame(
      first: pd.DataFrame, second: pd.DataFrame, columns: List[Hashable]
  ):
      """Create duplicate dataframe out of 2 uniques dataframes.
  
      This function accept 2 dataframes resulted from `_create_unique_frame`. this means that each dataframe have
      no duplicate in it. so if the concatenation between the 2 find duplicates, they are necessarily between each other.
      """
      columns_data = []
      index_text = []
      total_test_count = 0
      group_unique_data: dict = (
          pd.concat([first, second])
          .groupby(columns, dropna=False)
          .groups
      )
      # The group data is backward (the columns are the indexes, and the indexes are the values)
      for duplicate_columns, indexes in group_unique_data.items():
          # If length is 1, then no duplicate found between first and second
          if len(indexes) == 1:
              continue
          # Indexes should have dict of train & test info from `_filter_duplicates`
          text = indexes[0]["text"] + "\n" + indexes[1]["text"]
          # Take the count only of test
          test_count = (
              indexes[0]["count"]
              if indexes[0]["text"].startswith("Test")
              else indexes[1]["count"]
          )
          total_test_count += test_count
          # Save info of duplicated text and the columns info
          columns_data.append([*duplicate_columns, test_count])
          index_text.append(text)
  
      count_column_name = "_value_to_sort_by_"
      duplicates = pd.DataFrame(
          columns_data,
          index=index_text,
          columns=[*columns, count_column_name],
      )
      duplicates = duplicates.sort_values(
          by=count_column_name, ascending=False
      )
      duplicates = duplicates.drop(count_column_name, axis=1)
      return duplicates, total_test_count
  
file_path: deepchecks/deepchecks/tabular/checks/train_test_validation/train_test_samples_mix.py
imports: from typing import Any, List
  import pandas
  from pandas.core.dtypes.common import is_integer_dtype
  from deepchecks.core import CheckResult
  from deepchecks.tabular import Context, TrainTestCheck
  from deepchecks.utils.abstracts.train_test_samples_mix import TrainTestSamplesMixAbstract
  from deepchecks.utils.strings import format_percent
  from deepchecks.utils.typing import Hashable
label_desc: Use image node_id 1 for calling a global function with example usage: _create_train_test_joined_duplicate_frame(first, second, columns) and returns: duplicates,  total_test_count