class_docstr: Check if test dates are present in train data.
  
  Parameters
  ----------
  n_to_show : int , default: 5
      Number of common dates to show.
  n_samples : int , default: 10_000_000
      number of samples to use for this check.
  random_state : int, default: 42
      random seed for all check internals.
docstr: Add condition - require leakage ratio to be less or equal to threshold.
  
  Parameters
  ----------
  max_ratio : float , default: 0
      Maximum ratio of leakage.
docstr_tok: ["Add","condition","-","require","leakage","ratio","to","be","less","or","equal","to","threshold",".","Parameters","--","--","--","--","--","max_ratio",":","float",",","default",":","0","Maximum","ratio","of","leakage","."]
code: def add_condition_leakage_ratio_less_or_equal(
      self, max_ratio: float = 0
  ):
      """Add condition - require leakage ratio to be less or equal to threshold.
  
      Parameters
      ----------
      max_ratio : float , default: 0
          Maximum ratio of leakage.
      """
  
      def max_ratio_condition(result: float) -> ConditionResult:
          details = (
              f"Found {format_percent(result)} leaked dates"
              if result > 0
              else "No leaked dates found"
          )
          category = (
              ConditionCategory.PASS
              if result <= max_ratio
              else ConditionCategory.FAIL
          )
          return ConditionResult(category, details)
  
      return self.add_condition(
          f"Date leakage ratio is less or equal to {format_percent(max_ratio)}",
          max_ratio_condition,
      )
  
file_path: deepchecks/deepchecks/tabular/checks/train_test_validation/date_train_test_leakage_duplicates.py
imports: import pandas
  from deepchecks.core import CheckResult, ConditionCategory, ConditionResult
  from deepchecks.tabular import Context, TrainTestCheck
  from deepchecks.utils.strings import format_datetime, format_percent
label_desc: Use image node_id 3 for calling the DateTrainTestLeakageDuplicates obj's underlying member method code with example usage: obj.add_condition_leakage_ratio_less_or_equal(max_ratio) and returns: self, ConditionResult