class_docstr: Find new labels in test.
  
  Parameters
  ----------
  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.
class_docstr_tok: ["Find","new","labels","in","test",".","Parameters","--","--","--","--","--","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 label column's number of different new labels to be less or equal to the threshold.
  
  Parameters
  ----------
  max_new : int , default: 0
      Number of different new labels value types which is the maximum allowed.
docstr_tok: ["Add","condition","-","require","label","column","'s","number","of","different","new","labels","to","be","less","or","equal","to","the","threshold",".","Parameters","--","--","--","--","--","max_new",":","int",",","default",":","0","Number","of","different","new","labels","value","types","which","is","the","maximum","allowed","."]
code: def add_condition_new_labels_number_less_or_equal(
      self, max_new: int = 0
  ):
      """Add condition - require label column's number of different new labels to be less or equal to the threshold.
  
      Parameters
      ----------
      max_new : int , default: 0
          Number of different new labels value types which is the maximum allowed.
      """
  
      def condition(result: Dict) -> ConditionResult:
          if result:
              new_labels = result["new_labels"]
              num_new_labels = len(new_labels)
              details = f"Found {num_new_labels} new labels in test data: {new_labels}"
              category = (
                  ConditionCategory.PASS
                  if num_new_labels <= max_new
                  else ConditionCategory.FAIL
              )
              return ConditionResult(category, details)
          return ConditionResult(
              ConditionCategory.PASS, "No new labels found"
          )
  
      return self.add_condition(
          f"Number of new label values is less or equal to {max_new}",
          condition,
      )
  
file_path: deepchecks/deepchecks/tabular/checks/train_test_validation/new_label_train_test.py
imports: from typing import Dict
  import pandas
  from deepchecks.core import CheckResult, ConditionCategory, ConditionResult
  from deepchecks.core.reduce_classes import ReduceLabelMixin
  from deepchecks.tabular import Context, TrainTestCheck
  from deepchecks.utils.strings import format_percent
label_desc: Use image node_id 5 for calling the NewLabelTrainTest obj's underlying member method code with example usage: obj.add_condition_new_labels_number_less_or_equal(max_new) and returns: self, ConditionResult, ConditionResult