code: def snapshot(self, new_score: float) -> bool:
      self.num_snapshot += 1
      if self.worst_score is None:
          self.worst_score = new_score
      else:
          self.worst_score = min(new_score, self.worst_score)
      if new_score > self.best_score:
          self.best_score = new_score
          return True
      return False
  
imports: import math
  from typing import Optional
  from cftool.misc import Incrementer
  from .schema import TrainerMonitor
label_desc: Use image node_id 2 for calling the BasicMonitor obj's underlying member method code with example usage: obj.snapshot(new_score) and returns: False, True