class_docstr: Detect samples in the test data that appear also in training data.
  
  Parameters
  ----------
  {text_normalization_params:1*indent}
  n_samples : int , default: 10_000_000
      number of samples to use for this check.
  n_to_show : int , default: 10
      number of samples that appear in test and training data to show.
  random_state : int, default: 42
      random seed for all check internals.
  {max_text_length_for_display_param:1*indent}
class_docstr_tok: ["Detect","samples","in","the","test","data","that","appear","also","in","training","data",".","Parameters","--","--","--","--","--","{","text_normalization_params:1","*","indent","}","n_samples",":","int",",","default",":","10_000_000","number","of","samples","to","use","for","this","check",".","n_to_show",":","int",",","default",":","10","number","of","samples","that","appear","in","test","and","training","data","to","show",".","random_state",":","int",",","default",":","42","random","seed","for","all","check","internals",".","{","max_text_length_for_display_param:1","*","indent","}"]
code: def _get_duplicate_indices(
      self,
      train: TextData,
      test: TextData,
      train_samples: t.Sequence[str],
      test_samples: t.Sequence[str],
  ):
      normalization_kwargs = self._text_normalization_kwargs
      train_sample_hashes = hash_samples(
          normalize_samples(train_samples, **normalization_kwargs)
      )
      test_sample_hashes = hash_samples(
          normalize_samples(test_samples, **normalization_kwargs)
      )
  
      train_df = pd.DataFrame(
          {
              "hash": train_sample_hashes,
              "Text": train_samples,
              "Dataset": ["train" for _ in range(len(train_samples))],
              "Sample ID": train.get_original_text_indexes(),
          }
      )
      test_df = pd.DataFrame(
          {
              "hash": test_sample_hashes,
              "Text": test_samples,
              "Dataset": ["test" for _ in range(len(test_samples))],
              "Sample ID": test.get_original_text_indexes(),
          }
      )
  
      hash_intersection = set(train_sample_hashes).intersection(
          set(test_sample_hashes)
      )
      df = pd.concat([test_df, train_df])
      return df["hash"].isin(hash_intersection), df
  
file_path: deepchecks/deepchecks/nlp/checks/train_test_validation/train_test_sample_mix.py
imports: import typing
  import numpy
  import pandas
  from deepchecks.core import CheckResult
  from deepchecks.core.errors import DeepchecksValueError
  from deepchecks.nlp import Context, TrainTestCheck
  from deepchecks.nlp._shared_docs import docstrings
  from deepchecks.nlp.text_data import TextData
  from deepchecks.nlp.utils.text import cut_string, hash_samples, normalize_samples
  from deepchecks.utils.abstracts.train_test_samples_mix import TrainTestSamplesMixAbstract
  from deepchecks.utils.other import to_ordional_enumeration
  from deepchecks.utils.strings import format_list, format_percent, truncate_string
label_desc: Use image node_id 4 for calling the TrainTestSamplesMix obj's underlying member method code with example usage: obj._get_duplicate_indices(train, test, train_samples, test_samples) and returns: df,  df