class_docstr: Base data duplicates check.
docstr: Add condition - require duplicate ratio to be less or equal to max_ratio.
  
  Parameters
  ----------
  max_ratio : float , default: 0.05
      Maximum ratio of duplicates.
docstr_tok: ["Add","condition","-","require","duplicate","ratio","to","be","less","or","equal","to","max_ratio",".","Parameters","--","--","--","--","--","max_ratio",":","float",",","default",":","0.05","Maximum","ratio","of","duplicates","."]
code: def add_condition_ratio_less_or_equal(
      self: Self, max_ratio: float = 0.05
  ) -> Self:
      """Add condition - require duplicate ratio to be less or equal to max_ratio.
  
      Parameters
      ----------
      max_ratio : float , default: 0.05
          Maximum ratio of duplicates.
      """
  
      def max_ratio_condition(
          result: t.Union[float, t.Dict[str, float]]
      ) -> ConditionResult:
          if isinstance(result, dict):
              result = t.cast(float, result["percent_of_duplicates"])
          elif not isinstance(result, float):
              raise ValueError(
                  f"Unexpected check result value type {type(result)}"
              )
  
          details = f"Found {format_percent(result)} duplicate data"
          category = (
              ConditionCategory.PASS
              if result <= max_ratio
              else ConditionCategory.WARN
          )
          return ConditionResult(category, details)
  
      return self.add_condition(
          f"Duplicate data ratio is less or equal to {format_percent(max_ratio)}",
          max_ratio_condition,
      )
  
file_path: deepchecks/deepchecks/utils/abstracts/data_duplicates.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 DataDuplicatesAbstract obj's underlying member method code with example usage: obj.add_condition_ratio_less_or_equal(max_ratio) and returns: self, ConditionResult