code: def save_models_and_eval(
      self,
      trainer,
      dataset_dict,
      model_folder,
      test_interval,
      tester,
      splits_to_eval=None,
      collate_fn=None,
  ):
      epoch = trainer.epoch
      tester.test(
          dataset_dict,
          epoch,
          trainer.models["trunk"],
          trainer.models["embedder"],
          splits_to_eval,
          collate_fn,
      )
      prev_best_epoch, _ = self.get_best_epoch_and_accuracy(
          tester, self.validation_split_name
      )
      (
          is_new_best,
          curr_accuracy,
          best_epoch,
          best_accuracy,
      ) = self.is_new_best_accuracy(
          tester, self.validation_split_name, epoch
      )
      self.record_keeper.save_records()
      trainer.step_lr_plateau_schedulers(curr_accuracy)
      self.save_models(
          trainer, model_folder, epoch, epoch - test_interval
      )  # save latest model
      if is_new_best:
          c_f.LOGGER.info("New best accuracy! {}".format(curr_accuracy))
          curr_suffix = "best%d" % best_epoch
          prev_suffix = (
              "best%d" % prev_best_epoch
              if prev_best_epoch is not None
              else None
          )
          self.save_models(
              trainer, model_folder, curr_suffix, prev_suffix
          )  # save best model
      return best_epoch
  
imports: import os
  import sqlite3
  import torch
  from .None import common_functions
label_desc: Use image node_id 7 for calling the HookContainer obj's underlying member method code with example usage: obj.save_models_and_eval(trainer, dataset_dict, model_folder, test_interval, tester, splits_to_eval, collate_fn) and returns: best_epoch