code: def update(self, event, instance):
      if event == Events.OPTIMIZATION_START:
          line = self._header(instance) + "\n"
      elif event == Events.OPTIMIZATION_STEP:
          is_new_max = self._is_new_max(instance)
          if self._verbose == 1 and not is_new_max:
              line = ""
          else:
              colour = Colours.purple if is_new_max else Colours.black
              line = self._step(instance, colour=colour) + "\n"
      elif event == Events.OPTIMIZATION_END:
          line = "=" * self._header_length + "\n"
  
      if self._verbose:
          print(line, end="")
      self._update_tracker(event, instance)
  
imports: from __future__ import print_function
  import os
  import json
  import warnings
  from pathlib import Path
  from .observer import _Tracker
  from .event import Events
  from .util import Colours
label_desc: Use image node_id 11 for calling the ScreenLogger obj's underlying member method code with example usage: obj.update(event, instance) without return types