code: def check_early_stop(trainer, epochs):
      """Checks an early stopping trigger and warns the user if it's the case
  
      :param trainer: The trainer used for training
      :param epochs: The maximum number of epochs
      """
      end_epoch = trainer.updater.get_iterator("main").epoch
      if end_epoch < (epochs - 1):
          logging.warning(
              "Hit early stop at epoch "
              + str(end_epoch)
              + "\nYou can change the patience or set it to 0 to run all epochs"
          )
  
label_desc: Use image node_id 1 for calling a global function with example usage: check_early_stop(trainer, epochs) without return types