class_docstr: Base data duplicates check.
docstr: Add condition - require ratio of test data samples that appear in train data to be less or equal to the         threshold.
  
  Parameters
  ----------
  max_ratio : float , default: 0.05
      Max allowed ratio of test data samples to appear in train data
docstr_tok: ["Add","condition","-","require","ratio","of","test","data","samples","that","appear","in","train","data","to","be","less","or","equal","to","the","threshold",".","Parameters","--","--","--","--","--","max_ratio",":","float",",","default",":","0.05","Max","allowed","ratio","of","test","data","samples","to","appear","in","train","data"]
code: def add_condition_duplicates_ratio_less_or_equal(
      self: Self, max_ratio: float = 0.05
  ) -> Self:
      """Add condition - require ratio of test data samples that appear in train data to be less or equal to the\
           threshold.
  
          Parameters
          ----------
          max_ratio : float , default: 0.05
              Max allowed ratio of test data samples to appear in train data
          """
  
      def condition(result: dict) -> ConditionResult:
          ratio = result["ratio"]
          details = (
              f"Percent of test data samples that appear in train data: {format_percent(ratio)}"
              if ratio
              else "No samples mix found"
          )
          category = (
              ConditionCategory.PASS
              if ratio <= max_ratio
              else ConditionCategory.FAIL
          )
          return ConditionResult(category, details)
  
      return self.add_condition(
          f"Percentage of test data samples that appear in train data "
          f"is less or equal to {format_percent(max_ratio)}",
          condition,
      )
  
file_path: deepchecks/deepchecks/utils/abstracts/train_test_samples_mix.py
imports: import abc
  import typing
  from typing_extensions import Self
  from deepchecks.core import ConditionCategory, ConditionResult
  from deepchecks.utils.strings import format_percent
label_desc: Use image node_id 1 for calling the TrainTestSamplesMixAbstract obj's underlying member method code with example usage: obj.add_condition_duplicates_ratio_less_or_equal(max_ratio) and returns: self, ConditionResult