          logger.verbose("Enabled TensorBoard Logging")
          return tensorboard
  
      def toggle_mask(self):
          logger.info("Flipping mask display")
          self._samples.toggle_mask_display()
  
      def train_one_step(self, viewer, timelapse_kwargs):
          """ Running training on a batch of images for each side.
  
 
</s> remove         self._display_mask = not self._display_mask
 </s> add         display_mask = not self._display_mask
        print("\n")  # Break to not garble loss output
        logger.info("Toggling mask display %s...", "on" if display_mask else "off")
        self._display_mask = display_mask </s> remove         self._trigger_file = os.path.join(PATHCACHE, ".preview_trigger")
        logger.debug("Initialized: %s (trigger_file: %s)",
                     self.__class__.__name__, self._trigger_file)

    def set(self):
        """ Place the trigger file into the cache folder """
        if not os.path.isfile(self._trigger_file):
            with open(self._trigger_file, "w"):
 </s> add         self._trigger_files = dict(update=os.path.join(PATHCACHE, ".preview_trigger"),
                                   mask_toggle=os.path.join(PATHCACHE, ".preview_mask_toggle"))
        logger.debug("Initialized: %s (trigger_files: %s)",
                     self.__class__.__name__, self._trigger_files)

    def set(self, trigger_type):
        """ Place the trigger file into the cache folder

        Parameters
        ----------
        trigger_type: ["update", "mask_toggle"]
            The type of action to trigger. 'update': Full preview update. 'mask_toggle': toggle
            mask on and off
         """
        trigger = self._trigger_files[trigger_type]
        if not os.path.isfile(trigger):
            with open(trigger, "w"): </s> remove     """ Set the global preview trigger if it has not always been set and return.
 </s> add     """ Set the global preview trigger if it has not already been set and return.
        """ Toggle the mask overlay on or off based on user input. """
          logger.verbose("Enabled TensorBoard Logging")
          return tensorboard
  
      def toggle_mask(self):
        """ Toggle the mask overlay on or off based on user input. """
          self._samples.toggle_mask_display()
  
      def train_one_step(self, viewer, timelapse_kwargs):
          """ Running training on a batch of images for each side.
  
keep keep keep keep replace keep keep keep keep keep
 Updates
  - Change shortcut key to M
  - Slight optimizations
  - GUI support for mask toggling 
plugins/train/trainer/_base.py