code: def test_check_for_missing_main_guard():
      launcher = _MultiProcessingLauncher(
          strategy=Mock(), start_method="spawn"
      )
      with mock.patch(
          "lightning.pytorch.strategies.launchers.multiprocessing.mp.current_process",
          return_value=Mock(
              _inheriting=True
          ),  # pretend that main is importing itself
      ), pytest.raises(
          RuntimeError,
          match="requires that your script guards the main",
      ):
          launcher.launch(function=Mock())
  
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 10 for calling a global function with example usage: test_check_for_missing_main_guard() without return types