code: def __init__(self, patience: int = 25):  # type: ignore
      super().__init__()
      self.patience = patience
      self.num_snapshot = 0
      self.best_score = -math.inf
      self.worst_score: Optional[float] = None
  
imports: import math
  from typing import Optional
  from cftool.misc import Incrementer
  from .schema import TrainerMonitor
label_desc: Use image node_id 1 to create a new BasicMonitor object from inherited base classes: TrainerMonitor with example: obj = BasicMonitor(patience)