code: def __init__(
      self,
      runner: jiant_runner.JiantRunner,
      save_every_steps,
      eval_every_steps,
      save_checkpoint_every_steps,
      no_improvements_for_n_evals,
      checkpoint_saver,
      output_dir,
      verbose: bool = True,
      save_best_model: bool = True,
      load_best_model: bool = True,
      save_last_model: bool = True,
      log_writer: BaseZLogger = PRINT_LOGGER,
  ):
      self.runner = runner
      self.save_every_steps = save_every_steps
      self.eval_every_steps = eval_every_steps
      self.save_checkpoint_every_steps = save_checkpoint_every_steps
      self.no_improvements_for_n_evals = no_improvements_for_n_evals
      self.checkpoint_saver = checkpoint_saver
      self.output_dir = output_dir
      self.verbose = verbose
      self.save_best_model = save_best_model
      self.load_best_model = load_best_model
      self.save_last_model = save_last_model
      self.log_writer = log_writer
  
      self.best_val_state = None
      self.best_state_dict = None
      self.val_state_history = []
      self.train_state = None
      self.full_break = False
      self.single_use_check = False
      self.num_evals_since_improvement = 0
  
      self.model = self.runner.model
      self.device = self.runner.device
      self.global_train_config = (
          self.runner.jiant_task_container.global_train_config
      )
  
imports: from dataclasses import dataclass
  from typing import Dict
  import torch.nn
  import jiant.proj.main.runner
  import jiant.proj.main.components.task_sampler
  from jiant.shared.runner import save_model_with_metadata, compare_steps_max_steps
  from jiant.utils.python.datastructures import ExtendedDataClassMixin
  from jiant.utils.python.functional import always_false
  from jiant.utils.torch_utils import copy_state_dict, CPU_DEVICE, get_model_for_saving
  from jiant.utils.zlog import BaseZLogger, PRINT_LOGGER
  from jiant.shared.metarunner import AbstractMetarunner
label_desc: Use image node_id 1 to create a new JiantMetarunner object from inherited base classes: AbstractMetarunner with example: obj = JiantMetarunner(runner, save_every_steps, eval_every_steps, save_checkpoint_every_steps, no_improvements_for_n_evals, checkpoint_saver, output_dir, verbose, save_best_model, load_best_model, save_last_model, log_writer)