code: def test_fit_twice_raises():
      model = BoringModel()
      trainer = Trainer(
          limit_train_batches=1,
          limit_test_batches=1,
          num_sanity_val_steps=0,
          max_epochs=1,
          strategy="ddp_spawn",
          barebones=True,
      )
      trainer.fit(model)
      trainer.test(
          model
      )  # make sure testing in between doesnt impact the result
      trainer.fit_loop.max_epochs += 1
      with pytest.raises(
          NotImplementedError, match=r"twice.*is not supported"
      ):
          trainer.fit(model)
  
imports: import os
  from multiprocessing import Process
  from unittest import mock
  from unittest.mock import ANY, Mock, call, patch
  import pytest
  import torch
  from lightning.fabric.plugins import ClusterEnvironment
  from lightning.pytorch import Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.strategies import DDPStrategy
  from lightning.pytorch.strategies.launchers.multiprocessing import _GlobalStateSnapshot, _MultiProcessingLauncher
  from lightning.pytorch.trainer.states import TrainerFn
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 11 for calling a global function with example usage: test_fit_twice_raises() without return types