class_docstr: Base functionality for conflicting labels checks.
class_docstr_tok: ["Base","functionality","for","conflicting","labels","checks","."]
docstr: Add condition - require ratio of samples with conflicting labels less or equal to max_ratio.
  
  Parameters
  ----------
  max_ratio : float , default: 0
      Maximum ratio of samples with multiple labels.
docstr_tok: ["Add","condition","-","require","ratio","of","samples","with","conflicting","labels","less","or","equal","to","max_ratio",".","Parameters","--","--","--","--","--","max_ratio",":","float",",","default",":","0","Maximum","ratio","of","samples","with","multiple","labels","."]
code: def add_condition_ratio_of_conflicting_labels_less_or_equal(
      self: Self, max_ratio=0
  ) -> Self:
      """Add condition - require ratio of samples with conflicting labels less or equal to max_ratio.
  
      Parameters
      ----------
      max_ratio : float , default: 0
          Maximum ratio of samples with multiple labels.
      """
  
      def max_ratio_condition(
          result: t.Dict[str, t.Any]
      ) -> ConditionResult:
          percent = t.cast(
              float, result["percent_of_conflicting_samples"]
          )
          details = f"Ratio of samples with conflicting labels: {format_percent(percent)}"
          category = (
              ConditionCategory.PASS
              if percent <= max_ratio
              else ConditionCategory.FAIL
          )
          return ConditionResult(category, details)
  
      return self.add_condition(
          f"Ambiguous sample ratio is less or equal to {format_percent(max_ratio)}",
          max_ratio_condition,
      )
  
imports: 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 ConflictingLabelsAbstract obj's underlying member method code with example usage: obj.add_condition_ratio_of_conflicting_labels_less_or_equal(max_ratio) and returns: self, ConditionResult