code: def test_swa_resume_training_from_checkpoint(tmpdir, crash_on_epoch):
      model = SwaTestModel(crash_on_epoch=crash_on_epoch)
      resume_model = SwaTestModel()
      _swa_resume_training_from_checkpoint(tmpdir, model, resume_model)
  
imports: import logging
  import os
  from pathlib import Path
  from typing import ContextManager, Optional
  from unittest import mock
  import pytest
  import torch
  from lightning.pytorch import Trainer
  from lightning.pytorch.callbacks import StochasticWeightAveraging
  from lightning.pytorch.demos.boring_classes import BoringModel, RandomDataset, RandomIterableDataset
  from lightning.pytorch.strategies import Strategy
  from lightning.pytorch.strategies.launchers import _MultiProcessingLauncher
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from torch import nn
  from torch.optim.lr_scheduler import LambdaLR
  from torch.optim.swa_utils import SWALR
  from torch.utils.data import DataLoader
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 14 for calling a global function with example usage: test_swa_resume_training_from_checkpoint(tmpdir, crash_on_epoch) without return types